2025-01-05 10:50 PM - last edited on 2025-01-06 12:04 AM by SofLit
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:
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 :
//*****************************
Ethernet GPIO Configuration:
//*****************************
MPU Configuration :
//*****************************
LWIP configuration :
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:
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:
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]
2025-01-06 03:07 AM
Hello @Saliwan128
Please, refer to this article to create your application.
2025-01-06 05:07 AM
Hello @Saliwan128 ,
2025-01-17 05:19 AM
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 */
2025-01-17 06:12 AM
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
2025-01-22 03:43 AM
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?
2025-01-22 05:44 AM
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:
Regards