Flashing Bootloader & Image in a single .s19 file

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

Flashing Bootloader & Image in a single .s19 file

1,914 Views
S_B_D
Contributor I
Hi All,
 
Currently I'm Flashing the UART Bootloader onto the JM32 MCU with the USB Multilink and after that using the bootloader application to load the Firmware image.
During production, I would like to Flash both the Bootloader and the Image in a single file onto the JM32.
How do I modify the s19 file to contain both the bootloader and the user application?
 
Help is greatly appreciated.
 
SBD
 
 
Labels (1)
0 Kudos
3 Replies

381 Views
tonyp
Senior Contributor II
It depends on how you have setup your bootloader and application.

If your bootloader does not alter the application in any way (e.g., relocation of vectors, decryption, etc.), it's straight-forward.  Simply concatenate the two S19 files into one.  You may have to remove duplicate S9 records, if your tool complains.

If your bootloader relocates vectors, you'll have to add a conditional to prepare the app with vectors in their final position, so they don't overwrite the bootloader's ones.

If you use encryption, you'll have to add a conditional to prepare the app unencrypted.


Message Edited by tonyp on 2009-01-12 02:17 PM
0 Kudos

381 Views
S_B_D
Contributor I
Tonyp,
 
WOW..that was fast.
To tell the truth, I just took the UART Bootloader for the JM32 "as is" from AN2295. I really don't know if the interrupt vector is remapped. My application uses varius interrupt sources so I guess it has to. No encryption is used.
How do I check if the AN2295 bootloader remaps the interupt vector?
 
SBD
0 Kudos

381 Views
tonyp
Senior Contributor II
OK, from a quick overview of the app you mention, it uses relocation by means of JMP table, which implies each vector takes three bytes, not two.

Anyway, you'll have to set up the JMP table inside your code (this part should be conditionally enabled only for when you want to concatenate the resulting S19 with the bootloader S19).

It seems the address of the JMP table itself is part of the communication protocol, so I guess you have an option to define that in the PC portion of the bootloader.
0 Kudos