cancel
Showing results for 
Search instead for 
Did you mean: 

How to place the code to the boot memory?

Carter Lee
Associate III
Posted on December 29, 2017 at 02:58

Dear All,

As I know, STM32Fxxx CPU support 3 types boot mode by selecting the Boot pins.

1.Boot from main Flash memory.

2.Boot from system memory

3.Boot from embedded SRAM.

But I want to know how to place the code to the boot memory? (internal flash, system memory, internal SRAM)

Currently I'm using Keil MDK and STM32F103 Discovery board.

Would you please help and let me know that how are data and code sections merged and where should each section be placed in the memory?

and one more is that I want to know that what kind of disadvantage and advantage there is in each mode(internal flash and system memory and internal SRAM)

In especially, If I want boot mode with internal SRAM then What am I supposed to do in

STM32F103 

Discovery

board.

Is there any example of internal SRAM boot?

#stm32f103
5 REPLIES 5
Posted on December 29, 2017 at 04:27

The BOOTx pin cause the specific memory to shadow at zero. You would therefore build your FLASH based code for 0x08000000, and then the initial SP and PC load from 0 and 4

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 29, 2017 at 04:45

The linker builds a table describing the load region, the code in the --main function unpack and zero data into RAM

The boot from SRAM is mostly used for debugging where data is copied directly into RAM and then rebooted to execute. Code in FLASH could also copy data on to SRAM to similar effect.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 29, 2017 at 04:53

Would you please give me some simple example code 

boot from SRAM

Posted on December 29, 2017 at 04:56

Especially, I want to know more exactly about '

Code in FLASH could also copy data on to SRAM to similar effect.' as you said just now.

Posted on December 29, 2017 at 16:01

Please answer previous profile and biographical questions I've posed to you.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..