Hi Matze, The number of transfers will be the DMASZ bit, transfers should be Size of Total data needing to be transferred / size of the transfer (byte, word, 2 words etc.). Your data does look strange here, it looks like you're storing only 1 bit in a whole 32-bit int, unless your data should only be 1 or 0... For the element address you should look at how the DL_MCAN_readMsgRam() function is created (located in dl_mcan.c). I'll break it down a bit but I do recommend looking at the function, essentially you'll need to follow the FIFO path and instead of the readMsg function you'll use the DMA with the elemAddr as your source address and the buffer as your destination address. The MCAN packet has a bunch of header information then the data as you see in the element structure. The DL_MCAN_readMsg function will break down all the bits and put them into the correct organization where as the DMA will only pull the data directly from the registers. So you need to structure your transfers to transfer and increment all the data in multiples of your expected packets. The increment and transfer sizes should be used to span across your whole expected data set ---- /*Start Addr intitial value is from your MCAN_RXF0C_F0SA setting ElemSize inital value is from your MCAN_RXESC_F0DS idx is from your MCAN_RXF0S_F0GI setting*/ startAddr = (uint32_t)(startAddr << 2U); elemSize = DL_MCAN_getMsgObjSize(elemSize); elemSize *= 4U; elemAddr = startAddr + (elemSize * idx); elemAddr += MCAN_MCAN_MSG_MEM; DL_MCAN_readMsg((uint32_t) mcan, elemAddr, elem);
↧