Merge Bootloader with Application

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Merge Bootloader with Application

3,736件の閲覧回数
sebasira
Senior Contributor I

Hello everybody!

 

I have an application to wich I'd like to add bootloader capability. I'm working with CW v6.1 and MCF51QE128. I took the QE bootloader developed by Pual Zhang for the DEMO QE board, did some modifications and now it's working with my custom hardware.

 

With HCS12 with uses a PRM File, this was accomplished with the HEXINCLUDE line. But I don't know how to do it with ColdFire MCUs.

 

Also, I guess I should have two compilations parameters, right? One for the version with bootloader and another for the one without it.

 

Thanks in advance!!!

 

 

SebaS

ラベル(1)
0 件の賞賛
14 返答(返信)

2,518件の閲覧回数
sarmassi
Contributor II

HI Seba and Hi chary,

I'm interested about this issue, I have developed my application for mcf51qe128.

Until today i have downloaded the fw with cyclone. Now there is a need to download with the UART.

I have a .pdf  "Implement UART Boot-loader On Coldfire V1 Products" written by Paol Zhang, but I haven't the project of him. Where can I find that? Thank you

0 件の賞賛

2,518件の閲覧回数
markdonkers
Contributor I

Hello Massimo,

I am also trying to get the project files that should accompany the PDF. Have you received anything from NXP or anyone else in the forum?

Thanks for any help you can provide.

By the way, what development environment are you using? I am using CodeWarrior for Microcontrollers v10.6. Perhaps we could collaborate.

Regards,

Mark

0 件の賞賛

2,518件の閲覧回数
TomE
Specialist II

Search for "Paul Zhang", finds:

https://community.nxp.com/message/410529 

There's an "Example.zip" file attached to the above. Might that have some of the code you want?

Where is that PDF file you have stored (on the Internet)? Does NXP have it available?

There's a link to the PDF in the above link; that is now at:

http://read.pudn.com/downloads132/sourcecode/embed/561869/Implement%20UART%20Bootloader%20On%20CF%20... 

Tom

0 件の賞賛

2,518件の閲覧回数
markdonkers
Contributor I

Hi Tom,

Thanks for the assistance.

Yes, the PDF that you referenced is the one that I am using.

I did notice the Example.zip file, but hadn't downloaded it because I assumed it was someone else's incomplete project and wouldn't get me to where I needed to be. That said, I've since downloaded it, installed CW for MCUs v6.3, fixed the issue the original poster was having, and changed the MCU derivative to mine (JE256).

It looks like I can use this as a starting point but I sure wish I had the original project. I'm still surprised there isn't a de facto standard or sample project (in CW for MCUs  v10.x) for serial download! If you know of one, please let me know :smileyhappy:

Cheers,

Mark

0 件の賞賛

2,518件の閲覧回数
chary
Contributor I

Hi Sebas,

The coldfire controllers are provided with linker file which is eqvt to PRM file in HCS12 controller.

You can make required modifications in this file to meet your requirement.

I was able to successfully merge the application and bootloader developed by paul zhang to meet my final requirement.

Only thing you need to take care is there should not be any memory overlap between bootloader and application.

Thanks,

Chary

0 件の賞賛

2,518件の閲覧回数
sebasira
Senior Contributor I

Hi Chary, thanks for your reply!

I've already modified the LCF file so there's no memory overlapping between my code and the bootloader. But I don't know how to tell the linker that it should add the .s19 file of the bootloader.

Can you explain me how to do that, or show me how you achieved this?

Thank you very much!

Best Regards

SebaS

2,518件の閲覧回数
chary
Contributor I

Hi Seba,

Once you make sure that there is no memory overlapping between bootloader

and application , all you need to do is just merge application and

bootloader S19 files into a single S19 file. you just need to dump this

file to the controller using P&E tool.

The merged file should contain only 1 S0 record and 1 S7 record.

If you have any other queries you can ask me.

Thanks,

Chary

0 件の賞賛

2,518件の閲覧回数
sebasira
Senior Contributor I

Hi again Chray!

I didn't realize I could do that, editing the .s19 file. But I'd like to merge them with the compiler, so I can debug it. Do you know how to do that? (As I said before, in HCS12 there was and instruction that could be used in the PRM, named  "HEXINCLUDE" wich allows the linker to append a .s19 file)

Best Regards!

SebaS

0 件の賞賛

2,518件の閲覧回数
chary
Contributor I

Hi,

Once you dump the the merged file through P&E , we can do the debugging in

assembly window. If one is good at assembly language he can very well debug

using P&E tool.

I haven't used "HEXINCLUDE" in PRM file till date though I have

implemented bootloader functionality in MC9S12XDP512.

I am novice regarding this. Explain me briefly .

Regards,

Chary

0 件の賞賛

2,518件の閲覧回数
sebasira
Senior Contributor I

Hello,

PRM is to HCS12 as the LCF is to ColdFire... In the PRM file, there's an instruction to include additional pre-compile code to the one you're compiling now.

It sintax is like:

HEXINCLUDE "Bootloader.s19"

And it appends the bootlaoder.s19 code to your current project. Then, as you said, we debug the bootloader in ASM code, and you can also debug your current application as you normally do.

The idea is to debug both the app and the bootloader as a whole project. Because it has happened to me that bootloader works, application works but when merged some problems arrise.

Hope it helps a little, please excuse my english.

SebaS

0 件の賞賛

2,518件の閲覧回数
chary
Contributor I

Hi Seba,

What you are saying might work , If we are able to merge abs files of both

application and bootloader into a single file.

But here we are merging 2 S19 files , with S19 file we can only debug

through Assembly window to my knowledge.

I will explain you what I have done.

I have merged both S19 file of app and bootloader and dumped the merged

file through P&E tool. I made sure that the system executes application

always on every Reset. when ever user wishes to update the firmware in the

system , he needs to change condition such that on Reset system starts

running bootloader , once system finishes writing S3 records to internal

flash the condition is changed to previous state, which is system executes

application on every Reset there after.

I hope I am clear.

Regards,

Chary

0 件の賞賛

2,518件の閲覧回数
sebasira
Senior Contributor I

Sorry for the late replay!

I think I understand what you said... You mean that you merged them as if they were text-files, right?

I know that's a way to do it, but it stills don't satisfy my need.

I can't believe there's no way to add bootloader (or any other s19) to the app.

0 件の賞賛

2,518件の閲覧回数
sebasira
Senior Contributor I

I'm sorry, I've just realize that I miss-wrote the keyword. It should be HEXFILE instead of HEXINCLUDE

0 件の賞賛

2,518件の閲覧回数
chary
Contributor I

Hi Seba,

Sorry for the delay in reply , In that case you will able to debug the software only in Assembly language if you are just including S19 files

same you can do by just merging application and bootloader S19 file .

I think you mean to say that you can debug some portion of your software in assembly and some portion is C language.

Am I right ?

do reply to this mail.

Regards,

Chary

0 件の賞賛