SPRUIM2H May 2020 – October 2023 AM2431 , AM2432 , AM2434 , AM6411 , AM6412 , AM6421 , AM6422 , AM6441 , AM6442
The PDMA channel will remain idle until a pulse is detected on the associated input DMA request event pin. The DMA event pins are mapped from the CAN filter event bits. The event bits determine the channel and one of two CAN buffers to use for the RX operation. This allows the RX buffers on the CAN to be configured in a ping/pong fashion, preventing the loss of CAN packet data. When an event is received, the PDMA will start copying bytes out of the corresponding CAN buffer. The number of bytes copied is equal to the value of the 'Y' parameter in the channel configuration. Once all data has been copied from the buffer, the PDMA transfers ownership of the buffer back to the CAN by writing a CAN register. It then waits for another RX DMA event. The PDMA can copy multiple CAN RX buffers to the same CPPI packet. It will not close out the CPPI packet until it has copied out a number of RX buffers equal to the 'Z' parameter in the channel configuration. On subsequent RX buffer copies, the MCAN will skip the first 8 bytes of the RX buffer, which is the MCAN packet header.
The mapping of MCAN filter events to MCAN channels and buffer is important for properly configuring the DMA. The mapping is defined as shown in Table 11-636.
CAN FE2 | CAN FE1 | CAN FE0 | Description |
0 | 0 | 0 | Not used |
0 | 0 | 1 | Not used |
0 | 1 | 0 | PDMA CAN channel offset 0, RX buffer 0 |
0 | 1 | 1 | PDMA CAN channel offset 0, RX buffer 1 |
1 | 0 | 0 | PDMA CAN channel offset 1, RX buffer 2 |
1 | 0 | 1 | PDMA CAN channel offset 1, RX buffer 3 |
1 | 1 | 0 | PDMA CAN channel offset 2, RX buffer 4 |
1 | 1 | 1 | PDMA CAN channel offset 2, RX buffer 5 |
By using two filter entries in the CAN, software can setup a ping-pong buffer for a particular RX packet ID. For example, the following two filter entries will setup a ping-pong using RX buffers 0 and 1 for packet ID = 5 on CAN RX channel 0 (Table 11-637).
Filter Entry | Packet Match ID | Filter Event Bits |
0 | 5 | 0x2 |
1 | 5 | 0x3 |