Skip to main content
Visitor
June 30, 2026
Question

Ethernet Communication is not working in NUCLEO-H723ZGT6

  • June 30, 2026
  • 2 replies
  • 21 views

Hello Everyone please guide me in the stm32h7xx_hal_eth.c file a function which name is HAL_ETH_ReadData() is not properly working in this function while loop is not working the main specific this part => “ (READ_BIT(dmarxdesc->DESC3, ETH_DMARXNDESCWBF_OWN) == (uint32_t)RESET)”

isn not working and i ma getting output is host unreachable  => PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
From 192.168.1.10 icmp_seq=1 Destination Host Unreachable

i am using NUCLEO-H723ZGT6 board 

 

 

HAL_StatusTypeDef HAL_ETH_ReadData(ETH_HandleTypeDef *heth, void **pAppBuff)
{
uint32_t descidx;
uint32_t descidx_next;
ETH_DMADescTypeDef *dmarxdesc_next;
ETH_DMADescTypeDef *dmarxdesc;
uint32_t desccnt = 0U;
uint32_t desccntmax;
uint32_t bufflength;
uint8_t rxdataready = 0U;
 
if (pAppBuff == NULL)
{
heth->ErrorCode |= HAL_ETH_ERROR_PARAM;
return HAL_ERROR;
}
 
if (heth->gState != HAL_ETH_STATE_STARTED)
{
return HAL_ERROR;
}
 
descidx = heth->RxDescList.RxDescIdx;
dmarxdesc = (ETH_DMADescTypeDef *)heth->RxDescList.RxDesc[descidx];
desccntmax = ETH_RX_DESC_CNT - heth->RxDescList.RxBuildDescCnt;
 
/* Check if descriptor is not owned by DMA */
while ((READ_BIT(dmarxdesc->DESC3, ETH_DMARXNDESCWBF_OWN) == (uint32_t)RESET) && (desccnt < desccntmax)
&& (rxdataready == 0U))
{
if ((READ_BIT(dmarxdesc->DESC3, ETH_DMARXNDESCWBF_FD) != (uint32_t)RESET) ||
(heth->RxDescList.pRxStart != NULL))
{
/* Check if first descriptor */
if (READ_BIT(dmarxdesc->DESC3, ETH_DMARXNDESCWBF_FD) != (uint32_t)RESET)
{
heth->RxDescList.RxDescCnt = 0;
heth->RxDescList.RxDataLength = 0;
}
 
/* Get the Frame Length of the received packet */
bufflength = READ_BIT(dmarxdesc->DESC3, ETH_DMARXNDESCWBF_PL) - heth->RxDescList.RxDataLength;
 
/* Check if last descriptor */
if (READ_BIT(dmarxdesc->DESC3, ETH_DMARXNDESCWBF_LD) != (uint32_t)RESET)
{
/* Save Last descriptor index */
heth->RxDescList.pRxLastRxDesc = dmarxdesc->DESC3;
 
/* Packet ready */
rxdataready = 1;
 
if (READ_BIT(dmarxdesc->DESC1, ETH_DMARXNDESCWBF_TSA) != (uint32_t)RESET)
{
descidx_next = descidx;
INCR_RX_DESC_INDEX(descidx_next, 1U);
 
dmarxdesc_next = (ETH_DMADescTypeDef *)heth->RxDescList.RxDesc[descidx_next];
 
if (READ_BIT(dmarxdesc_next->DESC3, ETH_DMARXNDESCWBF_CTXT) != (uint32_t)RESET)
{
/* Get timestamp high */
heth->RxDescList.TimeStamp.TimeStampHigh = dmarxdesc_next->DESC1;
/* Get timestamp low */
heth->RxDescList.TimeStamp.TimeStampLow = dmarxdesc_next->DESC0;
}
}
}
 
/* Link data */
#if (USE_HAL_ETH_REGISTER_CALLBACKS == 1)
/*Call registered Link callback*/
heth->rxLinkCallback(&heth->RxDescList.pRxStart, &heth->RxDescList.pRxEnd,
(uint8_t *)dmarxdesc->BackupAddr0, bufflength);
#else
/* Link callback */
HAL_ETH_RxLinkCallback(&heth->RxDescList.pRxStart, &heth->RxDescList.pRxEnd,
(uint8_t *)dmarxdesc->BackupAddr0, (uint16_t) bufflength);
#endif /* USE_HAL_ETH_REGISTER_CALLBACKS */
heth->RxDescList.RxDescCnt++;
heth->RxDescList.RxDataLength += bufflength;
 
/* Clear buffer pointer */
dmarxdesc->BackupAddr0 = 0;
}
 
/* Increment current rx descriptor index */
INCR_RX_DESC_INDEX(descidx, 1U);
/* Get current descriptor address */
dmarxdesc = (ETH_DMADescTypeDef *)heth->RxDescList.RxDesc[descidx];
desccnt++;
}
 
heth->RxDescList.RxBuildDescCnt += desccnt;
if ((heth->RxDescList.RxBuildDescCnt) != 0U)
{
/* Update Descriptors */
ETH_UpdateDescriptor(heth);
}
 
heth->RxDescList.RxDescIdx = descidx;
 
if (rxdataready == 1U)
{
/* Return received packet */
*pAppBuff = heth->RxDescList.pRxStart;
/* Reset first element */
heth->RxDescList.pRxStart = NULL;
 
return HAL_OK;
}
 
/* Packet not ready */
return HAL_ERROR;
}

2 replies

Graduate
June 30, 2026

Probably the Ethernet buffers or DMA descriptors are not placed properly in the linker script configuration, on H7 they should be placed in a proper memory region like RAM_D1 (0X2400000), if they are placed in DTCRAM at 0x20000000 on the other hand, the DMA won’t be able to access them. Or the pins are not configured properly.

Since you are using the Nucleo-H723ZG board, you can try this example based on the Mongoose networking library to rule out any other hardware issues and compare the pin setup to yours from the IOC file. It also comes with a much simpler TCP/IP stack and it’s proven to work, so you shouldn’t lose any more time debugging the low-level driver area. To download the project, just open that URL, go to the `Settings` tab, select a directory on your local machine and then click the `Generate C/C++ Code` blue button in the upper right corner of the page.

Visitor
June 30, 2026

Thanks for the suggestion. I have already verified the linker script and memory placement.RX descriptors are placed in .RxDescripSection mapped to RAM_D2 (0x30000000).TX descriptors are placed in .TxDescripSection mapped to RAM_D2.RX pool is placed in .Rx_PoolSection mapped to RAM_D2.The descriptors are not located in DTCM (0x20000000).The ETH GPIO pins were generated by STM32CubeMX for the NUCLEO-H723ZG (RMII mode), and the PHY initializes successfully with link detected.

The remaining issue is that the RX DMA descriptor OWN bit never clears, so HAL_ETH_ReadData() never processes a received frame. Do you know of any H723-specific issue that could cause the DMA to never release the RX descriptors even though PHY initialization and link-up succeed?

 

if you solve this problem already worked in this specific board so can you attach you ethernet working code ??

Graduate
June 30, 2026

You should always check the board’s user manual for the correct pins. The pins generated directly by CubeMX are not always the right ones for your specific board. See the board’s manual (chapter 7.6.7).