Skip to main content
Graduate II
September 20, 2025
Question

In STM32H743IITx with every 10min of interval DMA Error in DMACSR register RBU=1 ETI=1 AIS=1

  • September 20, 2025
  • 8 replies
  • 1405 views

 

 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

guidance on why this issue happens with regular interval will be helpful 
.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;

@Piranha @STea @LCE 

    This topic has been closed for replies.

    8 replies

    Graduate
    September 21, 2025

    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

    lavanyaAuthor
    Graduate II
    September 23, 2025

    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.

    Technical Moderator
    September 22, 2025

    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,

    lavanyaAuthor
    Graduate II
    September 23, 2025

    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 */
    }

     

     

    Technical Moderator
    September 23, 2025

    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,

    lavanyaAuthor
    Graduate II
    September 23, 2025

    HI @STackPointer64 

    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.

    Technical Moderator
    September 23, 2025

     

    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,

    Graduate
    September 24, 2025

    RAROpener says archive corrupted ...

    Win7zip decompress but several files missing

    downloaded size is 134.998.097 

    ST Employee
    September 24, 2025

    @lavanya wrote:

     

     I am using the core STM32H743IITx with Dev board OpenH7XXI-C.

     PHY IC - DP83848,With RMII configuration.

    It seems to be a development board from Waveshare company, with an ethernet PHY different from LAN8742 provided in STM32CubeH7 examples.

    You must have used software provided by this company.

    Did you ask them for support on their software and board ?

    lavanyaAuthor
    Graduate II
    September 25, 2025

    Hi @Guillaume K

    I am using PHY driver from waveshare provided examples only.

    I am attaching driver files here.

    This is snip is jst before reconnecting 

    lavanya_2-1758795763989.png

    Graduate II
    September 25, 2025

    RBU: Receive Buffer Unavailable

    So it looks like you're receiving many many small packets.

    It guess that these each "use up" an RX descriptor, and depending on your lwip settings also a complete packet buffer (pbuf).

    I would largely increase the number of RX descriptors (that doesn't take too much memory), then also increase the numbers of pbufs.
    As always, make sure where that memory is placed, check there's no overlap with RX / TX descriptors.

    Also check how and how often your application handles RX packets, maybe you need to speed that up.
    If you receive a high number of small packets in a short time, your application should handle that accordingly.

     

    And finally: the HAL ETH driver and lwip are quite heavy things to handle, as soon as data rate goes up or some special features are required, you must dive into to that and understand more in detail what's going on there.

    Technical Moderator
    September 25, 2025

    Hello @lavanya,

    After reviewing your project, I believe the memory corruption is likely due to the number of Rx buffers you are using. In the lwipopts.h file, you specified 16*1024 bytes for MEM_SIZE, which could handle up to 10 Rx buffers sized at 1,536 bytes each. However, your Rx buffer count is set to 12, exceeding the allocated memory by 2KB. This mismatch could explain the memory corruption issue. I suggest you adjust this either by setting the RxBuffers to 10 or increasing even more the MEM_SIZE and let me know if it resolves the problem. Meanwhile, I will continue checking for other misconfigurations that might be causing the issue.

    Best regards,

     

    lavanyaAuthor
    Graduate II
    September 29, 2025

    Hi @STackPointer64  Any update on this?

     

    Graduate II
    September 29, 2025

    @lavanya have you made the changes shown above?

    Or checked what I recommended?

    Graduate II
    September 29, 2025

    Too long ago when I wrote my H723 ETH driver that I remember all the details...

    And you are absolutely sure that the RX pool is defined and placed correctly (I don't know the H743, the H723 only has 16k in that "area") ?

    Just found in my notes that RX descriptor size must be lower than the number of buffers in lwip's RX pool.

    So, how many TX and RX descriptors do you have? This number does not have to be the same.

    These don't take much memory (4x u32 ?), and you probably need a few more on the TX side. I remember having seen lwIP using many small "packets", esp. with CGI or SSI, which I think each use up a descriptor. Not sure though...

    lavanyaAuthor
    Graduate II
    September 29, 2025

    @STackPointer64  @LCE  Now,

    I am not getting RBU DMA error but still,

    Case 1: my STM32 not ack segments from peer and peer is requesting retransmission req continuously.

    and lead to RST connection 

    within few min reconnecting continuously.

    Capture.PNG

    Case2 : Out of packets from peer. lead to retransmit req  from peer (During retransmission req from peer my Eth IRQ is not triggering), This lead to pause in communication :(

    lavanya_0-1759211766864.png