请教调试两块板子STM32 SPI DMA主从机通信遇到从机接收数据出错的问题
时间:10-02
整理:3721RD
点击:
调试两块板子STM32 SPI DMA主从通信,主机是STM32F107 SPI3 DMA2通道2主机发送时钟和MOSI波形正常,从机stm32f103 SPI2 DMA1通道4第一次接收是对的,以后几次就会出错,仿真按数据看似有规律,每隔几个数据就是对的。这是我主机发送的数组,
#define BufferSize 32
uint8_t SPI_MASTER_Buffer_Tx[BufferSize] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,
0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,
0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20};
从机接收的数据,大家分析一下是什么原因,谢谢
#define BufferSize 32
uint8_t SPI_MASTER_Buffer_Tx[BufferSize] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,
0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,
0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,
0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20};
从机接收的数据,大家分析一下是什么原因,谢谢
单步追踪一下,看看