Skip to main content
Explorer
December 1, 2025
Question

STM32H7 + NetXDuo + DHCP → Hard Fault enabling Ethernet DMA descriptors & packet pool

  • December 1, 2025
  • 3 replies
  • 259 views

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:

  1. Is my MPU configuration correct for DMA on D2 SRAM?

  2. Should D2 region be Shareable + non-cacheable instead of non-shareable?

  3. Does NetX Duo require packet pool to be in a specific alignment or boundary (e.g., 32-byte start)?

  4. What is the correct way to verify memory overlap or MPU region conflict on STM32H753?

  5. 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!

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    December 4, 2025

    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,

    Technical Moderator
    December 4, 2025

    As a bonus, I have attached a newly created example that meets your needs. I hope it serves you well.

    Visitor II
    December 9, 2025

    sadly its not possible to download your zip file .. "virus scan in progress ..."?? =)

    Technical Moderator
    December 10, 2025

    Hello @slaesh,

    I have sent you the project as an attachment in a private message.

    Best regards,

    SDTAN0907Author
    Explorer
    December 8, 2025

    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:

    • Correct CubeMx settings.
    • Ensuring the Ethernet driver passes IPv6 frame.
    • Accepting required multicast for RA/NS/NA (e.g., ff02::1, ff02::2, and solicited‑node)
    • Any STM32H7 MAC filter changes so Router Advertisements reach the stack

    I’m fine with link‑local coming up first, but I need global IPv6 via SLAAC once RAs are received.  

    Could you please review my configuration and suggest what I’m missing?
    I’ve attached my app_netxduo.c and app_netxduo.h.
     
    Best regards,
    Divya P
    Visitor II
    December 9, 2025

    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 =/