cancel
Showing results for 
Search instead for 
Did you mean: 

H723-Ethernet_LWIP Ping problem

Saliwan128
Associate

Hello ST Community,

I am currently working with the Nucleo H723ZG board and facing issues establishing a ping response using the LWIP stack. Despite following various examples and configurations, I have been unable to get it to respond to pings. Here are the details of my setup:

  • Development Environment: STM32CubeIDE V1.17  and STM32CubeMX V6.13.0
  • Configuration:
    • I have not used RTOS.
    • I configured the Ethernet settings according to package examples.
    • :C:\....\STM32Cube\Repository\STM32Cube_FW_H7_V1.12.1\Projects\NUCLEO-H723ZG\Applications\LwIP\LwIP_UDP_Echo_Server
    • I ensured that the Ethernet cable was connected properly and used a direct connection to my pc.

I have tried multiple versions of the H7 package ( 1.12.1 - 1.12.0 - 1.11.1 - 1.11.0 - 1.10.0 ) and tested various configurations without success. The ping command consistently results in "destination host unreachable."Could anyone provide insights or suggestions on what might be missing or misconfigured?

//*****************************

My  Ethernet configuration :

eth_config.png

//***************************** 

Ethernet GPIO Configuration:

eth_GPIO_config.png

//*****************************

MPU Configuration :

mpu_config.png

//*****************************

 LWIP configuration :

lwip1.png

lwip2.png

lwip3.png

lwip4.png

  I added this part to the STM32H723ZGTX_FLASH.ld file:

//************************************************************************************  

..........

. = ALIGN(8);

} >RAM_D1

 

 

.lwip_sec (NOLOAD) : {

. = ABSOLUTE(0x30000000);

*(.RxDecripSection)

 

. = ABSOLUTE(0x30000080);

*(.TxDecripSection)

 

. = ABSOLUTE(0x30000100);

*(.Rx_PoolSection)

} >RAM_D2 AT> FLASH

 

 

/* Remove information from the standard libraries */

/DISCARD/ :

//**********************************************************

and its result is like  this:

build_result.png

My main.c code:

//**********************************************************

/* USER CODE BEGIN PV */

extern struct netif gnetif;

/* USER CODE END PV */

++++++++++++++++++++++++++++++++++++++++++++++++++++

in int main(void)

 

 

while (1)

{

/* USER CODE END WHILE */

 

/* USER CODE BEGIN 3 */

ethernetif_input(&gnetif);

sys_check_timeouts();

}

//**********************************************************

ressult:

cmd.png

My CPU clock is 520Mhz. I am sure the hardware has no problem because I can give a ping from the st package example.

But when I configure according that example it does not work.

.Thank you for your assistance!Best regards,
[Your Name]

6 REPLIES 6
Saket_Om
ST Employee

Hello @Saliwan128 

Please, refer to this article to create your application.

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar
STea
ST Employee

Hello @Saliwan128 ,

I don't see any apparent issue with your configuration. I did a similar project with your configuration and I'm able to ping the board. you can find it attached below.
just a heads up you can maybe turn off and on the wired connection on your pc to make it works properly and also you can visualize ARP traffic where the board announces its IP address via Wireshark.
Regards 
In order 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.
KKonn.1
Associate II

Hi!
 I was experiecing a little similar issues, when trying to change an old project (STM32CubeMX version 6.4.0 & STM32Cube FW_H7 version 1.9.1).

 I tried the ping_test_h723.zip, but it didn't have all the configurations? E.g. MPU was missing?

Anyways, reading this post and once again checking the configurations, I was able to create (from scratch) a working configuration. The differences to the original post were:

1) Cortex_M7-> MPU Region 2 -> MPU TEX field level: level 1
2) LWIP->Key Options-> Heap and Mem..->MEM_SIZE=1600
3) LWIP->General Setting -> GATEWAY_ADDRESS: 192.168.000.001
4) Eth->Parameter Settings -> Rx Buffers Address: 0x30000200
5) STM32H723ZGTX_FLASH.ld:
 . = ABSOLUTE(0x30000200);
*(.Rx_PoolSection)
6) In main.c, I am using
while (1)
{
/* USER CODE END WHILE */

/* USER CODE BEGIN 3 */
MX_LWIP_Process();
}
/* USER CODE END 3 */

Attached is also the working H723ZG-Eth-test-no-rtos.ioc file. To create a working project from that you need to:
1) Modify STM32H723ZGTX_FLASH.ld:

/* MODIFICATION START */
/* Add lwip related changes */
.lwip_sec (NOLOAD) : {
. = ABSOLUTE(0x30000000);
*(.RxDecripSection)

. = ABSOLUTE(0x30000080);
*(.TxDecripSection)

. = ABSOLUTE(0x30000200);
*(.Rx_PoolSection)
} >RAM_D2 AT> FLASH
/* MODIFICATION END */

/* Remove information from the standard libraries */
/DISCARD/ :


2) Modify main.c:

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
	  MX_LWIP_Process();
  }
  /* USER CODE END 3 */

 

Hello @KKonn.1 ,

The example shared in the previous post is not a complete example, but it does what is name say it is a ping example, and it is working with latest versions of CubeIDE 1.17 and CubeMX 6.13 no need to add any other code or configuration for the ping to work. I'm able to ping the H723 with this example with a direct connection to my pc.

If it doesn't work for you, it is most probably a network related issue and not related to the project itself, please retry with the shared example and share with us if you are able to ping your board with it.


Regards

In order 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.
KKonn.1
Associate II

Hello @STea !
 Yes, this was my mistake. I opened the .ioc file to check which address to ping, and there was 192.168.1.9 and tried that. The code was not generated from the .ioc file, since there the address was 192.168.1.15 (and also MPU config missing). Using correct address I was able to ping it.

 I still have another question about the generated code lwip.c:
In line 93, there generated code has:

 

 

  /* We must always bring the network interface up connection or not... */
  netif_set_up(&gnetif);

 

Whereas when I have generated code with older version (STM32CubeMX version 6.4.0 & STM32Cube FW_H7 version 1.9.1), there is :

 

 

  if (netif_is_link_up(&gnetif))
  {
    /* When the netif is fully configured this function must be called */
    netif_set_up(&gnetif);
  }
  else
  {
    /* When the netif link is down this function must be called */
    netif_set_down(&gnetif);
  }

 

Why this has changed? I want to show the ethernet status when the device boots up, and thus add (to line 100) this:

 

/* USER CODE BEGIN 3 */
  ethernet_link_status_updated(&gnetif);
/* USER CODE END 3 */

 

 

 

But after this addition, the netif_is_up(netif) in ethernet_link_status_updated shows always that the netif is up, event though the cable is not connected. Or is there another place, where I should check if the netif is up?

Hello @KKonn.1 ,

if you want to check the status of the link you should right your own user code in the dedicated user code begin 5 and user code begin 6 areas in lwip.c  ethernet_link_status_updated function definition:

STea_0-1737553439475.png

Regards

In order 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.