Hello,
We are using a S32K board as a LIN master and are having some trouble with the go_to_sleep and wake-up messages. Firstly, when the go to sleep command is issued ( we are using l_ifc_goto_sleep() function from provided SDK), the master LIN node doesn't actually go into LIN_NODE_STATE_SLEEP_MODE as it should. The lin_update_tx service does get triggered, but puts the node directly into IDLE state, instead of sleep. For the sake of testing, I have manually called the set low power mode function; when a slave issues a wake-up call, the interrupt gets triggered on the master, but the node remains in SLEEP state. It seems that while the LIN_LPUART_DRV_CheckWakeupSignal() function is reached, because when the LIN master is in sleep state/low power the polarity of the receive data is false, the actual check if the received signal is a wake-up does not get performed. The LIN slaves in this configuration are from the S12 MagniV microcontrollers family.
Kind regards,
Veronica
Hello Veronica,
I have contacted our LinStack experts and it is an issue in LinDriver.
Please add this code:
if (linCurrentState->currentNodeState != LIN_NODE_STATE_SLEEP_MODE)
{
(void)LIN_LPUART_DRV_GotoIdleState(instance);
}
In the line 1944 of file lin_lpuart_driver.c (please see attached file for more information, we have updated this file)
Because of missing these line, the master node will not go to SLEEP_MODE right after sending sleep command but it still goto sleep after(4-10s).
Regarding a wake-up signal. After the master goes to SLEEP_MODE, the master node can receive the wake-up signal normally. We do not see any error here.
I hope it helps.
Best Regards,
Diana
Hello Diana!
Thank you for your answer! I will try the suggested fix and post here if I see anymore problems.
Kind regards,
Veronica