cancel
Showing results for 
Search instead for 
Did you mean: 

How do I place and run an application from the Flash address other than 0x08000000?

Valeev.Kamil
Associate II
Posted on October 16, 2017 at 10:18

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on October 16, 2017 at 11:07

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.

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

View solution in original post

2 REPLIES 2
Posted on October 16, 2017 at 11:07

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on October 16, 2017 at 11:12

Thank you!