From 40a3cccacd4a8eedd296fa2460a5e0327c16e5ee Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Wed, 1 Jul 2026 10:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A5=9E=E5=A5=87=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=91=E8=A7=A3=E5=86=B3DMA=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E5=86=85=E5=AD=98=E5=AF=BC=E8=87=B4=E7=9A=84=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project_old/paint_robot_old/BASE/Src/BSP/bsp_UART.c | 10 ++++++---- project_old/paint_robot_old/paint_robot_old.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/project_old/paint_robot_old/BASE/Src/BSP/bsp_UART.c b/project_old/paint_robot_old/BASE/Src/BSP/bsp_UART.c index b59a7c7..8bb67b6 100644 --- a/project_old/paint_robot_old/BASE/Src/BSP/bsp_UART.c +++ b/project_old/paint_robot_old/BASE/Src/BSP/bsp_UART.c @@ -19,6 +19,8 @@ uint8_t RS485_4_RxDMA_buf[UART_Receive_MAX_NUM]; uint8_t Debug_RxDMA_buf[UART_Receive_MAX_NUM]; uint8_t ExternSerial_RxDMA_buf[UART_Receive_MAX_NUM]; +__attribute__((section(".dma_buffer"), aligned(32))) +uint8_t MyRS485_TxDMA_buf[UART_Transmit_MAX_NUM]; uint8_t RS485_1_TxDMA_buf[UART_Transmit_MAX_NUM]; uint8_t RS485_2_TxDMA_buf[UART_Transmit_MAX_NUM]; uint8_t RS485_3_TxDMA_buf[UART_Transmit_MAX_NUM]; @@ -231,10 +233,10 @@ void UARTHandlerTx(struct UARTHandler *uartHandler) } - SCB_CleanInvalidateDCache_by_Addr((uint32_t*) uartHandler->Tx_Buf, - uartHandler->TxCount); - - HAL_UART_Transmit_DMA(uartHandler->uart, uartHandler->Tx_Buf, +// SCB_CleanInvalidateDCache_by_Addr((uint32_t*) uartHandler->Tx_Buf, +// uartHandler->TxCount); + memcpy(MyRS485_TxDMA_buf, uartHandler->Tx_Buf, uartHandler->TxCount); + HAL_UART_Transmit_DMA(uartHandler->uart, MyRS485_TxDMA_buf, uartHandler->TxCount); #if defined (hlpuart1Exit) } diff --git a/project_old/paint_robot_old/paint_robot_old.c b/project_old/paint_robot_old/paint_robot_old.c index 2f06925..250ab4b 100644 --- a/project_old/paint_robot_old/paint_robot_old.c +++ b/project_old/paint_robot_old/paint_robot_old.c @@ -100,10 +100,10 @@ void GF_Robot_Init() is_upper_computer_take_over_control = 0; DLT_LOG_ENABLE_LEVEL = 7; //7 send all information //0 send nothing //dLT_Log_intialize(&InterCall_DEBUG_UART_Handler); //huart4 - //dLT_Log_intialize(&RS_485_4_UART_Handler); + dLT_Log_intialize(&RS_485_4_UART_Handler); udp_client_init(); tcp_server_init(3490); - dLT_Log_intialize_udp_tcp(); + //dLT_Log_intialize_udp_tcp(); upper_Computer_UART_Handler_intialize(&RS_485_4_UART_Handler);//send to computer to 485 TL720D_intialize(&RS_485_1_UART_Handler); MK32_Sbus_UART_Handler_intialize(&E28_SBUS_UART_Handler); //huart5