Hi All,
I have a use case where I continuously get data via CAN every 20 milliseconds, and I have to send the data as is via UART. For CAN reception, I did not want the CPU to be checking and reinitializing DMA every 20 milliseconds post completion.
My idea was to set the source of the DMA MUX channel to the CAN FIFO, and use a ping pong buffer to continuously save data in memory. However, the CAN RX EDMA drivers callback aborts DMA transfer everytime the ISR is triggered. Second approach that I tired was to add a periodic timer and enable trigger mode for channel 0 (one I am using for CAN), and every 20 milliseconds when the timer elapses, a DMA request will be generated and if there is a peripheral request from CAN too, data will move from the CAN FIFO to the memory. I tired this approach as well and this ended up into me getting bus errors.
Is there a better way of doing this or an example code for the same? Thank you!