cancel
Showing results for 
Search instead for 
Did you mean: 

SPC5 - calling bootloader from application

alessandro2
Associate III
Posted on March 21, 2016 at 16:24

Hello,

as far as I've understood reading the documentation (RM0045), the microcontroller boot mode can be selected by configuring PA8 and PA9 pins, which state is latched at microcontroller startup. I think using the boot pins may not be the best solution for my application.. I'd like my microcontroller to boot from flash and be able to call the bootloader from the application  at anytime. How can I do this? I couldn't find any information on this subject in the documentation. thanks in advance for your support.

#boot #spc5 #bootloader #startup
5 REPLIES 5
kevin239955_st
Associate II
Posted on April 06, 2016 at 18:15

I don't work for ST or anything but we've done similar and we boot from Flash by loading the bootloader to address 0x00000000 after a valid RCHW (so the executable code starts at 0x00000008). If the SPC560B doesn't see a valid RCHW (this is documented in the reference manual) it won't boot your software.

To branch back to the bootloader from your application you could branch to the address, e.g.

__asm (''e_b __bootloader_addr__'');

Hope that's of some help.

Kev

lizheng887
Associate II
Posted on April 26, 2016 at 05:10

Hi kevin,

can you give a detailed description, how should I deal with the relationship between bootloader and appliction?

and, in the HEX file :0400000300000008F1

how should I deal with this line?

thanks.

kevin239955_st
Associate II
Posted on April 27, 2016 at 18:51

Hi Michael

You can use a linker definitions file to locate your bootloader at address 0 and your application at the next sector down (e.g. 0x18000). With a good RCHW (as I mentioned in the last post) the bootloader will boot first and you can do whatever you want in there and branch to the application, again as I described previously. I'd leave the RCHW blank for the application to ensure that a corrupt bootloader won't mean the processor booting directly to the application.

As for your second question, I haven't got a clue - that's just a list of numbers with no context whatsoever.

Best of luck.

Kevin

lizheng887
Associate II
Posted on April 28, 2016 at 02:47

Hi kevin,

''

use a linker definitions file to locate your bootloader at address 0 and your application at the next sector down (e.g. 0x18000)

'', I don't know how to realize the definitions, can you give me an example? I am using SPC5Studio v3.7.

And, the bootloader and application should be two separate projects?

Thanks for your reply.

kevin239955_st
Associate II
Posted on May 12, 2016 at 18:53

Michael

I don't use SPC5Studio so I don't know what the equivalent is in that IDE. If you're using that (and presumably ST's O/S) I can't really help any further.

I'd imagine though that the bootloader should be a separate project. For example with Wind River's VxWorks and Workbench IDE there's a ''New Project'' type of bootloader. Maybe there's an equivalent in SPC5Studio.

Kevin