Hello,
I am encountering a hard fault when using the predefined structure Power_Ip_aModeConfigPB[1] (declared in Power_Ip_PBcfg.c) to enter standby mode with the Power_Ip_SetMode() function. However, when I copy the structure and assign it a different name, Power_Ip_aModeConfigPB_1[0], it works as expected.
I am using the S32K324 controller for this setup.
Screenshots of the original structure
Screenshots of the modified structure
Screenshots of the function call
Could anyone help me understand why this is happening and how I can resolve this issue?
Thank you in advance!
Thanks Danielmartynek,
The issue was caused by the use of #pragma pack (1), and the problem occurred because I wasn't using the unpack directive in the other folder. The hard fault issue is solved
I am trying to use the 'Prepare for Standby' mode just before entering standby, but I have observed that there is little to no difference in current consumption, whether I use it or not. Could you please help me understand why?
Hi @Prasad_330,
Have a look at the source code (Power_Ip.c) to see how the modes are called and what they do.
Regards,
Daniel
Thanks danielmartynek,
I am trying to watch the content of the predefined structure Power_Ip_aModeConfigPB[1] in the watch window.
The values displayed are not as expected:
ModeConfigId is defined as 1.
PowerMode is defined as POWER_IP_STANDBY_MODE (16).
However, in the watch window, the values are different:
ModeConfigId shows a value of 16795441.
PowerMode shows 268435456.
For a user-defined structure, the values match what is defined.
I have attached a screenshot for reference.
Which RTD revision is it?
Can you share the .mex file?
Thank you
We are currently using the RTD version S32K3_RTD_3_0_0_P07_D2306_ASR_REL_4_7_REV_0000_20230629. Please find the attached .mex file for your reference.
Hello @Prasad_330,
I don't see any .mex file attached.
Also, please confirm the compiler options are set correctly, and provide more information about the fault exception.
Thanks,
BR, Daniel
yes i have missed the attachment
I am sharing the .mex file
Please find the attachment
Hi @Prasad_330,
Thanks for the .mex.
I see you disable CM7_0 clock, which is not correct.
Refer to this thread:
https://community.nxp.com/t5/S32K/S32K344-StangBy-Configuration-Options/m-p/2005542
Regards,
Daniel
Hi @Prasad_330,
I don't see any reason for a fault exception in the description you shared, just to be sure, please check all the compiler options in the project - it must be set precisely as per to RTD release notes.
Can you share the configuration of the power mode?
Can you step through the function and locate the fault instruction?
In general, follow these documents to debug the fault exception:
https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447
Best regards,
Daniel