Skip to main content
Senior
January 6, 2025
Question

STM32F7 Ethernet on bare metal without Cubemx

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

 

@STea 

I have attached my files,

Please correct me where it goes wrong and reason behinds.

Thank you 

 

This topic has been closed for replies.

6 replies

ST Employee
January 6, 2025

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

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.
lavanyaAuthor
Senior
January 7, 2025

@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 

 

ST Employee
January 7, 2025

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

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.