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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,014 Views
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 Kudos
1 Solution
967 Views
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.

View solution in original post

0 Kudos
4 Replies
968 Views
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 Kudos
962 Views
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 Kudos
982 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello bhavind,

How about your this issue now? 

What the value is about  "pushAppFlag"?

 

BR

Alice

0 Kudos
1,002 Views
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 Kudos