Skip to main content
Visitor II
December 5, 2023
Question

stm32f429t6, the uart8 dma rx function works on 3 out of 5 boards and does not work on 2

  • December 5, 2023
  • 4 replies
  • 1317 views

In stm32f429t6, the uart8 dma rx function works on 3 out of 5 boards and does not work on 2. The same firmware was applied to 5 boards, and if only the uart8 interrupt was used without using dma, the 5 boards mode operated normally. What is the cause of the problem of DMA RX not working on two boards and how to improve it?

 

const uint16_t UART8_RX_BUF_SIZE = 256;
uint8_t uart8RxBuf[UART8_RX_BUF_SIZE];

extern DMA_HandleTypeDef hdma_uart8_rx;

/* USER CODE END PV */

 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 MX_DMA_Init();
 MX_USART3_UART_Init();
 MX_USART2_UART_Init();
 MX_UART8_Init();
 MX_LWIP_Init();
 MX_ADC3_Init();
 MX_USART1_UART_Init();
 MX_TIM1_Init();
 MX_TIM2_Init();
 MX_TIM3_Init();
 MX_TIM4_Init();
 MX_TIM5_Init();
 /* USER CODE BEGIN 2 */
 ups.initializeRingBuffer(); 

 HAL_UARTEx_ReceiveToIdle_DMA(&huart8, uart8RxBuf, UART8_RX_BUF_SIZE);

void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{ 
 if(huart->Instance == UART8)
 {
 ups.handleUartData(uart8RxBuf, Size);
 HAL_UARTEx_ReceiveToIdle_DMA(&huart8, uart8RxBuf, UART8_RX_BUF_SIZE);
 }
}
/* USER CODE END 4 */

 

 

    This topic has been closed for replies.

    4 replies

    ST Employee
    December 5, 2023

    Hello @joseph05 

    This seems to be a hardware issue? 

    Super User
    December 5, 2023

    What does "not working" mean here exactly? You're the only one with the board and code, step through and understand what isn't happening and why. Use those results to guide your investigation.

    Look at the hardware for any defects. In particular at the UART_RX pin for solder bridges or cold joints.

    Graduate II
    December 5, 2023

    That would be a very odd state of affairs. Assume the problem is not with the DMA, but the reception of data.

    Not working in the sense that the DMA or UART report some error or failure status you're not addressing? Check what info UART->ISR / SR reports in these conditions. Clear sticky errors preventing reception. Check manual.

    Your code looks to ignore errors

    joseph05Author
    Visitor II
    December 13, 2023

    The problem has not been resolved yet and the cause is being investigated. I will update any additional information found.