Combine App & Bootloader - CW6.3, Coldfire V1, MCF51CN128

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Combine App & Bootloader - CW6.3, Coldfire V1, MCF51CN128

1,386 Views
ignisuti
Contributor IV

I've seen lots of referrences to using an HEXFILE command in the PRM file for the purpose of adding your Bootloader's S19 file into your Application code. The output S19 can then be given to production so they only have to flash one file.

 

However, this doesn't seem to work with my project. I have a LCF file instead of a PRM file and it doesn't seem to allow me to add commands like HEXFILE.

 

Can someone please help?

Labels (1)
0 Kudos
5 Replies

377 Views
kef
Specialist I

HEXFILE and PRM applies to (R)S08 and S12(X). Coldfire linker uses LCF file. Documentation says there's INCLUDE directive, which can load (binary?) file to specified section. I tried INCLUDE directive, but linker always complains that it can't find specified file. I tried putting my binary file to all project subfolders, but it doesn't help. Documentation for CW for MCUs V6.3 also says this:

"File Mappings target settings panel must specify resource file for all files that have the same extension as the binary file"

I was trying to include *.bin file. I checked that file mappings for bin is resource file.

 

Try making service request for this here

0 Kudos

377 Views
ignisuti
Contributor IV

I thought I'd report back in case anyone else was having this issue.

 

The missing peice of the puzzle was that I had to "add" the BIN file to the CodeWarrior IDE. I added it to my "Linker Files" folder, but I think it can be added anywhere.

 

The other steps are also important:

-Edit > Standard Settings > Linker > ColdFire Linker > Generate Binary Image

-Edit > Standard Settings > Target > File Mappings > Set BIN file's "Flags" to be a resource file.

-Use the INCLUDE directive in your LCF file (similar to this exmaple):

 

  .text :  {    *(.text)    . = ALIGN (0x4);    *(.rodata)    . = ALIGN (0x4);    ___ROM_AT = .;    ___DATA_ROM = .;    INCLUDE Project.abs.bin      } >> code

 

 

0 Kudos

377 Views
sebasira
Senior Contributor I

Hi!

I was also looking for the equivalent of HEXFILE for LCF files...

I've got a question regarding of where to put the INCLUDE keyword.

I've got a special section for the bootloader as you can see here:


MEMORY {

   userram           (RWX) :    ORIGIN = 0x00800000, LENGTH = 0x00002000

   BootLoad         (RX)  :      ORIGIN = 0x00000410, LENGTH = 0x000018F0

   myflash           (RX)  :      ORIGIN = 0x00001D00, LENGTH = 0x00000400    

   VectorReMap  (RX)  :      ORIGIN = 0x00002100, LENGTH = 0x00000400

   code              (RX)  :      ORIGIN = 0x00002500, LENGTH = 0x0001DB00 

}

I believe I should place the keyword so the binary would be inside BootLoad instead of code, right? Like this:

#  Code placement for bootloader section

.text_bootload : {

     * (.text_bootload)

     . = ALIGN (0x4);

     INCLUDE Project.abs.bin

} >> BootLoad


Thanks in advance!!

SebaS

0 Kudos

377 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HEXFILE only work in prm file for 8bit/16bit device. it can't work in lcf file for coldfire. INCLUDE is used for coldfire,

i just posted the INCLUDE usage sample code here.

https://community.freescale.com/thread/308318

0 Kudos

377 Views
trytohelp
NXP Employee
NXP Employee

Hi,

Same problem/question has been logged under

https://community.freescale.com/message/333829

Regards

Pascal

0 Kudos