Other Parts Discussed in Thread: SYSCONFIG
请问我想要使用DMA资源来访问外设数据,我应该如何配置并使用呢?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
DMA错误通常是传入了不正确的指针或者堆栈溢出
另外注意Data buffers要和 data frame size对齐
SPI data frames can be any size from 4-bits to 32-bits. The SPI data frame size is set in SPI_Params.dataSize passed to SPI_open. The SPICC32XXDMA driver implementation makes assumptions on the element size of the SPI_Transaction txBuf and rxBuf arrays, based on the data frame size. If the data frame size is less than or equal to 8 bits, txBuf and rxBuf are assumed to be arrays of 8-bit uint8_t elements. If the data frame size is greater than 8 bits, but less than or equal to 16 bits, txBuf and rxBuf are assumed to be arrays of 16-bit uint16_t elements. Otherwise, txBuf and rxBuf are assumed to point to 32-bit uint32_t elements.
data frame size | buffer element size |
---|---|
4-8 bits | uint8_t |
9-16 bits | uint16_t |
17-32 bits | uint32_t |
Data buffers in transactions (rxBuf & txBuf) must be address aligned according to the data frame size. For example, if data frame is 9-bit (driver assumes buffers are uint16_t) rxBuf & txBuf must be aligned on a 16-bit address boundary, if data frame is 20-bit (driver assumes buffers are uint32_t) rxBuf & txBuf must be aligned on a 32-bit address boundary.