N947 Dual Boot - knowing which image was booted

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

N947 Dual Boot - knowing which image was booted

Jump to solution
268 Views
JohnKay
Contributor II

Once I boot from Image 1, is there an attribute that I can programmatically check to indicate that I booted from Image 1 and an update image should be written to Image 0? 

Dual Boot and the Secure Provisioning Tool both work great!

Labels (1)
0 Kudos
1 Solution
257 Views
marek-trmac
NXP Employee
NXP Employee

Hi John,

it should be possible to read image version stored in the image.

Regards,
Marek

View solution in original post

0 Kudos
3 Replies
242 Views
JohnKay
Contributor II

Got it. All I have to do is check the PC.

 

static __inline__ void * get_pc(void) {

void *pc;

asm("mov %0, pc" : "=r"(pc));

return pc;

}

0 Kudos
252 Views
JohnKay
Contributor II

Thanks for your reply.

The question is, in a dual boot configuration, how can i determine which image i booted from, 0 or 1.

If I booted from Image 0, then I know that I should load the new firmware into Image 1, or vise versa.

I could read and compare the versions in both Images, but if the validation failed on the new Image 0, then I would fallback to Image 1, but comparing the header data, I would think I booted from Image 0.

Not a show stopper, I'll find a workaround.

Thank you.

0 Kudos
258 Views
marek-trmac
NXP Employee
NXP Employee

Hi John,

it should be possible to read image version stored in the image.

Regards,
Marek
0 Kudos