Power up source identification

cancel
Showing results for 
Search instead for 
Did you mean: 

Power up source identification

293 Views
B_K_Ankur
Contributor IV

Hello Friends,

With I.MX28, is there any way to know the event that caused the device to power up? I mean how to know if the device reset happens due to Watchdog reset? I have checked with HW_POWER_STS status register but didn't have any indication for reset from Watchdog. Based on that I would like to know if the systems fails to boot due to flash corruption/boot failure and boot with other partition.

Any inputs will be appreciated.

Regards,

Ankur

Labels (2)
0 Kudos
7 Replies

66 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ankur

I think except HW_POWER_STS there are no other

ways to know sources of reset. I.MX28 iROM uses other mechanizms

to recover from boot failures due to flash corruption. For example,

according to Table 12-10 (Persistent Bits) of the i.MX28 Reference Manual,

when bit 1 of the HW_RTC_PERSISTENT1 (ROM_SECONDARY_BOOT) is set

"ROM attempts to boot from the secondary image if the boot driver supports it.

This bit is set by the ROM boot driver and cleared by the SDK after repair."

Please look at section 12.12.1.5 (Redundant Boot Support in ROM NAND driver)

MCIMX28RM  about secondary boot details.

Best regards

igor

0 Kudos

66 Views
B_K_Ankur
Contributor IV

Hello Igorpadykov,

Is there any other way to detect it not using secure boot mechanism you have suggested?

Like as I said earlier, I am dealing with firmware recovery mechanism in our device and having trouble in detecting the Kernel Panic(Filesystem Mount failure - due to flash corruption) on u-boot for switching the boot path. The Processor doesnt support the power up event detection (like watchdog reset or power reset).

NAND Memory LAYOUT:

  • SPL       
  • u-boot    
  • u-boot-bak
  • u-boot-env
  • kernel1   
  • kernel2   
  • rootfs1   
  • rootfs2   

     

How to handle following boot flow:

    1. power on the device   

    2. U-boot boots the PATH 1 (kernel1 and rootfs1)

    3. Kernel1 boots but fails to mount Filesystem due to flash corruption

    4. System resets after 10 seconds of panic as the PANIC=10 is in bootargs

    5. u-boot started booting.

    6. ??? How to know if the device now has to use PATH 2 (kernel2 and rootfs2) to boot.

Any suggestions will be helpful.

Regards,

Ankur

0 Kudos

66 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ankur

I think you can write to iRAM some codes, marking

boot stages. So on next power-up check these codes and find where it was failed.

~igor

0 Kudos

66 Views
B_K_Ankur
Contributor IV

Wonderful Suggestion!! I havent thought of that.

Does on processor reset(due to kernel panic) the iRAM get resets too to default cleaning up all the marking?

Is it possible to access iRAM in u-boot ?

Regards,

Ankur

0 Kudos

66 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ankur

no iRAM is not erased on reset, it can be accessed from uboot too.

~igor

0 Kudos

66 Views
B_K_Ankur
Contributor IV

Thanks Igor. Will keep you posted on any issue.

0 Kudos

66 Views
B_K_Ankur
Contributor IV

It worked Igor. Thanks a lot.

Just for Info how it is used in linux (May help other):

char *ptr = (char*) (MX28_OCRAM_ADDR + 0xE400);
char buf[16];
snprintf(buf,sizeof(buf),"Hello");
strncpy(ptr,buf,5);
0 Kudos