2019-10-25 04:03 AM
Hello:
I use this to check the address is application in stm32f207VET6.
void go2APP(void) {
uint32_t JumpAddress;
pFunction Jump_To_Application;
//Check
if (((*(__IO uint32_t*) FLASH_APP_ADDR) & 0x2FFE0000) == 0x20000000) {
printf("APP Start...\n");
HAL_Delay(100);
// Jump to user application //
JumpAddress = *(__IO uint32_t*) (FLASH_APP_ADDR + 4);
Jump_To_Application = (pFunction) JumpAddress;
// Initialize user application's Stack Pointer //
__set_MSP(*(__IO uint32_t*) FLASH_APP_ADDR);
Jump_To_Application();
} else {
printf("No APP found!!!\n");
}
}
When i erase the whole chip i get this
But when i use jflash to program an application hex to the application address
I get this
Even i use the flash base address to check but also get 0x20020000 .
Should i change the 0x2FFE0000 to 0x2FFD0000 ?
Thank you
Solved! Go to Solution.
2019-10-25 07:42 AM
Perhaps just mask with 0xFFF00003, all the test is doing is ensuring that the stack pointer is in RAM, it is a crude test, and perhaps a hold-over from parts with smaller memories. Keil doesn't place it at the end of memory, but at the end of the allotted space the linker knows about. GNU/GCC typically places it at the top-of-RAM, but a lot of ST scripts are defective and use an unaligned address. The address pre-decrements, so you can park it just beyond, ie for 128KB system you use 0x20020000, and not 0x2001FFFF
2019-10-25 06:57 AM
Why do you think that check should pass?
If you’re trying to test if it’s something other than 0xFFFFFFFF just do that instead.
2019-10-25 07:40 AM
/
2019-10-25 07:40 AM
you should see the second picture before you type something.
My question is why i flash the application to the 0x8008000 but could not pass the check.
2019-10-25 07:42 AM
Perhaps just mask with 0xFFF00003, all the test is doing is ensuring that the stack pointer is in RAM, it is a crude test, and perhaps a hold-over from parts with smaller memories. Keil doesn't place it at the end of memory, but at the end of the allotted space the linker knows about. GNU/GCC typically places it at the top-of-RAM, but a lot of ST scripts are defective and use an unaligned address. The address pre-decrements, so you can park it just beyond, ie for 128KB system you use 0x20020000, and not 0x2001FFFF
2019-10-25 07:44 AM