N947 Dual Boot - knowing which image was booted

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

N947 Dual Boot - knowing which image was booted

跳至解决方案
740 次查看
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!

标签 (1)
0 项奖励
回复
1 解答
729 次查看
marek-trmac
NXP Employee
NXP Employee

Hi John,

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

Regards,
Marek

在原帖中查看解决方案

0 项奖励
回复
3 回复数
714 次查看
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 项奖励
回复
724 次查看
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 项奖励
回复
730 次查看
marek-trmac
NXP Employee
NXP Employee

Hi John,

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

Regards,
Marek
0 项奖励
回复