2017-10-16 01:18 AM
Hello.
So in STM32F205RE flash memory
span
s from 0x08000000 to 0x0807FFFF. Any app will be programmed starting from the address 0x08000000. But I want to place it at the starting address of 0x08040000 and don't use the beginning of the flash at all. I'm using IAR and I changed the ROM boundaries in the Linker file to be 0x08040000-0x0807FFFF, vector table starting address also moved to 0x08040000 and finally SCB->VTOR = 0x08040000. But the program just doesn't work. It loads my app to the flash, but it doesn't work properly. For some reason it gets stuck on the first while() located in RCC (while ((RCC->BDCR & RCC_BDCR_LSERDY)==0);) and in the debugger it feels like it doesn't do anything before that (even though it shows that it does) -- step overs are done very quickly, in a instant.So is it supposed to be not working like that and application have to be placed at the beginning of flash or am I missing something? I wanted to place a custom bootloader at the 0x08000000, but I also wanted my application to load at first, not the bootloader.
Thank you!
Solved! Go to Solution.
2017-10-16 02:07 AM
The design has the processor starting the code based on the vector table mapped at zero, when the FLASH is shadowed there this correlates to 0x0800000 and not some other address you pull out of the air. This means it runs the loader and you then need to pass control to the app.
One should probably avoid redoing the clock work done by the loader in the app.
2017-10-16 02:07 AM
The design has the processor starting the code based on the vector table mapped at zero, when the FLASH is shadowed there this correlates to 0x0800000 and not some other address you pull out of the air. This means it runs the loader and you then need to pass control to the app.
One should probably avoid redoing the clock work done by the loader in the app.
2017-10-16 04:12 AM
Thank you!