cancel
Showing results for 
Search instead for 
Did you mean: 

How to define memory address for code storage?

henk2
Associate II
Posted on September 16, 2010 at 10:06

How to define memory address for code storage?

4 REPLIES 4
stforum2
Associate II
Posted on May 17, 2011 at 14:07

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?

henk2
Associate II
Posted on May 17, 2011 at 14:07

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!

Henk

Posted on May 17, 2011 at 14:07

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on May 17, 2011 at 14:07

... 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...