We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
This question seems to have been asked several times, like http://www.keil.com/forum/18689/. What I want to know is how to burn the program in a customized flash address. I am using STM32F407 and it has 12 flash sectors, 0 ~11. sector 0 starting address 0x08000000 is by default where the program starts. If I want to make the program be burned in sector 11, starting address 0x080E0000, how can I realize it? Following are the steps I have tried but failed.
1. change Option for target -> target -> IROM1 to 0x080E0000 2. change Option for target -> linker -> R/O base to 0x080E0000 3. change Option for target -> debug -> setting -> flash download address to 0x080E0000 4. change FLASH_BASE and VECT_TAB_OFFSET values in SystemInit()
So how I can tell ResetHandler the new address of my main() function which is now in sector 11?
Just remember that the vector table doesn't get relocated until someone/something instructs it to relocate - and the program at an "odd" target address can't patch the vector table since it doesn't even get started unless the vector table has already been remapped or a boot loader picks up from a known start address and then jump into the program.