SW32K3_RTD_4_4_2_0_0_D2203
S32K3X4EVB-Q257
Lauterbach T32 N.2022.03
My main objective is to perform a transition from application context to bootloader context. Doing so, I need to detect that the reset is not POR since I need to retain some RAM from appl context.
To accomplish this, I am trying to detect a functional reset at startup but am only getting MCU_POWER_ON_RESET using Mcu_GetResetReason. Don't understand why.
Added the following snippet of code to the S32DS Mcu Example for S32K344:
Mcu_DistributePllClock();
Mcu_SetMode(McuModeSettingConf_0);
mr = Mcu_GetResetReason();
if (mr != MCU_POWER_ON_RESET)while(1){}
Mcu_PerformReset();
if (Mcu_GetClockFrequency(FXOSC_CLK) != FXOSC_CLOCK_FREQ)
{
Exit_Example(FALSE);
}
else
{
Exit_Example(TRUE);
}
Expected result was that the PerformReset() function triggers a functional reset and that the Mcu_GetResetReason indicates this, causing the while(1) loop to NOT generate a new reset. However, what I see on the EVB is that the reset continually triggers, indicating the the while(1) loop is not executed (I expected this to be visible by not seeing more than one reset on the reset LED).
Also tried setting the destructive reset escalation setting in Mcu config to zero. No difference.
Furthermore, I cannot follow the reset using my Lauterbach debugger. Maybe there is a setting that allows me to do that, but I have not yet managed to find such a setting. I basically want the debugger to remain attached to the core while the reset takes place so that I can break execution after the reset. As of now, it just says that the cores are down, running(power down) and reset.