cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding boot mode in STM32

astree
Associate II
Posted on August 19, 2015 at 13:59

Hi, 

I read datasheet STM32F072xx and  AN2606 but I have a lack of understanding what are User Flash memory, System memory and embedded memory boot mode. 

Does someone could explain me :

First of all I don't understand what ''X memory  is selected as boot space''.

1-Which are the differences and use for each of them?

2- Is all about internal bootloader?

3-Which mode should be chosen for a custom bootloader and why?

#stm32 #bootloader
5 REPLIES 5
Posted on August 19, 2015 at 14:40

The BOOTx pins change the memory which is mapped/shadowed at the ZERO basis. This is where the processor looks for the vector table, and in the Cortex-M0 the only place the table can be.

If you create a custom boot loader, it has to reside at the BASE of the FLASH memory (@ 0x08000000), so it's the first thing to execute when the processor starts as it's also visible @ 0x00000000

As your application isn't now at the base of the FLASH, you need to copy the vector table to the base of RAM (@ 0x20000000) and use the SYSCFG registers to map that @ 0x00000000 so the processor can use it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 19, 2015 at 14:49

FLASH is, well, the non-volatile memory where you normally ''burn'' your program. System memory is the ''ROM'' where the bootloader is located. Embedded SRAM is, well, the SRAM where you normally place the variables, but you could copy part/whole of the program from FLASH into it and run it from there if you want.

JW

astree
Associate II
Posted on August 19, 2015 at 15:13

Ok, and do you have an instance when the SRAM is prefered?

Nesrine M_O
Lead II
Posted on August 19, 2015 at 15:14

Hi pwdusid,

1.''X memory is selected as boot space'' it means that in the application initialization code, you have to relocate the vector table in the start address of this X memory.

2.The embedded bootloader mode is used to reprogram the Flash memory using a serial interfaces. The embedded bootloader code is located in system memory. It is programmed by ST during production.

3.Take a look to  the Boot configuration paragraph in the

http://www.st.com/web/en/resource/technical/document/reference_manual/DM00091010.pdf

  

-Syrine-

Posted on August 19, 2015 at 16:34

Ok, and do you have an instance when the SRAM is preferred?

When you don't want Erase/Write operations on FLASH to stall execution.

When you want to run code faster than FLASH permits. Not sure you have an ART on the F0's to mitigate the slowness of the FLASH with it's wait-states.

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