Skip to main content
Yi Zhou
Associate II
July 3, 2018
Solved

Why STM32Cube_FW_H7_V1.2.0 ethernet sample code not run in nucleo-h743zi board

  • July 3, 2018
  • 14 replies
  • 3613 views
Posted on July 03, 2018 at 17:56

Hi all:

    STM32Cube_FW_H7_V1.2.0 ethernet sample is using DHCP, I want use static IP address. So I change the DHCP definition to 0 in lwipopts.h.

&sharpdefine LWIP_DHCP               0

    After comple the code and download to board, but I can not ping to board. What is wrong?

    Thanks.

#stm32h7-ethernet #stm32h
This topic has been closed for replies.
Best answer by Yi Zhou
Posted on July 04, 2018 at 16:55

Dear all:

    I found

STM32Cube_FW_H7_V1.1.0 lwip sample(LwIP_HTTP_Server_Netconn_RTOS) can run correctly in the board. So after compare the different between this two project, I finally find 

STM32Cube_FW_H7_V1.2.0 lwip sample code bug.

    In ethernetif.c function low_level_output(), you MUST add the following code (bold font)

/* Clean and Invalidate data cache */

SCB_CleanInvalidateDCache();

HAL_ETH_Transmit(&EthHandle, &TxConfig, 0);

then sample can run correctly in the board.

    You can see the detail in the following picture.

0690X0000060LcXQAU.png

14 replies

martonmiklos
Senior
October 29, 2018

I have been debugging the mentioned topic for 4 days.

When I have considered the CubeMX generated code is out of luck I moved to thex example shipped with the STM32H7 pack of the cube:

LwIP_HTTP_Server_Netconn_RTOS

It took me a while to get it compiled under Atollic, and then I have realized that the board receieves packets, responds to ARP queries, but does not sends ICMP ACKs.

By further debugging it turned out that sometimes it ACKs the pings, but most of the times it just relies the ping ICMP packet with the same source/dest address as it recieves from the host.

First i thought that it is this LwIP bug, but it turned out to be different:

https://savannah.nongnu.org/bugs/?func=detailitem&item_id=54669

After reading through this:

https://community.st.com/s/article/FAQ-Ethernet-not-working-on-STM32H7x3

I have realized that the MPU config in the example differs from the attached one.

After using the config from the FAQ the ping requests working just fine...

It took me 4 days to figure this out...

MX_Master
Associate
January 3, 2019

Hi, I made a new example project using STM32Cube_FW_H7_V1.3.0. You can find it here

https://github.com/MX-Master/STM32H7_Nucleo-H743ZI_Ethernet_LwIP

This project uses LwIP stack without RTOS. There is a HTTPD (web server) example too.

Configuration info can be found in the README.

martonmiklos
Senior
January 3, 2019

Many thanks for putting together this repo!

I have missed the settings of the GPIO slew rates!