iMX8QM reset reason issue

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

iMX8QM reset reason issue

1,539 Views
aliaksei_kakhayeu
Contributor III

Hello,

I have a question related to providing "reset reason" on iMX8QM based bord.

We use API call "sc_pm_reset_reason"  (SCUFW 1.15.0). from U-boot which sends PM_FUNC_RESET_REASON message to SCU. Unfortunately we receive always the same value: 0 or 2 (depending on boot media: eMMC or SDCard), which can be translated using imx8qm-scu-firmware/platform/svc/pm/api.h as "0 = Power on reset" "2 = Software reset", so in fact SCUFW just ignores real reset reason, e.g. "3 = Partition watchdog reset"

After some investigation we found that it happens because of different "partitions" set (caller_pt = 1) and read (caller_pt=3) reset reasons.

Another finding is that return value of soc_reset_reason() - it always constant (0 or 2) and does not depend on the real reboot cause.

This post has attached patch with workaround that adds some printings to understand behavior and quick fix for the issue.

Could someone please have a look - thanks in advance!

0 Kudos
Reply
4 Replies

1,179 Views
aliaksei_kakhayeu
Contributor III

Hi @Zhiming_Liu 

We decided to use this  patch - thanks for help!

0 Kudos
Reply

1,465 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @aliaksei_kakhayeu 

Can you share where you trigger WDOG reset? Cortex-A or Cortex-M?

Best Regards,
Zhiming

0 Kudos
Reply

1,453 Views
aliaksei_kakhayeu
Contributor III

Hi @Zhiming_Liu 

I trigger watchdog by manual kernel crashing: "echo c > /proc/sysrq-trigger"  on Cortex-A.

0 Kudos
Reply

1,430 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @aliaksei_kakhayeu 

Would you mind share the POR design on your board?

Here is POR design on i.MX8QM MEK, the SCU WDOG will trigger POR signal to i.MX8. And the watchdog in Linux is a virtual watchdog. From the i.MX8QM MEK perspective, the WDOG reset is implemented as a POR-type reset.

Zhiming_Liu_0-1764645092343.png

Zhiming_Liu_1-1764645460387.png

If you simply want to make the reason for the reset clearer, then this modification is acceptable.


Best Regards,
Zhiming

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2251480%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EiMX8QM%20reset%20reason%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2251480%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20have%20a%20question%20related%20to%20providing%20%22reset%20reason%22%20on%20iMX8QM%20based%20bord.%3C%2FP%3E%3CP%3EWe%20use%20API%20call%20%22%3CSPAN%3Esc_pm_reset_reason%3C%2FSPAN%3E%3CSPAN%3E%22%26nbsp%3B%20(SCUFW%201.15.0).%20from%20U-boot%20which%20sends%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EPM_FUNC_RESET_REASON%20message%20to%20SCU.%20Unfortunately%20we%20receive%20always%20the%20same%20value%3A%200%20or%202%20(depending%20on%20boot%20media%3A%20eMMC%20or%20SDCard)%2C%20which%20can%20be%20translated%20using%26nbsp%3Bimx8qm-scu-firmware%2Fplatform%2Fsvc%2Fpm%2Fapi.h%20as%20%220%20%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EPower%20on%20reset%3C%2FSPAN%3E%3CSPAN%3E%22%20%222%20%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3ESoftware%20reset%3C%2FSPAN%3E%3CSPAN%3E%22%2C%20so%20in%20fact%20SCUFW%20just%20ignores%20real%20reset%20reason%2C%20e.g.%20%223%20%3D%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EPartition%20watchdog%20reset%3C%2FSPAN%3E%3CSPAN%3E%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAfter%20some%20investigation%20we%20found%20that%20it%20happens%20because%20of%20different%20%22partitions%22%20set%20(caller_pt%20%3D%201)%20and%20read%20(caller_pt%3D3)%20reset%20reasons.%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAnother%20finding%20is%20that%20return%20value%20of%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Esoc_reset_reason()%20-%20it%20always%20constant%20(0%20or%202)%20and%20does%20not%20depend%20on%20the%20real%20reboot%20cause.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThis%20post%20has%20attached%20patch%20with%20workaround%20that%20adds%20some%20printings%20to%20understand%20behavior%20and%20quick%20fix%20for%20the%20issue.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ECould%20someone%20please%20have%20a%20look%20-%20thanks%20in%20advance!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2251589%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20iMX8QM%20reset%20reason%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2251589%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F248725%22%20target%3D%22_blank%22%3E%40aliaksei_kakhayeu%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20you%20share%20where%20you%20trigger%20WDOG%20reset%3F%20Cortex-A%20or%20Cortex-M%3F%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2252712%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20iMX8QM%20reset%20reason%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2252712%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F248725%22%20target%3D%22_blank%22%3E%40aliaksei_kakhayeu%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EWould%20you%20mind%20share%20the%20POR%20design%20on%20your%20board%3F%3C%2FP%3E%0A%3CP%3EHere%20is%20POR%20design%20on%20i.MX8QM%20MEK%2C%20the%20SCU%20WDOG%20will%20trigger%20POR%20signal%20to%20i.MX8.%26nbsp%3BAnd%20the%20watchdog%20in%20Linux%20is%20a%20virtual%20watchdog.%20From%20the%20i.MX8QM%20MEK%20perspective%2C%20the%20WDOG%20reset%20is%20implemented%20as%20a%20POR-type%20reset.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Zhiming_Liu_0-1764645092343.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_0-1764645092343.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_0-1764645092343.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_0-1764645092343.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_0-1764645092343.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F368114i959AE07E68C76576%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Zhiming_Liu_0-1764645092343.png%22%20alt%3D%22Zhiming_Liu_0-1764645092343.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Zhiming_Liu_1-1764645460387.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_1-1764645460387.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_1-1764645460387.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_1-1764645460387.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_1-1764645460387.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F368118i42760B1564540305%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Zhiming_Liu_1-1764645460387.png%22%20alt%3D%22Zhiming_Liu_1-1764645460387.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20simply%20want%20to%20make%20the%20reason%20for%20the%20reset%20clearer%2C%20then%20this%20modification%20is%20acceptable.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2252018%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20iMX8QM%20reset%20reason%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2252018%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F151788%22%20target%3D%22_blank%22%3E%40Zhiming_Liu%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20trigger%20watchdog%20by%20manual%20kernel%20crashing%3A%20%22echo%20c%20%26gt%3B%20%2Fproc%2Fsysrq-trigger%22%26nbsp%3B%20on%20Cortex-A.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2259485%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20iMX8QM%20reset%20reason%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2259485%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F151788%22%20target%3D%22_blank%22%3E%40Zhiming_Liu%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20decided%20to%20use%20this%26nbsp%3B%20patch%20-%20thanks%20for%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2259489%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20iMX8QM%20reset%20reason%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2259489%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F248725%22%20target%3D%22_blank%22%3E%40aliaksei_kakhayeu%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20also%20working%20on%20an%20iMX8QM%20project%2C%20and%20I%20found%20this%20doc%20very%20helpful%20for%20my%20project.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2Fi-MX8-i-MX8X-Board-Reset%2Fta-p%2F1391130%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fi-MX-Processors-Knowledge-Base%2Fi-MX8-i-MX8X-Board-Reset%2Fta-p%2F1391130%3C%2FA%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E