cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753ZI + NetXDuo + DHCP → Hard Fault when enabling Ethernet DMA descriptors and NetX packet pool in D2 SRAM

SDTAN0907
Associate III

 

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!

0 REPLIES 0