Question
Unable to understand the logic in Bootloader to test if user code is present at application address
Posted on February 24, 2016 at 09:17 In the examples provided for STM32(STM32L476G_EVAL), there is a logic written to test whether user code is present in the application address before jumping. /* Test if user code is programmed starting from address ''APPLICATION_ADDRESS'' */ if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000) { /* Jump to user application */ JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4); JumpToApplication = (pFunction) JumpAddress; /* Initialize user application's Stack Pointer */ __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS); JumpToApplication(); } I am unable to understand why 0x2FFE0000 is used to AND with the value of the APPLICATION_ADDRESS. Can someone help me with this? #lmgtfy #stm32 #stm32 #bootloader #bootloader #!stm32
