2010-09-16 01:06 AM
How to define memory address for code storage?
2011-05-17 05:07 AM
Probably you can put the function into it's own named section and use the linker script to position the named section.
How is your bootloader going to start if it is at the top of memory? The STM32 boots from address zero. Not sure if you can do this with your environment, but why don't you test with two separate applications, loading the bootloader and the application into flash one after the other?2011-05-17 05:07 AM
Hi,
>How is your bootloader going to start if it is at the top >of memory? The STM32 boots from address zero. You're right. I think using the System memory only to boot from and then jump to the bootloader application with it's own set of vectors. >but why don't you test with two separate applications I didn't think about this option but it seems a good idea to me! Henk2011-05-17 05:07 AM
You should put the boot code at the front of the FLASH, and park the application code behind it.
Depending on your toolset, you should be able to edit the options/setting which define the base address and size of the RAM and FLASH. You would configure those into subsets of the available space. You'll have to use the RAM, even if just for the stack. It will be hard for the C compiler not to use any RAM. To be honest if you want a small boot loader, it is best to code it in assembler where at least you have some control.2011-05-17 05:07 AM
... have you looked at the ST application notes that illustrate how to do In-Application Programming (IAP) - which involves having a bootloader to reprogram the flash...
Try AN2557 first...