Hi,
I am using a Secondary bootloader in LPC804. I have flashed an example bootloader as well as the example app. I am able to jump into the application by firing the 'b' command only. if I press the reset button then it stays in the bootloader even if the IRQ line doesn't low but it should jump into the app.
I am using this as a reference: https://www.nxp.com/docs/en/application-note/AN12373.pdf
We debugged the issue is with the pushAppFlag variable shown below in function. we observed that the value is other than 0x44 and it is not consistent.
static uint8_t isbootFromReset(void)
{
/* Was loader booted from app (1) or from FLASH on reset (0x44)? */
if((uint8_t)*pushAppFlag == 0x44){
return 1;
}
return 0;
}
已解决! 转到解答。
@Alice_Yang , @frank_m , Thanks.
It is required to set the 0x44 value. This issue is fixed in the provided updated Keil_startup.s file.
@Alice_Yang , @frank_m , Thanks.
It is required to set the 0x44 value. This issue is fixed in the provided updated Keil_startup.s file.
Some toolchains provide a _NOINIT section (or similar) for values/variables which are not initialized during startup. Such a boot flag must reside there.
After power-up, RAM cells can contain random values. For our BL, we are using "safe" values for such variables, which consists of an array of 2 values. The first index contains the normal value, the second the binary negated value (e.g. 00/FF, 55/AA). This way, you can catch at least some corruptions, and add some additional safety.
I did not work with your MCU variant specifically.
> We debugged the issue is with the pushAppFlag variable shown below in function. we observed that the value is other than 0x44 and it is not consistent.
How does your bootloader initialize memory ?
Did you take care that the location(s) of this variable is not initialized in the second-stage BL startup ?