2025-01-05 10:18 PM - edited 2025-01-06 02:24 AM
Hi Team,
I am Using STM32F7 nucleo board, I created project using ST CUBEIDE version 1.16.0.
Note: NOT USING CUBEMX and RTOS
I have taken a ref code for low level eth functions ethernetif.c and lwip.c.
I Enabled Enable DHCP, Http and SSI it is working fine I am able to interact my webpage.
Now I want to work on TCP and ping, I enabled LWIP_ICMP and LWIP_TCP, Disabled DHCP.
But Ping NOT working (timeout err ).
I have taken care of
1.Proper pin assignment.
2.Configuring PHY properly. (as I m able to get Eth cable linkup/down notify).
3.Disable DHCP and activate ICMP.
I have gone thr icmp.c the code flow whenever i ping
-> ethernetif_input-> ethernet_input->icmp_input -- checks type and switch to ICMP_ECHO--> Ip4_outputif()-->ip4_outputif_src-->netif_output-->low_level_output--> HAL_ETH_Transmit
i debuged icmp.c it was not going to 1.icmp_dest_unreach 2.icmp_time_exceeded
I have attached my files,
Please correct me where it goes wrong and reason behinds.
Thank you
2025-01-06 05:46 AM
Hello @lavanya ,
Can you specify the exact STM32F7 MCU reference you are using?
check that you did necessary modifications to the linker script (flash.ld file) to properly place descriptors and RX pool for LWIP insure proper configuration of MPU as well.
you can check this article for more information .
Regards
2025-01-06 09:21 PM
@STea thank you for your response,
I am using STM32F746ZG nucleo board. without freeRTOS (Bare metal),
Note: I am not using CubeMx.
__ALIGN_BEGIN ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __ALIGN_END; __ALIGN_BEGIN ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] __ALIGN_END; __ALIGN_BEGIN uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __ALIGN_END; __ALIGN_BEGIN uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __ALIGN_END;
I have aligned memory for DMA Descriptors. This is working for http.
Now, I enabled ICMP but ping not working.
any guidance on it
2025-01-07 06:57 AM
Hello @lavanya ,
If it is working in you HTTP server it means that your pc recognizes the path to your MCU, and this IP address is available in your PC routing table so I think you should be able to ping it even while the server is running with ICMP enabled.
Regards
2025-01-07 10:12 PM - edited 2025-01-08 02:29 AM
Hello @STea,
I am Not USING CUBEMX.
Middleware library and Drivers taken from Firmware version F7 V1.17.0.
I have Enabled LWIP_HTTPD and call httpd_init();
I Enabled ICMP but Ping NOT WORKING, But Http Working.
Am i missing anything smtg else i should initialize ?
please refer to the files attached in post.
whenever i try to ping it is following these steps in code ..ethernetif_input->ethernet_input->icmp_input->...ip4_output_if->ip4_output_if_src->low_level_output->HAL_ETH_Transmit..
but on cmd promt i m getting Request_timed_out.
without depending on cubemx i want to establish Eth communication. Do i get any step by step guidance on it?
please refer if any.
thank you :)
2025-01-08 05:39 AM
Hello @lavanya ,
i have some questions about the files you attached first of all are you calling the lwip_process() in your main.c while(1) loop for periodic checking for incoming data and why is the default gateway is set to 192.168.0.10 is it really your gateway? are you able to ping it from your pc?
are you using a direct connection to the PC or you are connecting the board throw a switch or a router?
we don't have tutorials Not USING CUBEMX for info, and I don't get why you don't want to use it as it will generate basically the same code you are putting in you lwip.c and it will make it easier and quicker for you to focus on your application development instead of configuration.
there is no apparent problem with CubeF7 Firmware package 1.17 or any hardware related issues so maybe try to check your network configuration and test environment and try to visualize the traffic with a tool like Wireshark when powering the board and pinging it as well it will help you understand what the cause of this issue might be.
Regards