2025-12-01 4:48 AM - last edited on 2025-12-02 7:37 AM by mƎALLEm
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code and a linker script content. Please read this post: How to insert source code.
Hello,
I am working on STM32H753ZI (NUCLEO-H753ZI board) with NetX Duo.
I am trying to place all Ethernet DMA descriptors, RX/TX buffers, and NetX packet pool in D2 SRAM, but the system always ends up in a Hard Fault right after starting the Ethernet interface.
I have already followed the ST AN4838 guidelines and forum suggestions, but the fault still occurs.
1. My linker script sections
.NetXPoolSection (NOLOAD) :
{
. = ALIGN(32);
KEEP(*(.NetXPoolSection))
} >RAM_D2
.RxDescripSection (NOLOAD) :
{
. = ALIGN(32);
KEEP(*(.RxDescripSection))
} >RAM_D2
.TxDescripSection (NOLOAD) :
{
. = ALIGN(32);
KEEP(*(.TxDescripSection))
} >RAM_D2
.RxBuffSection (NOLOAD) :
{
. = ALIGN(4);
KEEP(*(.RxBuffSection))
} >RAM_D2
2. My variable placement
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]
__attribute__((section(".RxDescripSection")));
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]
__attribute__((section(".TxDescripSection")));
uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE]
__attribute__((section(".RxBuffSection"), aligned(4)));
UCHAR nx_packet_pool_area[NX_APP_PACKET_POOL_SIZE]
__attribute__((section(".NetXPoolSection"), aligned(32)));
3. MPU configuration
void MPU_Config(void)
{
MPU_Region_InitTypeDef MPU_InitStruct = {0};
HAL_MPU_Disable();
// Region 0 — default deny
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER0;
MPU_InitStruct.BaseAddress = 0x00000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_4GB;
MPU_InitStruct.SubRegionDisable = 0x87;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
// Region 1 — D2 SRAM (0x30040000, 128 KB)
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER1;
MPU_InitStruct.BaseAddress = 0x30040000;
MPU_InitStruct.Size = MPU_REGION_SIZE_128KB;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE; // I want DMA-safe
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}
Even after moving descriptors and packet pool to D2 SRAM and disabling cache for the region, the system always goes to Hard Fault immediately after initializing IP + DHCP (NetX Duo). I need help with:
Is my MPU configuration correct for DMA on D2 SRAM?
Should D2 region be Shareable + non-cacheable instead of non-shareable?
Does NetX Duo require packet pool to be in a specific alignment or boundary (e.g., 32-byte start)?
What is the correct way to verify memory overlap or MPU region conflict on STM32H753?
Does ST provide a reference Cube MX + NetX Duo + DHCP example for NUCLEO-H753ZI?
Any guidance or working example would be greatly appreciated.
Thank you!
2025-12-04 10:16 AM
Hello @SDTAN0907,
There is an article that explains the steps and configurations needed to create a NetXDuo example on the STM32H753. You can skip the IPv6 part and UART if you don’t intend to print debug messages:
To answer your questions:
Is my MPU configuration correct for DMA on D2 SRAM?
Yes, it is correct.
Should the D2 region be Shareable + Non-cacheable instead of Non-shareable?
The way it is currently declared is correct.
Does NetXDuo require the packet pool to be aligned to a specific boundary (e.g., 32-byte start)?
Not that I know of.
What is the correct way to verify memory overlap or MPU region conflicts on STM32H753?
You need to verify manually when configuring the regions, or your application will not run. Careful planning is essential.
Does ST provide a reference CubeMX + NetXDuo + DHCP example for NUCLEO-H753ZI?
Unfortunately, there isn’t a reference example for the NUCLEO-H753ZI, but the article I mentioned will help you create and configure a correct example.
Best regards,
2025-12-04 10:20 AM
2025-12-08 5:18 AM
hii @STackPointer64,
Thanks for the static IP suggestion, but my requirement is dynamic addressing.
I already have IPv4 via DHCP working. I need IPv6 via SLAAC (stateless autoconfiguration) on STM32H753ZI.
Can you help with the IPv6/SLAAC path? Specifically:
I’m fine with link‑local coming up first, but I need global IPv6 via SLAAC once RAs are received.
2025-12-09 3:35 PM
sadly its not possible to download your zip file .. "virus scan in progress ..."?? =)
2025-12-09 3:37 PM
hey there, could you attach your working code somehow, somewhere? =)
i am trying for hours to get the H755 to work with threadx, netx and dhcp.. ipv4 would good to go.. but only weird errors, crashes etc :D no idea why there is no working demo somewhere =/
2025-12-09 8:53 PM
2025-12-09 9:20 PM
Hii everyone,
Can you help with the IPv6 via SLAAC path?
2025-12-10 3:15 AM
Hello @slaesh,
I have sent you the project as an attachment in a private message.
Best regards,
2025-12-10 3:19 AM
Hello @SDTAN0907,
I suggest you open a new thread for this issue to gain more visibility, as this request differs from the initial thread description and headline. Also, please remember to click 'Accept as Solution' on the reply that resolved your initial issue.
Best regards,