Wakeup Source Recognition after function reset from standby mode in MCAL - S32K3 RTD Customer Company*: HERO MOTOCORP - NORMALIZED Project Name*: N/A Customer Contact Point* (Name & Email): Aryan Kumar
[email protected] SW Package Info*: S32K3_S32M27x Real-Time Drivers ASR R21-11 HW* (Board/Chipset/Platform): S32K3XX (S32K344) SW Version*: Version 6.0.0
Hello team,
I have a customer trying to know wakeup source after standby exit in MCAL. I have seen this other post talking about the process and which APIs to use. Basically, Dan mentioned (in this post: Solved: Question about the WISR with S32K3 MCAL RTD5.0.0 - NXP Community) that Icu_Init() will clear flags if called before Platform_Init(), meaning checking wake-up source with callback looks like a limitation of the RTDs.
Also, Icu_GetInputState() uses global variables that needs to be initialized by Icu_Init(). Meaning that customer can only call Wkpu_Ip_GetInputState() function to check the WISR flags.
So, if I understand correctly, there are 3 ways to read wake-up source:
1. Enabling Platform after standby exit, and MCU will jump to WKPU_IRQn and service the WKPU channel. If callback is needed, customer can implement workaround by assigning Wkpu structure:
Wkpu_Ip_u32ChState[0].chInit = TRUE;
Wkpu_Ip_u32ChState[0].notificationEnable = TRUE;
Wkpu_Ip_u32ChState[0].WkpuChannelNotification = IcuSignalNotification_Wkpu;
This works as expected.
2. Calling Wkpu_Ip_GetInputState() after standby exit, as Icu_GetInputState() cannot be called before Icu_Init(), but Icu initialization clears WISR flags. However, when entering the function, if both WISR & IREER bits are enabled for the requested channel, WISR is not cleared:
If I understand correctly, these are cleared upon calling Icu_Init(), correct?
3. Directly reading WISR/WISR_64 registers.
These three methods use either baremetal or IP layer. I have two questions:
How to correctly implement Wkpu_Ip_GetInputState()?
Is there a fix or implementation for MCAL layer, in either 6.0.0 or 7.0.0? If so, can you share the implementation?
I've attached the project I used to test this, WKPU[42] is configured. SW is S32DS v3.6.4 + RTD 6.0.0.
Best regards, Julián Priority: MEDIUM S32_CONFIG_TOOL S32_FLASH_TOOL S32DS Source: Direct Customer Re: Wakeup Source Recognition after function reset from standby mode in MCAL - S32K3 RTD Hi @DanNguyenDuy,
Thank you for the quick response, Dan! I will inform customer.
Best regards, Julián Re: Wakeup Source Recognition after function reset from standby mode in MCAL - S32K3 RTD Hi @Julián_AragónM,
1. Follow AUTOSAR requirements, the Icu module doesn't provide functions that can check wakeup source directly at the MCAL layer. Icu will transfer wakeup source information to EcuM module and this module will check wakeup source. In RTD driver, EcuM is a stub module.
Follow " Specification of ECU State Manager AUTOSAR CP R21-11":
2. In Icu configuration, when user enable "IcuWkpuStandbyWakeSupport" then Icu_Init() will not clear WISR flags.
In your project, to check wakeup source in the Wkpu_Ip layer, you can refer to the below code:
When call Platform_Init(NULL_PTR); before Icu_Init(), I saw that somehow the WISR flags were erased. So, I called this function after Icu_Init() function.
Best regards,
Dan