S32K3_LIN_DMA Mode_BUG

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

S32K3_LIN_DMA Mode_BUG

Jump to solution
936 Views
wuxianlong
Senior Contributor I

Hi,NXP

Phenomenon: When the LIN data segment is 8 bytes, checksum failure occurs in LIN's DMA mode.
Cause: There may be a BUG in NXP's design. When designing the data reception buffer Lpuart_Lin_Ip_au8SduBuffer, only the data segment was considered. However, in fact, the underlying code's DMA reception needs to receive both the data segment and the checksum segment, and use Lpuart_Lin_Ip_au8SduBuffer for checksum. Since Lpuart_Lin_Ip_au8SduBuffer is designed as an 8-byte array, when the LIN data field has 8 bytes of data, the ninth byte (checksum segment) cannot be received, and the data checksum will fail.
This bug still exists in RTD6.0.0 and RTD7.0.0.
Incidentally, currently there is only RX mode for LIN's DMA. Are there any plans for TX mode?
image.png

Solution. Modify the size of Lpuart_Lin_Ip_au8SduBuffer, that is, change the underlying macro definition LPUART_LIN_IP_MAX_DATA_LENGTH_U8 from 8 to 9.

Best Regards,
xianlong

0 Kudos
Reply
1 Solution
735 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @wuxianlong,

Thank you for bringing this to our attention.
This issue has been confirmed as a bug and will be fixed in a future release.

 

BR, Daniel

View solution in original post

0 Kudos
Reply
5 Replies
736 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @wuxianlong,

Thank you for bringing this to our attention.
This issue has been confirmed as a bug and will be fixed in a future release.

 

BR, Daniel

0 Kudos
Reply
675 Views
wuxianlong
Senior Contributor I
Are there any plans for TX mode?
0 Kudos
Reply
516 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @wuxianlong,

I received feedback from the SW team. The driver would need to verify each byte after transmission, which DMA cannot handle. Therefore, only interrupt mode is supported for TX.

 

Regards,

Daniel

 

0 Kudos
Reply
474 Views
wuxianlong
Senior Contributor I

Hi,@danielmartynek 

Thank you for your reply. I studied his implementation logic. He separates the frame header and data of the LIN received message. The frame header is received using interrupts, and the data is processed and received in UART's DMA mode; similarly, it should also be no problem to use UART's DMA for data transmission.
Since high-frequency LIN interrupt processing may affect OS scheduling, it seems that for now we can only implement the LIN TX DMA mode ourselves.

image.png
Best Regards,
xianlong

0 Kudos
Reply
371 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @wuxianlong,

I have nothing to add here. 

The RTD team has confirmed that there is no plan to add the functionality anyways.

 

Regards,

Daniel

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2355783%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K3_LIN_DMA%20Mode_BUG%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355783%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2CNXP%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3EPhenomenon%3A%20When%20the%20LIN%20data%20segment%20is%208%20bytes%2C%20checksum%20failure%20occurs%20in%20LIN's%20DMA%20mode.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3ECause%3A%20There%20may%20be%20a%20BUG%20in%20NXP's%20design.%20When%20designing%20the%20data%20reception%20buffer%20Lpuart_Lin_Ip_au8SduBuffer%2C%20only%20the%20data%20segment%20was%20considered.%20However%2C%20in%20fact%2C%20the%20underlying%20code's%20DMA%20reception%20needs%20to%20receive%20both%20the%20data%20segment%20and%20the%20checksum%20segment%2C%20and%20use%20Lpuart_Lin_Ip_au8SduBuffer%20for%20checksum.%20Since%20Lpuart_Lin_Ip_au8SduBuffer%20is%20designed%20as%20an%208-byte%20array%2C%20when%20the%20LIN%20data%20field%20has%208%20bytes%20of%20data%2C%20the%20ninth%20byte%20(checksum%20segment)%20cannot%20be%20received%2C%20and%20the%20data%20checksum%20will%20fail.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EThis%20bug%20still%20exists%20in%20RTD6.0.0%20and%20RTD7.0.0.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EIncidentally%2C%20currently%20there%20is%20only%20RX%20mode%20for%20LIN's%20DMA.%20Are%20there%20any%20plans%20for%20TX%20mode%3F%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20958px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20958px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20958px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20958px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20958px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20958px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20958px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383477i225A5CF2B3EB955B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3ESolution.%20Modify%20the%20size%20of%20Lpuart_Lin_Ip_au8SduBuffer%2C%20that%20is%2C%20change%20the%20underlying%20macro%20definition%20LPUART_LIN_IP_MAX_DATA_LENGTH_U8%20from%208%20to%209.%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3Exianlong%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2360066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3_LIN_DMA%20Mode_BUG%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2360066%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F191389%22%20target%3D%22_blank%22%3E%40wuxianlong%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20bringing%20this%20to%20our%20attention.%3CBR%20%2F%3EThis%20issue%20has%20been%20confirmed%20as%20a%20bug%20and%20will%20be%20fixed%20in%20a%20future%20release.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20Daniel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2360741%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3_LIN_DMA%20Mode_BUG%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2360741%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAre%20there%20any%20plans%20for%20TX%20mode%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2362365%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3_LIN_DMA%20Mode_BUG%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2362365%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F160001%22%20target%3D%22_blank%22%3E%40danielmartynek%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20for%20your%20reply.%20I%20studied%20his%20implementation%20logic.%20He%20separates%20the%20frame%20header%20and%20data%20of%20the%20LIN%20received%20message.%20The%20frame%20header%20is%20received%20using%20interrupts%2C%20and%20the%20data%20is%20processed%20and%20received%20in%20UART's%20DMA%20mode%3B%20similarly%2C%20it%20should%20also%20be%20no%20problem%20to%20use%20UART's%20DMA%20for%20data%20transmission.%3CBR%20%2F%3ESince%20high-frequency%20LIN%20interrupt%20processing%20may%20affect%20OS%20scheduling%2C%20it%20seems%20that%20for%20now%20we%20can%20only%20implement%20the%20LIN%20TX%20DMA%20mode%20ourselves.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F384771iBFFDE5525D4710F3%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3Exianlong%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2361803%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3_LIN_DMA%20Mode_BUG%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2361803%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F191389%22%20target%3D%22_blank%22%3E%40wuxianlong%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI%20received%20feedback%20from%20the%20SW%20team.%20The%20driver%20would%20need%20to%20verify%20each%20byte%20after%20transmission%2C%20which%20DMA%20cannot%20handle.%20Therefore%2C%20only%20interrupt%20mode%20is%20supported%20for%20TX.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2363794%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K3_LIN_DMA%20Mode_BUG%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2363794%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F191389%22%20target%3D%22_blank%22%3E%40wuxianlong%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI%20have%20nothing%20to%20add%20here.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20RTD%20team%20has%20confirmed%20that%20there%20is%20no%20plan%20to%20add%20the%20functionality%20anyways.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E