[ AT Firmware] ESP32-S2 Solo Stops Responding After Several Hours of Stable Operation

amir.shn
Posts: 2
Joined: Thu Oct 16, 2025 5:59 pm

[ AT Firmware] ESP32-S2 Solo Stops Responding After Several Hours of Stable Operation

Postby amir.shn » Thu Oct 16, 2025 6:36 pm

Hi Everyone,

I’m transmitting data from my main MCU (an STM32H7) to an ESP32-S2-SOLO via UART at 115200 baud. The data is sent at a sampling rate of approximately 20 Hz by initializing a UDP server and using normal transmission mode through the AT+CIPSEND command. However, I occasionally receive a “busy p...” response after about an hour of operation, and after roughly three hours, the ESP32 becomes completely unresponsive. I’ve confirmed that when the ESP32 hangs, the STM32 is still actively sending commands to it.

Here is my init commands:
"AT\r\n"
"ATE0\r\n" //Switch echo off
"AT+CWMODE=2\r\n" //Set the Wi-Fi mode to Station+SoftAP
"AT+CWSAP=\"iAPM Server\",\"3CAPM2025\",6,3\r\n"
"AT+CIPMUX=1\r\n" // Enable multiple connections
"AT+CIPSTART=0,\"UDP\",\"0.0.0.0\",5000,5000,2\r\n"

Here is my TX function:

void ESP32_WIFI_Send(const char* data)
{
ESP32_WIFIObject_t *Obj = wifi_obj_get();
uint16_t len = strlen(data);
char cmd[128];
uint8_t *pdata = Obj->Runtime.scan_result;
Obj->Runtime.Timeout = 50;
wifi_uart_stat = HAL_ERROR;

for (int i = 0; i < WIFI_MAX_CON; i++) {
HAL_Delay(1);
if (ESP32_clients.connection_stat) {
snprintf(cmd, sizeof(cmd), "AT+CIPSENDEX=0,%d,\"%s\",%d\r\n",len,ESP32_clients.ip, ipad_wifi_port);
wifi_uart_stat = HAL_UART_Transmit(&esp_uart, (uint8_t *)cmd, strlen(cmd), 100);

if (wifi_uart_stat == HAL_OK) {
memset(pdata, 0, ESP32_WIFI_SCAN_BUF_SIZE);
Obj->fops.IO_Receive(pdata, ESP32_WIFI_SCAN_BUF_SIZE, Obj->Runtime.Timeout);
}

if (strstr((char*) pdata, "\r\nERROR\r\n")) {
#ifdef DEBUG
Get_Time();
printf(" %02d:%02d:%02d = Wifi TX Error\n", rtc_time.hour, rtc_time.minutes, rtc_time.seconds);
#endif
}
else if (strstr((char*) pdata, "\r\n>")) {
// if (UartReady == SET) {
// UartReady = RESET;
// HAL_UART_Transmit_DMA(&esp_uart, (uint8_t*)data, len);
HAL_UART_Transmit(&esp_uart, (uint8_t*)data, len,50);
memset(pdata, 0, ESP32_WIFI_SCAN_BUF_SIZE);
Obj->fops.IO_Receive(pdata, ESP32_WIFI_SCAN_BUF_SIZE, Obj->Runtime.Timeout);
if (!strstr((char*)pdata, "SEND OK")) {
#ifdef DEBUG
printf(" %02d:%02d:%02d = WARN: ESP32 didn't complete the TX.\n", rtc_time.hour, rtc_time.minutes, rtc_time.seconds);
#endif
DEBUG_LOG("WARN: WARN: ESP32 didn't complete the TX.");
HAL_Delay(25);
}
if (strstr((char*)pdata, "busy p")) {
#ifdef DEBUG
printf(" %02d:%02d:%02d = WARN: ESP32 has been overloaded.\n", rtc_time.hour, rtc_time.minutes, rtc_time.seconds);
#endif
DEBUG_LOG("WARN: ESP32 has been overloaded.");
HAL_Delay(50);
}
}

}

}
}

Any help or advice would be highly appreciated.

Amir

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot], Qwantbot and 2 guests