S32K358 Legacy RX Fifo with DMA vs enhanced RX Fifo DMA

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

S32K358 Legacy RX Fifo with DMA vs enhanced RX Fifo DMA

652 Views
saikiranG
Contributor I

Why doesn’t S32K3 RTD support DMA batching (major loop > 1) for Legacy Rx FIFO, while Enhanced Rx FIFO does?

I'm using S32K358 FlexCAN with Rx FIFO + DMA. In Enhanced Rx FIFO, the RTD configures DMA with minor loop = 80 bytes and allows batching via u32NumOfMbTransferByDMA (N frames), so DMA_COMPLETE fires after N frames. For Legacy Rx FIFO, so DMA_COMPLETE occurs per frame, with no batching option.

  • Is the lack of DMA batching for Legacy Rx FIFO an intentional RTD design choice or a hardware limitation of the legacy FIFO path?
  • Could RTD safely support a signed source offset and major loop > 1 for Legacy Rx FIFO to enable batching?
  • Any recommended workaround to reduce IRQ rate with Legacy FIFO + DMA?

Configuration: S32K358, RTD 6.0.0, Legacy Rx FIFO + DMA vs Enhanced Rx FIFO + DMA.

0 Kudos
Reply
3 Replies

518 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@saikiranG

Legacy FIFO is a feature retained from K1 on K3.

This legacy FIFO has a message depth of 6, so it can only receive classic CAN 2.0 messages and cannot receive CAN FD messages.

This is also mutually exclusive with the enhanced FIFO feature; if legacy FIFO is enabled, enhanced FIFO cannot be enabled.

Demo for your reference:

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-FlexCAN-Ip-TX-RX-EnhanceRXFIFO-DMA-...

 

509 Views
saikiranG
Contributor I
Got it. Is there any way I can get DMA complete interrupt after the depth of FIFO (like 5 for say) like we have in case of enhanced rxFifo? Currently, I still get DMA complete interrupt after every time DMA transfers from Fifo output when frame's available to SRAM. This case is supported in enhanced rx Fifo based on the u32NumOfMbTransferByDMA configuration.
0 Kudos
Reply

503 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@saikiranG

The legacy FIFO does not support watermark configuration (Enhanced FIFO does support watermark configuration).

For legacy FIFO,as long as there is a frame in the current FIFO, a DMA interrupt request will be generated.

"

When at least one frame available to be read from the FIFO, IFLAG1[BUF5I] (Frames available in Legacy RX FIFO) is set. A DMA request is generated simultaneously. Upon receiving the request, the DMA controller can read the message (accessing the output of the Legacy FIFO as a message buffer).

"

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2266494%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K358%20Legacy%20RX%20Fifo%20with%20DMA%20vs%20enhanced%20RX%20Fifo%20DMA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2266494%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EWhy%20doesn%E2%80%99t%20S32K3%20RTD%20support%20DMA%20batching%20(major%20loop%20%26gt%3B%201)%20for%20Legacy%20Rx%20FIFO%2C%20while%20Enhanced%20Rx%20FIFO%20does%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI'm%20using%20S32K358%20FlexCAN%20with%20Rx%20FIFO%20%2B%20DMA.%20In%20Enhanced%20Rx%20FIFO%2C%20the%20RTD%20configures%20DMA%20with%20minor%20loop%20%3D%2080%20bytes%20and%20allows%20batching%20via%20u32NumOfMbTransferByDMA%20(N%20frames)%2C%20so%20DMA_COMPLETE%20fires%20after%20N%20frames.%20For%20Legacy%20Rx%20FIFO%2C%20so%20DMA_COMPLETE%20occurs%20per%20frame%2C%20with%20no%20batching%20option.%3C%2FP%3E%3CUL%3E%3CLI%3EIs%20the%20lack%20of%20DMA%20batching%20for%20Legacy%20Rx%20FIFO%20an%20intentional%20RTD%20design%20choice%20or%20a%20hardware%20limitation%20of%20the%20legacy%20FIFO%20path%3F%3C%2FLI%3E%3CLI%3ECould%20RTD%20safely%20support%20a%20signed%20source%20offset%20and%20major%20loop%20%26gt%3B%201%20for%20Legacy%20Rx%20FIFO%20to%20enable%20batching%3F%3C%2FLI%3E%3CLI%3EAny%20recommended%20workaround%20to%20reduce%20IRQ%20rate%20with%20Legacy%20FIFO%20%2B%20DMA%3F%3C%2FLI%3E%3C%2FUL%3E%3CP%3EConfiguration%3A%20S32K358%2C%20RTD%206.0.0%2C%20Legacy%20Rx%20FIFO%20%2B%20DMA%20vs%20Enhanced%20Rx%20FIFO%20%2B%20DMA.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2267979%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Legacy%20RX%20Fifo%20with%20DMA%20vs%20enhanced%20RX%20Fifo%20DMA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2267979%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EGot%20it.%20Is%20there%20any%20way%20I%20can%20get%20DMA%20complete%20interrupt%20after%20the%20depth%20of%20FIFO%20(like%205%20for%20say)%20like%20we%20have%20in%20case%20of%20enhanced%20rxFifo%3F%20Currently%2C%20I%20still%20get%20DMA%20complete%20interrupt%20after%20every%20time%20DMA%20transfers%20from%20Fifo%20output%20when%20frame's%20available%20to%20SRAM.%20This%20case%20is%20supported%20in%20enhanced%20rx%20Fifo%20based%20on%20the%20u32NumOfMbTransferByDMA%20configuration.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2268007%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Legacy%20RX%20Fifo%20with%20DMA%20vs%20enhanced%20RX%20Fifo%20DMA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2268007%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EsaikiranG%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20legacy%20FIFO%20does%20not%20support%20watermark%20configuration%20(Enhanced%20FIFO%20does%20support%20watermark%20configuration).%3C%2FP%3E%0A%3CP%3EFor%20legacy%20FIFO%2Cas%20long%20as%20there%20is%20a%20frame%20in%20the%20current%20FIFO%2C%20a%20DMA%20interrupt%20request%20will%20be%20generated.%3C%2FP%3E%0A%3CP%3E%22%3C%2FP%3E%0A%3CP%3EWhen%20at%20least%20one%20frame%20available%20to%20be%20read%20from%20the%20FIFO%2C%20IFLAG1%5BBUF5I%5D%20(Frames%20available%20in%20Legacy%20RX%20FIFO)%20is%20set.%20A%20DMA%20request%20is%20generated%20simultaneously.%20Upon%20receiving%20the%20request%2C%20the%20DMA%20controller%20can%20read%20the%20message%20(accessing%20the%20output%20of%20the%20Legacy%20FIFO%20as%20a%20message%20buffer).%3C%2FP%3E%0A%3CP%3E%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2267968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K358%20Legacy%20RX%20Fifo%20with%20DMA%20vs%20enhanced%20RX%20Fifo%20DMA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2267968%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3EsaikiranG%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ELegacy%20FIFO%20is%20a%20feature%20retained%20from%20K1%20on%20K3.%3C%2FP%3E%0A%3CP%3EThis%20legacy%20FIFO%20has%20a%20message%20depth%20of%206%2C%20so%20it%20can%20only%20receive%20classic%20CAN%202.0%20messages%20and%20cannot%20receive%20CAN%20FD%20messages.%3C%2FP%3E%0A%3CP%3EThis%20is%20also%20mutually%20exclusive%20with%20the%20enhanced%20FIFO%20feature%3B%20if%20legacy%20FIFO%20is%20enabled%2C%20enhanced%20FIFO%20cannot%20be%20enabled.%3C%2FP%3E%0A%3CP%3EDemo%20for%20your%20reference%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K344-FlexCAN-Ip-TX-RX-EnhanceRXFIFO-DMA-test-S32DS3-5%2Fta-p%2F2015832%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FExample-S32K344-FlexCAN-Ip-TX-RX-EnhanceRXFIFO-DMA-test-S32DS3-5%2Fta-p%2F2015832%3C%2FA%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E