s32k322 boot issue

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

s32k322 boot issue

337 Views
YongxiangLi
Contributor I

Hi

  We encountered an anomaly while developing with the S32K322 microcontroller using RTD version 6.0.0. To eliminate interference from upper-layer application code, we created a blank S32K322 project, compiled it, and successfully flashed it to the target board. However, we observed that when the assembly code for disabling WDG0 (Watchdog 0) is executed in the startup code, the chip immediately triggers a HardFault exception. Upon investigation, we found that the memory address range 0x404800 to 0x414000 is entirely filled with 0xFFFFFFFF. Interestingly, when the assembly code for disabling WDG0 is removed, the data in that memory region returns to normal. We would greatly appreciate any assistance in providing a solution or further troubleshooting suggestions.

 

Best regards.

Yongxiang Li

Tags (3)
0 Kudos
Reply
9 Replies

291 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @YongxiangLi,

Can you share the blank project along with the binary so that I can test it?

 

Thank you,

BR, Daniel

 

0 Kudos
Reply

276 Views
YongxiangLi
Contributor I

Hi @danielmartynek 

Additional context: once we removed the code that disables WDG0, the MCU boots fine. However, connecting a debugger still frequently triggers a hard fault — we suspect a possible watchdog timeout, but we aren't 100% sure. Hopefully this helps with the analysis.

Best regards.

Yongxiang Li

0 Kudos
Reply

280 Views
YongxiangLi
Contributor I

Hi, @danielmartynek 

  Thanks for your reply, here is the blank project generated by S32DS with RTD6.0.0.

 

Best regards

Yongxiang Li

 

0 Kudos
Reply

255 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @YongxiangLi,

Is HSE_FW installed on the MCU?

Do you have more MCU/boards that can replicate the problem?

 

Thank you

0 Kudos
Reply

99 Views
YongxiangLi
Contributor I

Hi @danielmartynek ,

HSE_FW is not installed on MCU, the Reset_Handler in Project_Settings/Startup_Code/startup_cm7.s is the entry of MCU. The problem is replicated on all our s32k322 MCUs.

Best regards

Yongxiang Li

0 Kudos
Reply

5 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @YongxiangLi,

What you observe is unexpected.
I cannot reproduce this behavior on my side, which is the expected outcome.

SWT_0 WDOG is disabled by default (CR[WEN] = 0), unless HSE_FW is enabled and APP_SWT_INIT is configured in the boot configuration word.
The SWT_0 module is also clocked by default, so accessing it should not cause any issues.
PRTN1_COFB0_CLKEN[28]
PRTN1_COFB0_STAT[28]


Before executing the routine, please check all relevant ME_ME and SWT registers.


Additionally, please read the following ID registers to rule out any related issues:
SIUL2 MCU ID Register #1 (MIDR1)
SIUL2 MCU ID Register #2 (MIDR2)

 

BR, Daniel

 

 

 

 

0 Kudos
Reply

314 Views
YongxiangLi
Contributor I

The 0xFFFFFFFF which filled in range 0x404800 to 0x414000 also cause init_data_bss load error, the len will be recognized as 0xffffffff and MCU boot will be failed.

YongxiangLi_0-1781071691759.png

 

0 Kudos
Reply

322 Views
db16122
Contributor III

watchdog may protect the memory area to be erase by mistake. Enable the watchdog can make MCU under protection

0 Kudos
Reply

316 Views
YongxiangLi
Contributor I

Thanks for your reply! The watchdog is closed by the start code in Project_Settings/Startup_Code/startup_cm7.s rather than by my logic. When the MCU do 'ldr r0, =0x40270000', MCU falls into hard fault.

YongxiangLi_0-1781071083832.png

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2379238%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379238%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%3CSPAN%3EWe%3C%2FSPAN%3E%20%3CSPAN%3Eencountered%3C%2FSPAN%3E%20%3CSPAN%3Ean%3C%2FSPAN%3E%20%3CSPAN%3Eanomaly%3C%2FSPAN%3E%20%3CSPAN%3Ewhile%3C%2FSPAN%3E%20%3CSPAN%3Edeveloping%3C%2FSPAN%3E%20%3CSPAN%3Ewith%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3ES32K322%3C%2FSPAN%3E%20%3CSPAN%3Emicrocontroller%3C%2FSPAN%3E%20%3CSPAN%3Eusing%3C%2FSPAN%3E%20%3CSPAN%3ERTD%3C%2FSPAN%3E%20%3CSPAN%3Eversion%3C%2FSPAN%3E%20%3CSPAN%3E6.0.0.%3C%2FSPAN%3E%20%3CSPAN%3ETo%3C%2FSPAN%3E%20%3CSPAN%3Eeliminate%3C%2FSPAN%3E%20%3CSPAN%3Einterference%3C%2FSPAN%3E%20%3CSPAN%3Efrom%3C%2FSPAN%3E%20%3CSPAN%3Eupper-layer%3C%2FSPAN%3E%20%3CSPAN%3Eapplication%3C%2FSPAN%3E%20%3CSPAN%3Ecode%2C%3C%2FSPAN%3E%20%3CSPAN%3Ewe%3C%2FSPAN%3E%20%3CSPAN%3Ecreated%3C%2FSPAN%3E%20%3CSPAN%3Ea%3C%2FSPAN%3E%20%3CSPAN%3Eblank%3C%2FSPAN%3E%20%3CSPAN%3ES32K322%3C%2FSPAN%3E%20%3CSPAN%3Eproject%2C%3C%2FSPAN%3E%20%3CSPAN%3Ecompiled%3C%2FSPAN%3E%20%3CSPAN%3Eit%2C%3C%2FSPAN%3E%20%3CSPAN%3Eand%3C%2FSPAN%3E%20%3CSPAN%3Esuccessfully%3C%2FSPAN%3E%20%3CSPAN%3Eflashed%3C%2FSPAN%3E%20%3CSPAN%3Eit%3C%2FSPAN%3E%20%3CSPAN%3Eto%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Etarget%3C%2FSPAN%3E%20%3CSPAN%3Eboard.%3C%2FSPAN%3E%20%3CSPAN%3EHowever%2C%3C%2FSPAN%3E%20%3CSPAN%3Ewe%3C%2FSPAN%3E%20%3CSPAN%3Eobserved%3C%2FSPAN%3E%20%3CSPAN%3Ethat%3C%2FSPAN%3E%20%3CSPAN%3Ewhen%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Eassembly%3C%2FSPAN%3E%20%3CSPAN%3Ecode%3C%2FSPAN%3E%20%3CSPAN%3Efor%3C%2FSPAN%3E%20%3CSPAN%3Edisabling%3C%2FSPAN%3E%20%3CSPAN%3EWDG0%3C%2FSPAN%3E%20%3CSPAN%3E(Watchdog%3C%2FSPAN%3E%20%3CSPAN%3E0)%3C%2FSPAN%3E%20%3CSPAN%3Eis%3C%2FSPAN%3E%20%3CSPAN%3Eexecuted%3C%2FSPAN%3E%20%3CSPAN%3Ein%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Estartup%3C%2FSPAN%3E%20%3CSPAN%3Ecode%2C%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Echip%3C%2FSPAN%3E%20%3CSPAN%3Eimmediately%3C%2FSPAN%3E%20%3CSPAN%3Etriggers%3C%2FSPAN%3E%20%3CSPAN%3Ea%3C%2FSPAN%3E%20%3CSPAN%3EHardFault%3C%2FSPAN%3E%20%3CSPAN%3Eexception.%3C%2FSPAN%3E%20%3CSPAN%3EUpon%3C%2FSPAN%3E%20%3CSPAN%3Einvestigation%2C%3C%2FSPAN%3E%20%3CSPAN%3Ewe%3C%2FSPAN%3E%20%3CSPAN%3Efound%3C%2FSPAN%3E%20%3CSPAN%3Ethat%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Ememory%3C%2FSPAN%3E%20%3CSPAN%3Eaddress%3C%2FSPAN%3E%20%3CSPAN%3Erange%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E0x404800%3C%2FSPAN%3E%20%3CSPAN%3Eto%3C%2FSPAN%3E%20%3CSPAN%3E0x414000%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%3Eis%3C%2FSPAN%3E%20%3CSPAN%3Eentirely%3C%2FSPAN%3E%20%3CSPAN%3Efilled%3C%2FSPAN%3E%20%3CSPAN%3Ewith%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E0xFFFFFFFF%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%20%3CSPAN%3EInterestingly%2C%3C%2FSPAN%3E%20%3CSPAN%3Ewhen%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Eassembly%3C%2FSPAN%3E%20%3CSPAN%3Ecode%3C%2FSPAN%3E%20%3CSPAN%3Efor%3C%2FSPAN%3E%20%3CSPAN%3Edisabling%3C%2FSPAN%3E%20%3CSPAN%3EWDG0%3C%2FSPAN%3E%20%3CSPAN%3Eis%3C%2FSPAN%3E%20%3CSPAN%3Eremoved%2C%3C%2FSPAN%3E%20%3CSPAN%3Ethe%3C%2FSPAN%3E%20%3CSPAN%3Edata%3C%2FSPAN%3E%20%3CSPAN%3Ein%3C%2FSPAN%3E%20%3CSPAN%3Ethat%3C%2FSPAN%3E%20%3CSPAN%3Ememory%3C%2FSPAN%3E%20%3CSPAN%3Eregion%3C%2FSPAN%3E%20%3CSPAN%3Ereturns%3C%2FSPAN%3E%20%3CSPAN%3Eto%3C%2FSPAN%3E%20%3CSPAN%3Enormal.%3C%2FSPAN%3E%20%3CSPAN%3EWe%3C%2FSPAN%3E%20%3CSPAN%3Ewould%3C%2FSPAN%3E%20%3CSPAN%3Egreatly%3C%2FSPAN%3E%20%3CSPAN%3Eappreciate%3C%2FSPAN%3E%20%3CSPAN%3Eany%3C%2FSPAN%3E%20%3CSPAN%3Eassistance%3C%2FSPAN%3E%20%3CSPAN%3Ein%3C%2FSPAN%3E%20%3CSPAN%3Eproviding%3C%2FSPAN%3E%20%3CSPAN%3Ea%3C%2FSPAN%3E%20%3CSPAN%3Esolution%3C%2FSPAN%3E%20%3CSPAN%3Eor%3C%2FSPAN%3E%20%3CSPAN%3Efurther%3C%2FSPAN%3E%20%3CSPAN%3Etroubleshooting%3C%2FSPAN%3E%20%3CSPAN%3Esuggestions.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3EBest%20regards.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EYongxiang%20Li%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379790%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379790%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%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EHSE_FW%20is%20not%20installed%20on%20MCU%2C%20the%26nbsp%3BReset_Handler%20in%26nbsp%3BProject_Settings%2FStartup_Code%2Fstartup_cm7.s%20is%20the%20entry%20of%20MCU.%20The%20problem%20is%20replicated%20on%20all%20our%20s32k322%20MCUs.%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EYongxiang%20Li%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379542%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379542%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%2F263626%22%20target%3D%22_blank%22%3E%40YongxiangLi%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EIs%20HSE_FW%20installed%20on%20the%20MCU%3F%3C%2FP%3E%0A%3CP%3EDo%20you%20have%20more%20MCU%2Fboards%20that%20can%20replicate%20the%20problem%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379481%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379481%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%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAdditional%20context%3A%20once%20we%20removed%20the%20code%20that%20disables%20WDG0%2C%20the%20MCU%20boots%20fine.%20However%2C%20connecting%20a%20debugger%20still%20frequently%20triggers%20a%20hard%20fault%20%E2%80%94%20we%20suspect%20a%20possible%20watchdog%20timeout%2C%20but%20we%20aren't%20100%25%20sure.%20Hopefully%20this%20helps%20with%20the%20analysis.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EBest%20regards.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EYongxiang%20Li%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379443%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379443%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20Thanks%20for%20your%20reply%2C%20here%20is%20the%20blank%20project%20generated%20by%20S32DS%20with%20RTD6.0.0.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3EYongxiang%20Li%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379377%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379377%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%2F263626%22%20target%3D%22_blank%22%3E%40YongxiangLi%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ECan%20you%20share%20the%20blank%20project%20along%20with%20the%20binary%20so%20that%20I%20can%20test%20it%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThank%20you%2C%3C%2FP%3E%0A%3CP%3EBR%2C%20Daniel%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379304%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379304%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E0xFFFFFFFF%20which%20filled%20in%20range%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E0x404800%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eto%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E0x414000%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Balso%20cause%26nbsp%3Binit_data_bss%20load%20error%2C%20the%20len%20will%20be%20recognized%20as%200xffffffff%20and%20MCU%20boot%20will%20be%20failed.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22YongxiangLi_0-1781071691759.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22YongxiangLi_0-1781071691759.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F388473i63F5AB56C55375DC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22YongxiangLi_0-1781071691759.png%22%20alt%3D%22YongxiangLi_0-1781071691759.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%20for%20your%20reply!%20The%20watchdog%20is%20closed%20by%20the%20start%20code%20in%20Project_Settings%2FStartup_Code%2Fstartup_cm7.s%20rather%20than%20by%20my%20logic.%20When%20the%20MCU%20do%20'ldr%20r0%2C%20%3D0x40270000'%2C%20MCU%20falls%20into%20hard%20fault.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22YongxiangLi_0-1781071083832.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22YongxiangLi_0-1781071083832.png%22%20style%3D%22width%3A%20373px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F388472i334616B7EE729A05%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22YongxiangLi_0-1781071083832.png%22%20alt%3D%22YongxiangLi_0-1781071083832.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2379278%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k322%20boot%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2379278%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ewatchdog%20may%20protect%20the%20memory%20area%20to%20be%20erase%20by%20mistake.%20Enable%20the%20watchdog%20can%20make%20MCU%20under%20protection%3C%2FP%3E%3C%2FLINGO-BODY%3E