Hello team,
I was wondering if you have an S32K1 or S32K3 LIN Stack Slave project that supports receiving a MasterReq frame with a Go-to-Sleep command and can subsequently wake up on a wakeup signal.
Thank you
Hi @lyxye,
Yes, this is all enabled.
The project seems to work correctly, I put it on the community:
https://community.nxp.com/t5/S32K-Knowledge-Base/S32K144-LIN-Go-to-Sleep/ta-p/2136890
Regards,
Daniel
Hi @danielmartynek ,
Following two configuration need to be made:
And
Are they both enabled in your project?
BR
Liviu
Hi @lyxye,
Thanks fort the prompt response.
I have been testing it with the default Lin_Slave_S32K144_Example_DS
When I send 0x3C MasterRec with the Go-to-Sleep command 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF, the stack detects it automatically and before the app reads the l_flg_tst_LI0_MasterReq_flag(), lin_dal_set_low_power_mode() has already been called in lin_update_rx() and the Slave is in the sleep mode.
To wakeup, I had to enable Lin Lpuart Wake Up Timer Notification. and the function this has to be implemented by the user.
This works for me:
extern void LinWakeUpTimerNotification(uint8 Instance, uint32 *WakeupSignalLength){
/*
* signal_length > LPUART_LIN_IP_WAKEUP_TIME_MIN_IN_NS (150000U)
* signal_length < LPUART_LIN_IP_WAKEUP_TIME_MAX_IN_NS (5000000U)
*
* One Gpt tick = 125ns
*/
if(Instance == (uint8)0x2U)
{
if(falling_edge)
{
wakeup_signal_falling = Gpt_GetTimeElapsed(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
falling_edge = 0U;
}
else
{
wakeup_signal_rising = Gpt_GetTimeElapsed(GptConf_GptChannelConfiguration_GptChannelConfiguration_0);
if(wakeup_signal_falling < wakeup_signal_rising)
{
wakeup_signal_falling_length = (wakeup_signal_rising - wakeup_signal_falling);
wakeup_signal_falling_length = (125 * wakeup_signal_falling_length);
*WakeupSignalLength = wakeup_signal_falling_length;
}
else
{
wakeup_signal_falling_length = ((0xFFFFFFFF - wakeup_signal_falling) + wakeup_signal_rising);
wakeup_signal_falling_length = (125 * wakeup_signal_falling_length);
*WakeupSignalLength = wakeup_signal_falling_length;
}
falling_edge = 1;
}
}
}I think this is all I need.
Or there anything I'm missing?
Thank you,
Regards,
Daniel
Hi @danielmartynek ,
There is no project example with this configuration but this is supported by the LIN stack.
What is the reason behind this project configuration?
BR
Liviu