2024-04-11 04:10 AM
我用板子A:STM32H743VIT6,HAL库开发,版本v1.9.0
HSE=20M,主频480M
串口1使能,DMA发送,IDLE+DMA接收数据。
发送使用1ms定时器进行DMA串口发送,发送间隔1ms,发送数据长度18字节。
板子B:STM32F405RGT6,HAL库开发,版本v1.27.0
HSE=8M,主频168M
串口2使能,DMA发送,IDLE+DMA接收数据。
数据发送使用1ms定时器,10ms间隔通过DMA发送数据,发送数据长度18字节。
连线
板子A的Tx-板子B的Rx。
板子A的Rx-板子B的Tx。
问题:
H7板子数据发送正常,统计1s内,理论应发1000*18=18000字节,实际收到18000字节。
但是F4板子数据收到不足18000字节,发送数据也丢字节。
IDLE中断没有耗时操作,只把收到数据长度进行累加,然后退出。
2024-04-11 04:13 AM
使用UART,波特率2Mbps,1停止位,无校验,无流控
2024-04-11 04:14 AM
Hello,
In english please.
2024-04-11 04:17 AM
STM32F405 chip USART 2M baud DMA received and sent data lost
I use board A: STM32H743VIT6, HAL library development, version v1.9.0 HSE = 20M, main frequency 480M serial port 1 enabled, DMA send, IDLE + DMA receive data. Send using 1ms timer for DMA serial send, send interval 1ms, send data length 18 bytes. Board B: STM32F405RGT6, HAL library development, version v1.27.0 HSE = 8M, main frequency 168M serial port 2 enabled, DMA send, IDLE + DMA receive data. Data send using 1ms timer, 10ms interval through DMA send data, send data length 18 bytes. Connect board A's Tx - board B's Rx. Board A's Rx - board B's Tx. Problem: H7 board data send normal, statistics within 1s, the theory should send 1000*18 = 18000 bytes, the actual received 18000 bytes. But F4 board data received less than 18000 bytes, send data also lost bytes. IDLE interrupt without time-consuming operation, only the length of the data received accumulated, and then exit. I use board A: STM32H743VIT6, HAL library development, version v1.9.0 HSE = 20M, main frequency 480M serial port 1 enabled, DMA send, IDLE + DMA receive data. Send using 1ms timer for DMA serial send, send interval 1ms, send data length 18 bytes. Board B: STM32F405RGT6, HAL library development, version v1.27.0 HSE = 8M, main frequency 168M serial port 2 enabled, DMA send, IDLE + DMA receive data. Data send using 1ms timer, 10ms interval through DMA send data, send data length 18 bytes. Connect board A's Tx - board B's Rx. Rx of board A - Tx of board B. Problem: H7 board data transmission is normal, statistics within 1s, the theory should send 1000*18=18000 bytes, the actual received 18000 bytes. But F4 board data received less than 18000 bytes, the transmitted data also lost bytes. IDLE interrupt has no time-consuming operation, only accumulates the length of the received data, and then exits.