AnsweredAssumed Answered

STM32 F0 Reset Handler code question

Question asked by Charles Miller on Jan 25, 2016
Latest reply on Jan 25, 2016 by Clive One
In the startup_stm32f0xx.s files, at the start of the Reset_Handler procedure, the following code occurs:
01.;;Check if boot space corresponds to test memory
02. 
03.        LDR R0,=0x00000004
04.        LDR R1, [R0]
05.        LSRS R1, R1, #24
06.        LDR R2,=0x1F
07.        CMP R1, R2
08.         
09.        BNE ApplicationStart

If the reset vector (address at 0x08000004) lives in the 0x08xxxxxx (flash) or 0x20xxxxxx (RAM), then the CMP R1,R2/BNE ApplicationStart jumps over the clock setup and CFGR1 register setup.

From here, I'm confused.  Why would someone build an image with the reset vector in 0x1Fxxxxxxxx memory space?  I'm not sure what the comment,
Check if boot space corresponds to test memory
is saying.  Does this have to do with the internal bootloader living at 0x1FFFF004?  One would not put a reset vector there, would one?

Thanks for any clarification as to what the code is doing!

Outcomes