2025-09-11 12:37 AM - last edited on 2025-09-11 1:03 AM by Andrew Neil
Hello ST Community,
I am working with STM32H750VBTx on STM32CubeIDE. I use UART7 + DMA with HAL_UARTEx_ReceiveToIdle_DMA()
to receive responses from a GSM modem.
Problem:
- GSM responses are stored in my gsm_response_buffer[] incrementally
- For example: first "RDY", then "AT OK", then "ATE0 OK" → all get appended
- I expected each new DMA reception to start at buffer[0].
Debug screenshots are attached.
Could you please advise how to properly useDMA reception so each new response starts from
gsm_response_buffer[0]?
Thanks in advance!
Refer the code in the Test_GSM.c file also if needed
in the main.c file i call
```c
/* USER CODE BEGIN 2 */
#if (ENABLE_006_GSM_Folder == 1)
HAL_UARTEx_ReceiveToIdle_DMA( &huart7, gsm_response_buffer, GSM_RESPONSE_BUFFER_SIZE );
__HAL_DMA_DISABLE_IT(&hdma_uart7_rx, DMA_IT_HT);
#endif
```
```c
/* USER CODE BEGIN 0 */
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
if(huart->Instance == UART7){
HAL_UARTEx_ReceiveToIdle_DMA(&huart7,
gsm_response_buffer,
GSM_RESPONSE_BUFFER_SIZE);
__HAL_DMA_DISABLE_IT(&hdma_uart7_rx, DMA_IT_HT);
}
}
/* USER CODE END 0 */
```
Edited to apply proper source code formatting - please see How to insert source code for future reference.
2025-09-11 12:42 AM
these are my ioc settings
2025-09-11 2:33 AM
It looks like the Rx Complete callback is only called once, at the end of all reception sequence.
In other words could it happen that all received data are sent in sequence without sufficient time between some cars to trig the IDLE event ?
A test you could make is to add a counter in HAL_UARTEx_RxEventCallback() to check how many times it is called, and try to check what is the value of Size when called.
Hope this helps