S32K358 FAST STANDBY Hello, I would like to test Fast Standby on the S32K358. I created an IP-layer demo in S32DS where the program enters Fast Standby 5 seconds after startup and is woken up by RTC-API after 3 seconds. This works without any issues. Then I referred to this project and configured an EB project to create an MCAL-layer demo, but it failed. After 3 seconds in Fast Standby, the current increased, which suggests the device woke up, but it never entered the main function. After attaching with PE Micro, the error messages are as follows: Interrupt command received. Halting execution. UsageFault: An instruction executed with an invalid EPSR.T or EPSR.IT field. BusFault: An imprecise (asynchronous) data access error has occurred. HardFault: A fault has been escalated to a hard fault. The vector table after wake-up is shown below: 1.png The PC register is 0x0. Checking the stack contents, I can see that FastWkup_EntryAddress was entered, and the HardFault occurs after jumping to the Reset_Handler. 2.png 3.png 4.png If I add a while(1) loop in FastWkup_EntryAddress, the HardFault still occurs. 5.png If I enter standby mode, it word. In the project, PMIC_PGOOD_HNDSHK_BYP is enabled. Since the board does not have an external crystal oscillator, FIRC is used as the core clock. S32K358 RTD6.0.0 S32DS3.6.3 EB29.0 BR, Jason Re: S32K358 FAST STANDBY Hello @Jason07,
On Fast Standby wakeup, the sBAF sets VTOR to your custom vector table address. However, your vector table only defines three entries:
Initial SP,
Reset Handler (FastWkup_EntryAddress),
NMI Handler.
So the HardFault vector is missing. When any fault occurs, the CPU fetches the not defined HardFault handler address, which could explain the observed PC value.
To debug this further, please add a proper HardFault handler to the vector table. Once those are in place, the handler will be invoked instead of crashing to 0x0, giving you access to the stacked PC, LR, and the Configurable Fault Status Register (CFSR/BFAR) of the original fault.
Thank you,
BR, Daniel Re: S32K358 FAST STANDBY Hi @danielmartynek I'm sorry for the late reply. I followed your suggestion and added `NMI_Handler` and `HardFault_Handler`. After re-debugging, I found that after wake up the code enters `NMI_Handler`. Checking the FCCU `NCF_S0` register, it shows ECC errors. Also, the `PRAM1_ECC_ERR` bit in the `DCMROD3` register is set. The error occurs after jumping to `Reset_Handler`. Imprecise data bus error. BR, Jason Re: S32K358 FAST STANDBY Hi @Jason07,
What do you see in the ERM register?
Can you show the stack frame in the memory view, and check the stacked PC address in the disassembly?
Thank you Re: S32K358 FAST STANDBY Hi @danielmartynek The ERM registers are as follows. EAR17, EAR18, and EAR19 of ERM0 are 0x30003. I don't know what address this is. The PC and SP values are as follows. After wake-up, the initial stack address is 0x20480000. The stack appears to contain two addresses: 0x402448 and 0x4032a5. The corresponding disassembly code is as follows. After wake up, it enters the `FastWkup_EntryAddress` function, then jumps to `Reset_Handler`. Only a few lines of code have been run, it jumps to `NMI_Handler`. BR, Jason Re: S32K358 FAST STANDBY Hi Jason,
Interestingly, the ERM registers do not provide any indication of an uncorrectable fault. No uncorrectable error is reported by the ERM.
The fault occurs before the jump in the fast wake-up routine. Although the stacked PC points to address 0x4032A4, the fault is imprecise, meaning the exception stacking occurs later. Therefore, the root cause occurred earlier in the execution flow. Does the routine access any data located in SRAM_1?
In any case, I suspect there may be an issue with the placement of the fast wake-up routine and the vector table. They should be located in Standby SRAM, which is in SRAM_0.
Please refer to the attached presentation for more details.
Regards,
Daniel
View full article