S32K388 HSE_SWT Reboot for Fresh Chip flashing

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

S32K388 HSE_SWT Reboot for Fresh Chip flashing

Jump to solution
442 Views
kscz
Contributor III

I have a fresh S32K388 which I'm trying to flash with some from-scratch firmware (this is not AUTOSAR nor RTD). I have the IVT setup to only boot core0, and I have hse_fw_header_start_address just set to zero.

It appears though that this configuration is leading to resets with the MC_RGM DES reporting:
0x00000041 and the MC_RGM FES reporting 0x00010000 which, based on my reading on the S32K3XXRM, implies that HSE watchdog timeouts are leading to a destructive reset based on escalation.

The interesting thing is that this behavior seems to go away when I connect with a j-link, but I can't seem to find a way to disable or service the SWT from my firmware. Do I need to download/install the standard HSE FW for the S32K388?

Is there a reason this is required on the S32K388 and not on the S32K344?

0 Kudos
Reply
1 Solution
374 Views
kscz
Contributor III

Based on this post: https://community.nxp.com/t5/S32K/What-does-it-mean-HSE-SWT-RST-on-S32K311/m-p/1955147

And this image of S32K3xx_DCF_clients.xlxs from an older version of the S32K3XXRM: https://community.nxp.com/t5/S32K/S32K388-HSE-No-Response-Error/m-p/2090937/highlight/true?lightbox-...

It appears I may have solved my problem by writing: 0x40000101 0x00100006 to 0x1B000770in the UTEST memory sector (putting "2" into HSE_CLK_MODE_AND_GSKT_CTRL).

In the current revision of S32K3xx_DCF_clients.xlxs, the description of HSE_CLK_MODE_AND_GSKT_CTRL is as follows:

Screenshot From 2026-07-24 09-14-40.png

But in the S32K3XXRM, I can't find a reference to what I should be configuring in the gasket configuration (the closest looks like "HSE_B" but the table refers to an impossible 1:1 configuration):

Screenshot From 2026-07-24 09-22-01.png

Is this just a documentation update failure? Should I have a 1:4 ratio in HSE_CLK_MODE_AND_GSKT_CTRL if I'm using Option A++ clocking (CORE_CLK at 160MHz, AIPS_SLOW_CLK at 40MHz)?

View solution in original post

0 Kudos
Reply
6 Replies
425 Views
kscz
Contributor III

With some further testing - if I clear all the flags in MC_RGM FES/DES after reading them (so they're not sticky across boots), the boot loop starts to return: FES: 0x00010000 and occasionally DES: 0x00000040 (but most of the time DES: 0x00000000)

And for clarity for the original post, I have the boot configuration word in the IVT set to 0x00000001 - which would seem to imply, in my reading, that only CM7_0_ENABLE is set and there shouldn't be any HSE/SWT_0 setting at all?

0 Kudos
Reply
385 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Could you please provide:

The exact S32K388 part number and chip revision being used.
Confirmation whether HSE firmware has ever been installed on the device (or whether this is a completely blank/factory-fresh device).
The IVT configuration, especially the values of hseFwHeaderStartAddr, appBootAddr, and any other HSE-related IVT fields.
The complete reset status register dump after the reset (MC_RGM_DES, MC_RGM_FES, and any other relevant reset registers).
Whether the issue occurs on multiple devices or only on a single board.
A minimal project/application that reproduces the issue, or at least the startup code sequence executed before the reset occurs.

At the moment it is not clear whether the reset is caused by HSE/SBAF, an application issue, or a device configuration issue, so the above information will help identify the root cause.

0 Kudos
Reply
370 Views
kscz
Contributor III

And just in case my other comment turns out to not be the solution:

  • The chip I am using is labelled S32K388HHMJBS 0P39J CTAJ2507E - let me know if you need me to read some registers for specific chip information
  • HSE Firmware has never been installed - this is a factory-fresh device which I have only flashed with my bare-metal code
  • For the IVT:
    • hseFwHeaderStartAddr is zero
    • recovery_app_start_address is zero
    • I am uncertain which fields to provide from the IVT but everything is basically zero except the header set to 0x5AA55AA5, the boot_config set to 1, and the cm7_0_start_address set to the interrupt vector table
  • I already provided the DES and FES I was getting in the original post, but let me know if those were unclear
  • I will try and get this uploaded - I need to get approval to post this code publicly
0 Kudos
Reply
375 Views
kscz
Contributor III

Based on this post: https://community.nxp.com/t5/S32K/What-does-it-mean-HSE-SWT-RST-on-S32K311/m-p/1955147

And this image of S32K3xx_DCF_clients.xlxs from an older version of the S32K3XXRM: https://community.nxp.com/t5/S32K/S32K388-HSE-No-Response-Error/m-p/2090937/highlight/true?lightbox-...

It appears I may have solved my problem by writing: 0x40000101 0x00100006 to 0x1B000770in the UTEST memory sector (putting "2" into HSE_CLK_MODE_AND_GSKT_CTRL).

In the current revision of S32K3xx_DCF_clients.xlxs, the description of HSE_CLK_MODE_AND_GSKT_CTRL is as follows:

Screenshot From 2026-07-24 09-14-40.png

But in the S32K3XXRM, I can't find a reference to what I should be configuring in the gasket configuration (the closest looks like "HSE_B" but the table refers to an impossible 1:1 configuration):

Screenshot From 2026-07-24 09-22-01.png

Is this just a documentation update failure? Should I have a 1:4 ratio in HSE_CLK_MODE_AND_GSKT_CTRL if I'm using Option A++ clocking (CORE_CLK at 160MHz, AIPS_SLOW_CLK at 40MHz)?

0 Kudos
Reply
366 Views
kscz
Contributor III

As a quick correction - I meant to write "HSE_CLK at 160MHz and AIPS_SLOW_CLK at 40MHz" for that last sentence in the above comment.

0 Kudos
Reply
234 Views
kscz
Contributor III

As far as we can tell - this has solved the issue. I would like to see the documentation updated to reflect that Option A++ requires this gasket change @davidtosenovjan 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2397906%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K388%20HSE_SWT%20Reboot%20for%20Fresh%20Chip%20flashing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2397906%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20have%20a%20fresh%20S32K388%20which%20I'm%20trying%20to%20flash%20with%20some%20from-scratch%20firmware%20(this%20is%20not%20AUTOSAR%20nor%20RTD).%20I%20have%20the%20IVT%20setup%20to%20only%20boot%20core0%2C%20and%20I%20have%26nbsp%3Bhse_fw_header_start_address%20just%20set%20to%20zero.%3C%2FP%3E%3CP%3EIt%20appears%20though%20that%20this%20configuration%20is%20leading%20to%20resets%20with%20the%20MC_RGM%20DES%20reporting%3A%3CBR%20%2F%3E0x00000041%20and%20the%20MC_RGM%20FES%20reporting%200x00010000%20which%2C%20based%20on%20my%20reading%20on%20the%20S32K3XXRM%2C%20implies%20that%20HSE%20watchdog%20timeouts%20are%20leading%20to%20a%20destructive%20reset%20based%20on%20escalation.%3C%2FP%3E%3CP%3EThe%20interesting%20thing%20is%20that%20this%20behavior%20seems%20to%20go%20away%20when%20I%20connect%20with%20a%20j-link%2C%20but%20I%20can't%20seem%20to%20find%20a%20way%20to%20disable%20or%20service%20the%20SWT%20from%20my%20firmware.%20Do%20I%20need%20to%20download%2Finstall%20the%20standard%20HSE%20FW%20for%20the%20S32K388%3F%3C%2FP%3E%3CP%3EIs%20there%20a%20reason%20this%20is%20required%20on%20the%20S32K388%20and%20not%20on%20the%20S32K344%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2397922%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K388%20HSE_SWT%20Reboot%20for%20Fresh%20Chip%20flashing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2397922%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWith%20some%20further%20testing%20-%20if%20I%20clear%20all%20the%20flags%20in%20MC_RGM%20FES%2FDES%20after%20reading%20them%20(so%20they're%20not%20sticky%20across%20boots)%2C%20the%20boot%20loop%20starts%20to%20return%3A%20FES%3A%200x00010000%20and%20occasionally%20DES%3A%26nbsp%3B0x00000040%20(but%20most%20of%20the%20time%26nbsp%3BDES%3A%26nbsp%3B0x00000000)%3C%2FP%3E%3CP%3EAnd%20for%20clarity%20for%20the%20original%20post%2C%20I%20have%20the%20boot%20configuration%20word%20in%20the%20IVT%20set%20to%200x00000001%20-%20which%20would%20seem%20to%20imply%2C%20in%20my%20reading%2C%20that%20only%26nbsp%3BCM7_0_ENABLE%20is%20set%20and%20there%20shouldn't%20be%20any%20HSE%2FSWT_0%20setting%20at%20all%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2398827%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K388%20HSE_SWT%20Reboot%20for%20Fresh%20Chip%20flashing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2398827%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EBased%20on%20this%20post%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FWhat-does-it-mean-HSE-SWT-RST-on-S32K311%2Fm-p%2F1955147%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FWhat-does-it-mean-HSE-SWT-RST-on-S32K311%2Fm-p%2F1955147%3C%2FA%3E%3C%2FP%3E%3CP%3EAnd%20this%20image%20of%20S32K3xx_DCF_clients.xlxs%20from%20an%20older%20version%20of%20the%20S32K3XXRM%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K388-HSE-No-Response-Error%2Fm-p%2F2090937%2Fhighlight%2Ftrue%3Flightbox-message-images-2090937%3D336074i0A601700196531EB%23M48394%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K388-HSE-No-Response-Error%2Fm-p%2F2090937%2Fhighlight%2Ftrue%3Flightbox-message-images-2090937%3D336074i0A601700196531EB%23M48394%3C%2FA%3E%3C%2FP%3E%3CP%3EIt%20appears%20I%20may%20have%20solved%20my%20problem%20by%20writing%3A%200x40000101%200x00100006%20to%200x1B000770in%20the%20UTEST%20memory%20sector%20(putting%20%222%22%20into%20HSE_CLK_MODE_AND_GSKT_CTRL).%3C%2FP%3E%3CP%3EIn%20the%20current%20revision%20of%26nbsp%3BS32K3xx_DCF_clients.xlxs%2C%20the%20description%20of%26nbsp%3BHSE_CLK_MODE_AND_GSKT_CTRL%20is%20as%20follows%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393169i88B08F362289A390%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20alt%3D%22Screenshot%20From%202026-07-24%2009-14-40.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EBut%20in%20the%20S32K3XXRM%2C%20I%20can't%20find%20a%20reference%20to%20what%20I%20should%20be%20configuring%20in%20the%20gasket%20configuration%20(the%20closest%20looks%20like%20%22HSE_B%22%20but%20the%20table%20refers%20to%20an%20impossible%201%3A1%20configuration)%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393170i66095E738A3017CE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20alt%3D%22Screenshot%20From%202026-07-24%2009-22-01.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIs%20this%20just%20a%20documentation%20update%20failure%3F%20Should%20I%20have%20a%201%3A4%20ratio%20in%26nbsp%3BHSE_CLK_MODE_AND_GSKT_CTRL%20if%20I'm%20using%20Option%20A%2B%2B%20clocking%20(CORE_CLK%20at%26nbsp%3B160MHz%2C%26nbsp%3BAIPS_SLOW_CLK%20at%2040MHz)%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2398851%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K388%20HSE_SWT%20Reboot%20for%20Fresh%20Chip%20flashing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2398851%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAnd%20just%20in%20case%20my%20other%20comment%20turns%20out%20to%20not%20be%20the%20solution%3A%3C%2FP%3E%3CUL%3E%3CLI%3EThe%20chip%20I%20am%20using%20is%20labelled%20S32K388HHMJBS%200P39J%20CTAJ2507E%20-%20let%20me%20know%20if%20you%20need%20me%20to%20read%20some%20registers%20for%20specific%20chip%20information%3C%2FLI%3E%3CLI%3EHSE%20Firmware%20has%20never%20been%20installed%20-%20this%20is%20a%20factory-fresh%20device%20which%20I%20have%20only%20flashed%20with%20my%20bare-metal%20code%3C%2FLI%3E%3CLI%3EFor%20the%20IVT%3A%3CUL%3E%3CLI%3EhseFwHeaderStartAddr%20is%20zero%3C%2FLI%3E%3CLI%3Erecovery_app_start_address%20is%20zero%3C%2FLI%3E%3CLI%3EI%20am%20uncertain%20which%20fields%20to%20provide%20from%20the%20IVT%20but%20everything%20is%20basically%20zero%20except%20the%20header%20set%20to%26nbsp%3B0x5AA55AA5%2C%20the%20boot_config%20set%20to%201%2C%20and%20the%26nbsp%3Bcm7_0_start_address%20set%20to%20the%20interrupt%20vector%20table%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3CLI%3EI%20already%20provided%20the%20DES%20and%20FES%20I%20was%20getting%20in%20the%20original%20post%2C%20but%20let%20me%20know%20if%20those%20were%20unclear%3C%2FLI%3E%3CLI%3EI%20will%20try%20and%20get%20this%20uploaded%20-%20I%20need%20to%20get%20approval%20to%20post%20this%20code%20publicly%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2398862%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K388%20HSE_SWT%20Reboot%20for%20Fresh%20Chip%20flashing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2398862%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAs%20a%20quick%20correction%20-%20I%20meant%20to%20write%20%22HSE_CLK%20at%20160MHz%20and%20AIPS_SLOW_CLK%20at%2040MHz%22%20for%20that%20last%20sentence%20in%20the%20above%20comment.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2398811%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K388%20HSE_SWT%20Reboot%20for%20Fresh%20Chip%20flashing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2398811%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECould%20you%20please%20provide%3A%3C%2FP%3E%0A%3CP%3EThe%20exact%20S32K388%20part%20number%20and%20chip%20revision%20being%20used.%3CBR%20%2F%3EConfirmation%20whether%20HSE%20firmware%20has%20ever%20been%20installed%20on%20the%20device%20(or%20whether%20this%20is%20a%20completely%20blank%2Ffactory-fresh%20device).%3CBR%20%2F%3EThe%20IVT%20configuration%2C%20especially%20the%20values%20of%20hseFwHeaderStartAddr%2C%20appBootAddr%2C%20and%20any%20other%20HSE-related%20IVT%20fields.%3CBR%20%2F%3EThe%20complete%20reset%20status%20register%20dump%20after%20the%20reset%20(MC_RGM_DES%2C%20MC_RGM_FES%2C%20and%20any%20other%20relevant%20reset%20registers).%3CBR%20%2F%3EWhether%20the%20issue%20occurs%20on%20multiple%20devices%20or%20only%20on%20a%20single%20board.%3CBR%20%2F%3EA%20minimal%20project%2Fapplication%20that%20reproduces%20the%20issue%2C%20or%20at%20least%20the%20startup%20code%20sequence%20executed%20before%20the%20reset%20occurs.%3C%2FP%3E%0A%3CP%3EAt%20the%20moment%20it%20is%20not%20clear%20whether%20the%20reset%20is%20caused%20by%20HSE%2FSBAF%2C%20an%20application%20issue%2C%20or%20a%20device%20configuration%20issue%2C%20so%20the%20above%20information%20will%20help%20identify%20the%20root%20cause.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2400564%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K388%20HSE_SWT%20Reboot%20for%20Fresh%20Chip%20flashing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2400564%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAs%20far%20as%20we%20can%20tell%20-%20this%20has%20solved%20the%20issue.%20I%20would%20like%20to%20see%20the%20documentation%20updated%20to%20reflect%20that%20Option%20A%2B%2B%20requires%20this%20gasket%20change%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F52613%22%20target%3D%22_blank%22%3E%40davidtosenovjan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E