2025-09-20 3:10 AM - edited 2025-09-24 9:50 PM
I am using the core STM32H743IITx with Dev board OpenH7XXI-C.
PHY IC - DP83848,With RMII configuration.
I am facing issue in Ethernet communication for every 10 min of interval, I am getting DMA Error with RBU,ETI,AIS bit in DMACSR is set.
but after few sec(30 to 40sec), It is reconnecting again.
DMA descriptors allocated in RAM_D2 section.
LWIP_RAM_HEAP_POINTER @ 0x30020000
.lwip_sec (NOLOAD) :
{
. = ABSOLUTE(0x30040000);
*(.RxDecripSection)
. = ABSOLUTE(0x30040060);
*(.TxDecripSection)
. = ABSOLUTE(0x30040200);
*(.Rx_PoolSection)
} >RAM_D2
MPU Configuration
MPU_InitStruct.Number = MPU_REGION_NUMBER5;
MPU_InitStruct.BaseAddress = 0x30020000;
MPU_InitStruct.Size = MPU_REGION_SIZE_128KB;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
/** Initializes and configures the Region and the memory to be protected
*/
MPU_InitStruct.Number = MPU_REGION_NUMBER6;
MPU_InitStruct.BaseAddress = 0x30040000;
MPU_InitStruct.Size = MPU_REGION_SIZE_512B;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;
2025-09-20 11:00 PM - edited 2025-09-20 11:03 PM
The problem usually arise from the application you are running, not from device or device setup.
For more advice, which drivers are you running (HAL or other), which Middleware ( TreadX or other) and which application is running.
Ethernet communication to be reliable require to manage receivd packets in real time; any other task can block your ethernet thread and generate DMA overflow.
LAST but not LEAST - there is a well known bug in 743 drivers that I explained in one of my previous post and was never fixed by stm - https://community.st.com/t5/stm32cubeide-mcus/stmcubemx-migration-to-v6-13-fw-h7-v1-12/td-p/749691 :
RxDecripSection
AND
TxDecripSection
in C code are
TxDescripSection
and
TxDescripSection
did you fix it ?
Mike
2025-09-22 8:31 AM
Hello @lavanya,
I agree with what @mbarg.1 said. Are you using an RTOS? If so, are you using SysTick as the timebase or a specific timer? For RTOS applications, we recommend using a dedicated timer for improved system stability.
The more details you provide about your configuration, debugging steps, and investigations, the better I can assist you in resolving the issue.
Best regards,
2025-09-22 10:52 PM - edited 2025-09-22 11:14 PM
Hi, @STackPointer64
Thank you for your replay,
I am using HAL library with LWIP middleware package by stm32CubeFW_H7 V1.12.1.
RTOS enabled and SysTick Timebase is TIM6.
ETH with RMII configuration.
every 10 min it is reconnecting the ETH connection before reconnection
1. Buf was overlaping
2. TX RX suspended (DMA Error with RBU,ETI,AIS bit in DMACSR is set.)
3. For 30 to 45 seconds it is in this state only after 45 seconds with my reconnection logic in freertos thread it is getting reconnect.
Default task is having Highest priority than start_Task3.
I am sharing my lwipopt.h
/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : Target/lwipopts.h
* Description : This file overrides LwIP stack default configuration
* done in opt.h file.
******************************************************************************
* @attention
*
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion --------------------------------------*/
#ifndef __LWIPOPTS__H__
#define __LWIPOPTS__H__
#include "main.h"
/*-----------------------------------------------------------------------------*/
/* Current version of LwIP supported by CubeMx: 2.1.2 -*/
/*-----------------------------------------------------------------------------*/
/* Within 'USER CODE' section, code will be kept by default at each generation */
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
#ifdef __cplusplus
extern "C" {
#endif
/* STM32CubeMX Specific Parameters (not defined in opt.h) ---------------------*/
/* Parameters set in STM32CubeMX LwIP Configuration GUI -*/
/*----- WITH_RTOS enabled (Since FREERTOS is set) -----*/
#define WITH_RTOS 1
/* Temporary workaround to avoid conflict on errno defined in STM32CubeIDE and lwip sys_arch.c errno */
#undef LWIP_PROVIDE_ERRNO
/*----- CHECKSUM_BY_HARDWARE enabled -----*/
#define CHECKSUM_BY_HARDWARE 1
/*-----------------------------------------------------------------------------*/
/* LwIP Stack Parameters (modified compared to initialization value in opt.h) -*/
/* Parameters set in STM32CubeMX LwIP Configuration GUI -*/
/*----- Default value in ETH configuration GUI in CubeMx: 1524 -----*/
#define ETH_RX_BUFFER_SIZE 1536
/*----- Default Value for MEMP_NUM_TCP_PCB: 5 ---*/
#define MEMP_NUM_TCP_PCB 10
/*----- Value in opt.h for MEM_ALIGNMENT: 1 -----*/
#define MEM_ALIGNMENT 4
/*----- Default Value for MEM_SIZE: 1600 ---*/
#define MEM_SIZE 14336
/*----- Default Value for H7 devices: 0x30004000 -----*/
#define LWIP_RAM_HEAP_POINTER 0x30020000
/*----- Default Value for MEMP_NUM_TCP_PCB_LISTEN: 8 ---*/
#define MEMP_NUM_TCP_PCB_LISTEN 10
/*----- Value supported for H7 devices: 1 -----*/
#define LWIP_SUPPORT_CUSTOM_PBUF 1
/*----- Default Value for PBUF_POOL_BUFSIZE: 592 ---*/
#define PBUF_POOL_BUFSIZE 1536
/*----- Value in opt.h for LWIP_ETHERNET: LWIP_ARP || PPPOE_SUPPORT -*/
#define LWIP_ETHERNET 1
/*----- Value in opt.h for LWIP_DNS_SECURE: (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT) -*/
#define LWIP_DNS_SECURE 7
/*----- Default Value for TCP_MSS: 536 ---*/
#define TCP_MSS 1460
/*----- Default Value for TCP_SND_BUF: 2920 ---*/
#define TCP_SND_BUF 5840
/*----- Default Value for TCP_SND_QUEUELEN: 17 ---*/
#define TCP_SND_QUEUELEN 16
/*----- Default Value for TCP_SNDLOWAT: 2921 ---*/
#define TCP_SNDLOWAT 1071
/*----- Default Value for TCP_WND_UPDATE_THRESHOLD: 1460 ---*/
#define TCP_WND_UPDATE_THRESHOLD 536
/*----- Value in opt.h for LWIP_NETIF_LINK_CALLBACK: 0 -----*/
#define LWIP_NETIF_LINK_CALLBACK 1
/*----- Value in opt.h for TCPIP_THREAD_STACKSIZE: 0 -----*/
#define TCPIP_THREAD_STACKSIZE 4096
/*----- Value in opt.h for TCPIP_THREAD_PRIO: 1 -----*/
#define TCPIP_THREAD_PRIO osPriorityRealtime
/*----- Value in opt.h for TCPIP_MBOX_SIZE: 0 -----*/
#define TCPIP_MBOX_SIZE 6
/*----- Value in opt.h for SLIPIF_THREAD_STACKSIZE: 0 -----*/
#define SLIPIF_THREAD_STACKSIZE 1024
/*----- Value in opt.h for SLIPIF_THREAD_PRIO: 1 -----*/
#define SLIPIF_THREAD_PRIO 3
/*----- Value in opt.h for DEFAULT_THREAD_STACKSIZE: 0 -----*/
#define DEFAULT_THREAD_STACKSIZE 2048
/*----- Value in opt.h for DEFAULT_THREAD_PRIO: 1 -----*/
#define DEFAULT_THREAD_PRIO 3
/*----- Value in opt.h for DEFAULT_UDP_RECVMBOX_SIZE: 0 -----*/
#define DEFAULT_UDP_RECVMBOX_SIZE 6
/*----- Value in opt.h for DEFAULT_TCP_RECVMBOX_SIZE: 0 -----*/
#define DEFAULT_TCP_RECVMBOX_SIZE 6
/*----- Value in opt.h for DEFAULT_ACCEPTMBOX_SIZE: 0 -----*/
#define DEFAULT_ACCEPTMBOX_SIZE 6
/*----- Default Value for LWIP_NETCONN_FULLDUPLEX: 0 ---*/
#define LWIP_NETCONN_FULLDUPLEX 1
/*----- Value in opt.h for RECV_BUFSIZE_DEFAULT: INT_MAX -----*/
#define RECV_BUFSIZE_DEFAULT 2000000000
/*----- Value in opt.h for LWIP_STATS: 1 -----*/
#define LWIP_STATS 0
/*----- Value in opt.h for CHECKSUM_GEN_IP: 1 -----*/
#define CHECKSUM_GEN_IP 0
/*----- Value in opt.h for CHECKSUM_GEN_UDP: 1 -----*/
#define CHECKSUM_GEN_UDP 0
/*----- Value in opt.h for CHECKSUM_GEN_TCP: 1 -----*/
#define CHECKSUM_GEN_TCP 0
/*----- Value in opt.h for CHECKSUM_GEN_ICMP6: 1 -----*/
#define CHECKSUM_GEN_ICMP6 0
/*----- Value in opt.h for CHECKSUM_CHECK_IP: 1 -----*/
#define CHECKSUM_CHECK_IP 0
/*----- Value in opt.h for CHECKSUM_CHECK_UDP: 1 -----*/
#define CHECKSUM_CHECK_UDP 0
/*----- Value in opt.h for CHECKSUM_CHECK_TCP: 1 -----*/
#define CHECKSUM_CHECK_TCP 0
/*----- Value in opt.h for CHECKSUM_CHECK_ICMP6: 1 -----*/
#define CHECKSUM_CHECK_ICMP6 0
/*-----------------------------------------------------------------------------*/
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
#ifdef __cplusplus
}
#endif
#endif /*__LWIPOPTS__H__ */
.
void StartDefaultTask(void const * argument)
{
/* init code for LWIP */
MX_LWIP_Init();
/* USER CODE BEGIN StartDefaultTask */
length = sizeof cilent_accept;
socketCreation();
/* Infinite loop */
for(;;)
{ cfd = lwip_accept(sock,(struct sockaddr*)&cilent_accept,(socklen_t *)&length);
if(cfd>0)
{
inet_ntop(AF_INET, &cilent_accept.sin_addr, temp_ip, sizeof(temp_ip));
if(strcmp(temp_ip,client1_ip)==0)
{
if(client1>0)
{
update_ui.conn_cnt++;
// lwip_shutdown(client1, SHUT_RDWR);
lwip_close(client1);
}
client1=cfd;
}
else
{
lwip_close(cfd);
}
}
osDelay(50);
}
/* USER CODE END StartDefaultTask */
}
/* USER CODE BEGIN Header_StartTask03 */
/**
* @brief Function implementing the my_App_Task thread.
* @param argument: Not used
* @retval None
*/
/* USER CODE END Header_StartTask03 */
void StartTask03(void const * argument)
{
/* USER CODE BEGIN StartTask03 */
/* Infinite loop */
update_ui.start='255';
update_ui.stop='254';
Tx1[0]='{';
Tx1[11]='}';
for(;;)
{
if(client1 > 0) //Labview
{
bytes=lwip_recv(client1,(void*) &Rx1,13,MSG_DONTWAIT);
osDelay(5);
if(bytes> 0)
{
if(Rx1[0]=='{' && Rx1[12]=='}')
{
update_ui.client1_rx_cnt++;
Rx_err_cnt=0;
HAL_GPIO_TogglePin(GPIOH,GPIO_PIN_4);
tx_bytes=lwip_send(client1,(void*) &Tx1,12,MSG_DONTWAIT);
if(tx_bytes>0)
{
update_ui.client1_tx_cnt++;
}
else
{
update_ui.tx_err_cnt++;
}
}
else
{
update_ui.rx_err_cnt++;
memcpy(CheckRx1,Rx1,13);
}
memset(Rx1, 0, sizeof Rx1);
//send_data_GUI();
}
else
{
Rx_err_cnt++;
check_errno= errno;
}
}
osDelay(15);
}
/* USER CODE END StartTask03 */
}
2025-09-23 12:20 AM
HI, @mbarg.1 ,
Hi I am using HAL Library + Lwip middleware Stm32CubeFW_H7_V1.12.1
.lwip_sec (NOLOAD) :
{
. = ABSOLUTE(0x30040000);
*(.RxDecripSection)
. = ABSOLUTE(0x30040060);
*(.TxDecripSection)
. = ABSOLUTE(0x30040200);
*(.Rx_PoolSection)
} >RAM_D2
/* .lwip_sec (NOLOAD) :
{
. = ABSOLUTE(0x30040000);
*(.RxDesripSection)
. = ABSOLUTE(0x30040060);
*(.TxDesripSection)
. = ABSOLUTE(0x30040200);
*(.Rx_PoolSection)
} >RAM_D2 */
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); /* Ethernet Rx DMA Descriptors */
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDecripSection"))); /* Ethernet Tx DMA Descriptors */
//ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDescripSection"))); /* Ethernet Rx DMA Descriptors */
//
//ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDescripSection"))); /* Ethernet TX DMA Descriptors */
RxDecripSection
AND
TxDecripSection
in C code are
TxDescripSection
and
TxDescripSection
If I change according to above Eth NOt Working atall.
2025-09-23 2:22 AM
Hello @lavanya,
After reviewing your lwipopts.h
configuration, I suggest increasing the heap size. You configured the MPU for 128 KB, but you are currently using only 14 KB. Please try increasing the heap size and see if this resolves your issue.
Best regards,
2025-09-23 5:24 AM - edited 2025-09-23 5:27 AM
I tried MEM_SIZE 16*1024 and,
In MPU configuration from RAM HEAP Pointer allocating 32KB as Non cacheable and Non bufferable.
still the same problem is there,
updating DMA error after every 10mins and reconnecting again.
2025-09-23 6:37 AM
Hello,
Could you please attach your project so I can review it? If the project is private, feel free to send it to me privately—I can provide a secure transfer method.
Best regards,
2025-09-23 10:48 PM
2025-09-24 12:36 AM
RAROpener says archive corrupted ...
Win7zip decompress but several files missing
downloaded size is 134.998.097