Using S32 SDK v3.0.0 RTM and S32 Design Studio for ARM v2.2.
By following the example project created from within the Design Studio, 'power_mode_switch_s32k146', in our own firmware project, the following sequence of API calls are used:
POWER_SYS_Init(...);
...
POWER_SYS_SetMode(RUN, POWER_MANAGER_POLICY_AGREEMENT);
...
POWER_SYS_SetMode(VLPR, POWER_MANAGER_POLICY_AGREEMENT);
The observation was: When the PEMicro debugger is used on our target board, to run our firmware with the Design Studio, the RUN<->VLPR power mode transitions work without problems, and the target board will alternate between the two power modes successfully per different amounts of current consumption in each mode, as measured by a O-scope. However, when the same firmware image has been programmed into the target board's Flash, then PEMicro debugger disconnected from the Jtag port and board power-cycled, the board appears to go from RUN to VLPR for the first time and then will be staying/stuck in the VLPR mode, and cannot come out of it (again, per the current consumption measured).
Any thoughts/suggestion would be great to have. Thanks!
Solved! Go to Solution.
Thank you, Senlent, this issue was resolved. The issue came from function calls that will actually "stall" the code execution, when the NXP DS IDE/PEMicro debugger is not used.
Thanks again!
Thank you, Senlent, this issue was resolved. The issue came from function calls that will actually "stall" the code execution, when the NXP DS IDE/PEMicro debugger is not used.
Thanks again!
Hi Senlent,
Thank you for the reply. In fact, I have just resolved the issue myself. It was due to function calls in code that can stall if not using the debugger.
So, to confirm: The SDK API call (available via the Power Manager component), POWER_SYS_SetMode(...), is indeed what we should use to enter/exit any of the S32K146 low power modes (VLPR/VLPS/STOP1/STOP2)?
Please advise. Thank you.
yes, the function "POWER_SYS_SetMode" also will be reinitialize the clock setting based on the current power mode you selected.
Additional note: As an experiment, I leave the PEMicro Jtag debugger (powered up via USB) connected to our target board, and let the same firmware run from Flash. Still, once entering the VLPR mode from RUN mode for the first time, the target board continues to stay in the VLPR mode and "stuck" there, per the board's current consumption as measured by the O-scope.