SBL doesn't jump into the application by pressing the reset button

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

SBL doesn't jump into the application by pressing the reset button

跳至解决方案
1,338 次查看
Bhavin_Dhulkotiya
Contributor II

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;
}

0 项奖励
回复
1 解答
1,291 次查看
Bhavin_Dhulkotiya
Contributor II

@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.

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,292 次查看
Bhavin_Dhulkotiya
Contributor II

@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.

0 项奖励
回复
1,286 次查看
frank_m
Senior Contributor III

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.

0 项奖励
回复
1,306 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello bhavind,

How about your this issue now? 

What the value is about  "pushAppFlag"?

 

BR

Alice

0 项奖励
回复
1,326 次查看
frank_m
Senior Contributor III

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 ?

0 项奖励
回复