Hello NXP Team,
I am working with an S32K312 Cortex-M7 using S32 Design Studio and AUTOSAR RTD 7.0.1 / AUTOSAR 4.9.
I am currently testing the MC_RGM reset behavior, particularly SWT0 functional reset, functional reset escalation, destructive reset, SRAM retention, SBAF/recovery behavior, and the Power IP reset APIs.
1. SWT0 functional reset escalation
I am using SWT0 timeout to generate functional resets.
My MC_RGM configuration is:
MC_RGM_FRET_FRET((uint32)15U),
MC_RGM_DRET_DRET((uint32)0U)
I observe the functional reset counter increasing:
SWT0 functional reset #1 -> FREC = 1
SWT0 functional reset #2 -> FREC = 2
...
SWT0 functional reset #14 -> FREC = 14
After the next SWT0 reset, FREC is cleared/reset, but I do not observe the expected:
DES[MC_RGM_FRE] = 1
My questions are:
- Does SWT0_RST participate in the MC_RGM functional reset escalation counter (FREC) on S32K312?
- When FREC reaches FRET = 15, should MC_RGM_FRE be generated and should DES[MC_RGM_FRE] be set?
- What exact values should I expect for FES, DES, FREC, FRET, Power_Ip_GetResetReason() immediately after the escalation?
- Is any additional configuration required for SWT0 to participate in FRET escalation?
- Can SBAF/recovery handling interfere with FRET escalation?
- Is there any known erratum or known S32K312 behavior related to SWT0/FRET escalation?
- When I run the application continuously, after the 15th functional reset the application/debugger stops instead of allowing me to observe the expected destructive reset. I would like to know whether this is related to the reset sequence, SBAF recovery, or the debugger.
2. I want every SWT0 functional reset to become destructive
For testing purposes, I would also like to achieve:
SWT0 timeout
↓
Functional reset
↓
Immediate destructive reset
instead of waiting for 15 functional resets.
Can this be achieved by configuring:
FRET = 1U;
Specifically:
- Does FRET = 1 cause the first qualifying SWT0 functional reset to escalate to a destructive reset?
- Is any additional MC_RGM configuration required?
- Is SWT0 guaranteed to be a qualifying source for this escalation?
- Can SBAF/recovery behavior affect this?
- Is this supported directly through RTD 7.0.1 configuration?
3. SRAM data is cleared after every functional reset
According to my understanding of the S32K3xx Reference Manual, SRAM/system memory should be preserved across a functional reset.
I created an SRAM test variable:
#define SRAM_TEST_ADDR ((volatile uint32_t *)0x204007d4U)
and use it to verify retention across functional resets.
However, I observe that the SRAM data is being cleared/re-written to zero after a functional reset.
My questions are:
- Is SRAM preserved by the hardware during functional reset but overwritten afterward by software?
- Which SRAM regions are guaranteed to retain their contents across functional reset on S32K312?
- What is the recommended way to place a variable in SRAM so that its contents are retained across functional reset?
- Should I use a dedicated .noinit or retained SRAM section?
- Is there any specific MC_RGM/SRAM configuration required for retention?
- What is the recommended RTD 7.0.1 method for retaining application data across functional reset?
4. Direct software destructive reset
I am also testing a direct software destructive reset using the Power IP:
Power_Ip_Init(&Power_Ip_HwIPsConfigPB);
gVar= Power_Ip_GetResetReason();
for (count = 0; count < 10125000; count++);
Power_Ip_PerformReset(&Power_Ip_HwIPsConfigPB);
My current MC_RGM configuration contains:
static const Power_Ip_MC_RGM_ConfigType Power_Ip_MC_RGM_ConfigPB =
{
(MCU_DEST_RESET),
...
MC_RGM_FRET_FRET((uint32)15U),
MC_RGM_DRET_DRET((uint32)0U)
};
The destructive reset occurs, but the debugger repeatedly loses and re-establishes communication.
I see messages such as:
INFO: DAP IDCODE = 0x6BA02477
INFO: DAP successfully powered up. DP CTRL/STAT = 0xF0000000
repeated multiple times, followed by:
Interrupt command received. Halting execution.
I would like to understand:
- Is repeated DAP reconnection expected during a destructive reset?
- What exactly happens to the Cortex-M7 during the destructive-reset sequence?
- When does the CPU become available again after the destructive reset?
- What is the recommended way to debug a single software destructive reset?
5. Breakpoint behavior before Power_Ip_PerformReset()
I cannot reliably hit a breakpoint immediately before:
Power_Ip_PerformReset(&Power_Ip_HwIPsConfigPB);
I added a delay before the API, expecting the debugger to have enough time to gain access.
Sometimes the breakpoint is only reached after I manually pause the target and then resume execution.
I would like to understand:
- Why can the debugger miss the breakpoint even though there is a delay before the reset API?
- Is this related to the target repeatedly resetting and the debugger reconnecting through DAP?
- Is there a recommended method for catching the CPU immediately before or immediately after a destructive reset?
- Is the RTD DISABLE_DEBUGGER_TRAP option relevant to this behavior?
6. Power IP initialization and Power_Ip_SetMode()
My RTD provides:
void Power_Ip_Init(
const Power_Ip_HwIPsConfigType *HwIPsConfigPtr);
void Power_Ip_SetMode(const Power_Ip_ModeConfigType *ModeConfigPtr);
void Power_Ip_PerformReset(
const Power_Ip_HwIPsConfigType *HwIPsConfigPtr
);
Power_Ip_ResetType Power_Ip_GetResetReason(void);
Power_Ip_RawResetType Power_Ip_GetResetRawValue(void);
I currently use:
Power_Ip_Init(&Power_Ip_HwIPsConfigPB);
and:
gVar = Power_Ip_GetResetReason();
My mode configuration is POWER_IP_RUN_MODE.
I would like clarification on:
- Is Power_Ip_Init(&Power_Ip_HwIPsConfigPB) the correct initialization before using the Power IP reset APIs?
- Is Power_Ip_SetMode() required for software functional/destructive reset testing?
- Since my selected mode is POWER_IP_RUN_MODE, can Power_Ip_SetMode() be omitted for this reset test?
- How should I configure separate software functional-reset and software destructive-reset configurations using RTD 7.0.1?
Environment
MCU: S32K312
Core: Cortex-M7
S32DS: S32 Design Studio
AUTOSAR: 4.9
RTD: 7.0.1
Reset source: SWT0
FRET: 15
DRET: 0
I can provide the complete test application, Power_Ip_PBcfg.c, linker configuration, MC_RGM register captures, and debugger logs if required.
Thank you.