fix: move DMA buffers from DTCM to RAM_D1, improve bsp_usart error recovery
- Add .dma_buf section in RAM_D1 for DMA-accessible USART instance pool. DTCM (0x20000000) is not reachable by DMA on STM32H7, causing bus errors (TE) when DMA writes to malloc'd buffers placed in DTCM by the XG linker script. - Replace malloc with static pool (usart_pool[]) placed in .dma_buf section. - In RxEventCallback, set recv_buff_size from Size so module callbacks know how many bytes were actually received. - Use USART_RXBUFF_LIMIT (256) as the DMA transfer size instead of per-module recv_buff_size. The actual buffer is always 256 bytes. - Remove recv_buff_size from USART_Init_Config_s; it is now set at runtime. - Flush RDR, clear error flags, and clear stale DMAR in error callback to prevent residual conditions from re-triggering errors on DMA restart. - Switch Vision module from UART10 to UART1.
This commit is contained in:
@@ -228,7 +228,7 @@ void RobotCMDInit()
|
||||
PIDInit(&vision_pitch_pid, &pitch_vpid_config);
|
||||
VisionKalmanFilterInit();
|
||||
|
||||
Vision_Uart_Init(&huart10);
|
||||
Vision_Uart_Init(&huart1);
|
||||
laser_off();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user