Help needed, issue with LIN host transmission

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

Help needed, issue with LIN host transmission

225 Views
杨工
Contributor I

Help: When using the LIN function on S32K314 configured as master mode, only the frame header is sent. If the slave does not respond, the master cannot send the frame header again. The configuration is as follows:

_0-1787127326823.png_0-1787127326823.png

 

0 Kudos
Reply
1 Reply

194 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @杨工,

Based on the screenshot you posted, LIN_FRAMERESPONSE_RX indicates that the master node will receive the response part of a LIN frame. When configured as a subscriber for a specific frame ID, the node sends the Break + Sync + PID header and then listens for the Data + Checksum from the slave.

If the slave does not send anything, the master will not terminate the frame on its own. Any subsequent call to Lpuart_Lin_Ip_SendFrame() will return STATUS_BUSY. The application is responsible for terminating the transfer.

The RTD LIN driver provides a Lin Frame Timeout feature for exactly this situation. If you enable it in the configuration tool and implement the timer notifications (LinLpuartStartTimerNotification / LinLpuartStopTimerNotification), calling Lpuart_Lin_Ip_TimerExpiredService() on timeout expiry will return the driver state to IDLE.

As a quick diagnostic, you can call Lpuart_Lin_Ip_TimerExpiredService() or even Lpuart_Lin_Ip_GoToIdleState() directly from the application whenever Lpuart_Lin_Ip_SendFrame() returns STATUS_BUSY, to confirm this is the root cause before wiring up the full timer mechanism.

 

Regards,

Daniel

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2406473%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHelp%20needed%2C%20issue%20with%20LIN%20host%20transmission%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406473%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHelp%3A%20When%20using%20the%20LIN%20function%20on%20S32K314%20configured%20as%20master%20mode%2C%20only%20the%20frame%20header%20is%20sent.%20If%20the%20slave%20does%20not%20respond%2C%20the%20master%20cannot%20send%20the%20frame%20header%20again.%20The%20configuration%20is%20as%20follows%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22_0-1787127326823.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22_0-1787127326823.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F394927i2E563E631231F3E0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22_0-1787127326823.png%22%20alt%3D%22_0-1787127326823.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E_0-1787127326823.png%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E_0-1787127326823.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2406618%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Help%20needed%2C%20issue%20with%20LIN%20host%20transmission%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2406618%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F265734%22%20target%3D%22_blank%22%3E%40%E6%9D%A8%E5%B7%A5%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EBased%20on%20the%20screenshot%20you%20posted%2C%20LIN_FRAMERESPONSE_RX%20indicates%20that%20the%20master%20node%20will%20receive%20the%20response%20part%20of%20a%20LIN%20frame.%20When%20configured%20as%20a%20subscriber%20for%20a%20specific%20frame%20ID%2C%20the%20node%20sends%20the%20Break%20%2B%20Sync%20%2B%20PID%20header%20and%20then%20listens%20for%20the%20Data%20%2B%20Checksum%20from%20the%20slave.%3C%2FP%3E%0A%3CP%3EIf%20the%20slave%20does%20not%20send%20anything%2C%20the%20master%20will%20not%20terminate%20the%20frame%20on%20its%20own.%20Any%20subsequent%20call%20to%20Lpuart_Lin_Ip_SendFrame()%20will%20return%20STATUS_BUSY.%20The%20application%20is%20responsible%20for%20terminating%20the%20transfer.%3C%2FP%3E%0A%3CP%3EThe%20RTD%20LIN%20driver%20provides%20a%20Lin%20Frame%20Timeout%20feature%20for%20exactly%20this%20situation.%20If%20you%20enable%20it%20in%20the%20configuration%20tool%20and%20implement%20the%20timer%20notifications%20(LinLpuartStartTimerNotification%20%2F%20LinLpuartStopTimerNotification)%2C%20calling%20Lpuart_Lin_Ip_TimerExpiredService()%20on%20timeout%20expiry%20will%20return%20the%20driver%20state%20to%20IDLE.%3C%2FP%3E%0A%3CP%3EAs%20a%20quick%20diagnostic%2C%20you%20can%20call%20Lpuart_Lin_Ip_TimerExpiredService()%20or%20even%20Lpuart_Lin_Ip_GoToIdleState()%20directly%20from%20the%20application%20whenever%20Lpuart_Lin_Ip_SendFrame()%20returns%20STATUS_BUSY%2C%20to%20confirm%20this%20is%20the%20root%20cause%20before%20wiring%20up%20the%20full%20timer%20mechanism.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%3C%2FLINGO-BODY%3E