2026-01-06 3:06 AM - last edited on 2026-01-06 3:09 AM by Andrew Neil
CubeMX 6.16.0's "Memory Management" Tool assumes Rx_PoolSection size to coincide with the Eth "Rx Buffers Length" - is that correct?
I used CubeMX 6.16.0 to create a project for an STM32 H755ZI-Q.
Then I opted to use the Tools -> "Memory Management" tool and afterwards enabled the ETH [ethernet] component. This automatically generated the required sections in the "Memory Management" tool. Great.
Then I enabled LwIP [with RTOS and CMSIS v2] and generated code.
Compiling this code worked - linking however did not. It told me the contents of Rx_PoolSection were too big, i.e. the section too small:
EBoxNG3_CM7.elf section `.Rx_PoolSection' will not fit in region `Rx_PoolSection'
region `Rx_PoolSection' overflowed by 225668
The buffer for the RX_POOL is declared in CM7\LWIP\Target\ethernetif.c:98:
#define ETH_RX_BUFFER_CNT 12U
LWIP_MEMPOOL_DECLARE(RX_POOL, ETH_RX_BUFFER_CNT, sizeof(RxBuff_t), "Zero-copy RX PBUF pool");with
__attribute__((section(".Rx_PoolSection"))) extern u8_t memp_memory_RX_POOL_base[];residing in the Rx_PoolSection.
Thus for ETH_RX_BUFFER_CNT greater than 1 this will not work!
My solution was to increase the Rx_PoolSection Size in the Memory Management tool to be able to accomodate all 12 buffers [(1536 + 4) * 12 bytes = 18480 bytes]. But then CubeMx assumes ETH "Rx Buffers Length" to also be this big [and correctly shows an error in the GUI]. This again leads to a section overflow.
So as a second step I had to manually adapt the following to lines of code:
- CM7\LWIP\Target\lwipopts.h:51
#define ETH_RX_BUFFER_SIZE 1536
- CM7\LWIP\Target\ethernetif.c:234:
heth.Init.RxBuffLen = 1536;
The actual problem to me seems to be that the Memory Management assumes the Rx Buffers Length to be the same as the Rx_PoolSection's size.
Can anyone confirm this observation?
Or tell me that I did something wrong and instruct me as to the correct way?
Thanks in advance
Johannes
2026-01-06 3:45 AM
Hello @JohannesWilde
Please share your .ioc file so I can review your STM32CubeMX configuration and better understand the situation you are facing.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2026-01-06 4:03 AM
Hi @Ghofrane GSOURI ,
I created a minimal example - where I first enabled the Memory Management, then ETH and LwIP for an STM32H755ZI.
Best regards
Johannes
2026-01-06 5:32 AM
A further note regarding an only marginally connected topic - if I should create a separate ticket, please let me know:
1. When using the Memory Management tool, then I am unable to en-/disable the "CPU ICache" and "CPU DCache" in System Core -> Coretex_M7 -> Cortex Interface Settings.
Disabling the Management Tool, manually en-/disabling the CPU caching options and afterwards re-enabling the Management Tool seems to work.
2. Also, when moving the RX_PoolSection, TxDescripSection, RxDescripSection to 0x30040000, no MPU region configuration is added for that region. And I am unable to manually add a configuration under System Core -> Coretex_M7 -> Cortex Memory Protection Unit Region x Settings.
Disabling the Management Tool, manually adding the MPU region settings and afterwards re-enabling the Management Tool deletes the manually added region.
Is there currently a work-flow where the Memory Management tool can be used and those settings configured via CubeMX 6.16.0?
2026-01-06 5:34 AM
As further information here my source for how to use the MMT:
2026-01-08 4:04 AM
Hello @JohannesWilde
Ticket 224780 has been escalated to the development team regarding the issue: "MX assumes that the Rx_PoolSection size is equal to the Rx buffer length."
@JohannesWilde wrote:
A further note regarding an only marginally connected topic - if I should create a separate ticket, please let me know:
1. When using the Memory Management tool, then I am unable to en-/disable the "CPU ICache" and "CPU DCache" in System Core -> Coretex_M7 -> Cortex Interface Settings.
Disabling the Management Tool, manually en-/disabling the CPU caching options and afterwards re-enabling the Management Tool seems to work.
2. Also, when moving the RX_PoolSection, TxDescripSection, RxDescripSection to 0x30040000, no MPU region configuration is added for that region. And I am unable to manually add a configuration under System Core -> Coretex_M7 -> Cortex Memory Protection Unit Region x Settings.
Disabling the Management Tool, manually adding the MPU region settings and afterwards re-enabling the Management Tool deletes the manually added region.
Is there currently a work-flow where the Memory Management tool can be used and those settings configured via CubeMX 6.16.0?
I'm investigating those points , I will get back to you asap.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2026-01-08 9:09 AM - edited 2026-01-08 9:11 AM
And now that I got the ethernet to talk to me at least in principle - one hopefully final comment from my part:
The Memory Management tool generates the RxDescripSection and TxDescripSection if enabled - as already noted above. The FW_H7 V1.12.1 with Cube MX 6.16.1 however still generates an CM7\LWIP\Target\ethernetif.c with the following code in lines 103ff:
#if defined ( __ICCARM__ ) /*!< IAR Compiler */
#pragma location=0x30040000
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
#pragma location=0x30040060
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */
#elif defined ( __CC_ARM ) /* MDK ARM Compiler */
__attribute__((at(0x30040000))) ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
__attribute__((at(0x30040060))) ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */
#elif defined ( __GNUC__ ) /* GNU Compiler */
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 */
#endifFor __GNUC__ this is problematic, as on closer inspection the section names are missing an "s".
RxDecripSection vs. RxDescripSection.
And the annoying thing about this, is that the linker does not complain but simply assumes some other position for those variables - which leads to the ethernet DMA being non-functional [because the MPU is configured differently].
I don't know whether this can be changed in a non-breaking way, considering that the linker scripts are not generated by CubeMX by default and thus a change in ethernet.c would be breaking for probably a lot of projects - but could someone confirm this observation and maybe propose a solution?
Best regards
Johannes
2026-01-15 1:30 AM
Hello @JohannesWilde
1- Actually, after moving the "Rx_PoolSection" region to address 0x30040100 and the "RxDescripSection" region to 0x30040000
CubeMX successfully reserved two MPU regions, as shown in the following screenshot.
2- Regarding the missing "s" in the section names, ticket 225186 has been escalated to the dedicated team for resolution.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.