2135881_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2135881_en-US

2135881_en-US

S32K LIN Stack wakeup

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

LIN_STACKRe: S32K LIN Stack wakeup

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

Re: S32K LIN Stack wakeup

Hi @danielmartynek ,


Following two configuration need to be made:

 

lyxye_2-1753080587789.png


And 

lyxye_3-1753080616959.png


Are they both enabled in your project?


BR

Liviu


 

Re: S32K LIN Stack wakeup

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




Re: S32K LIN Stack wakeup

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

Tags (1)
No ratings
Version history
Last update:
‎11-20-2025 04:56 PM
Updated by: