STM32H7的MDMA有个使用要求:每次突发传输的总数据大小不能超过128字节。
1、对于源地址就是SourceBurst * SourceDataSize < BufferTransferLength
2、对于目的地址就是DestBurst*DestDataSize < BufferTransferLength
现在修改下面帖子的MDMA配置:
http://www.armbbs.cn/forum.ph ... 4058&extra=page%3D1
MDMA_Handle.Init.Request = MDMA_REQUEST_SW; /* 软件触发 */
MDMA_Handle.Init.TransferTriggerMode = MDMA_BLOCK_TRANSFER; /* 块传输 */
MDMA_Handle.Init.Priority = MDMA_PRIORITY_HIGH; /* 优先级高*/
MDMA_Handle.Init.Endianness = MDMA_LITTLE_ENDIANNESS_PRESERVE; /* 小端 */
MDMA_Handle.Init.SourceInc = MDMA_SRC_INC_DOUBLEWORD; /* 源地址自增,双字,即8字节 */
MDMA_Handle.Init.DestinationInc = MDMA_DEST_INC_DOUBLEWORD; /* 目的地址自增,双字,即8字节 */
MDMA_Handle.Init.SourceDataSize = MDMA_SRC_DATASIZE_DOUBLEWORD; /* 源地址数据宽度双字,即8字节 */
MDMA_Handle.Init.DestDataSize = MDMA_DEST_DATASIZE_DOUBLEWORD; /* 目的地址数据宽度双字,即8字节 */
MDMA_Handle.Init.DataAlignment = MDMA_DATAALIGN_PACKENABLE; /* 小端,右对齐 */
MDMA_Handle.Init.SourceBurst = MDMA_SOURCE_BURST_8BEATS; /* 源数据突发传输,SourceBurst*SourceDataSize < BufferTransferLength*/
MDMA_Handle.Init.DestBurst = MDMA_DEST_BURST_8BEATS; /* 目的数据突发传输,DestBurst*DestDataSize < BufferTransferLength */
MDMA_Handle.Init.BufferTransferLength = 128; /* 每次传输128个字节 */
MDMA_Handle.Init.SourceBlockAddressOffset = 0; /* 用于block传输,地址偏移0 */
MDMA_Handle.Init.DestBlockAddressOffset = 0; /* 用于block传输,地址偏移0 */ |