cancel
Showing results for 
Search instead for 
Did you mean: 

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

Yi Zhou
Associate III
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
1 ACCEPTED SOLUTION

Accepted Solutions
Yi Zhou
Associate III
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

View solution in original post

14 REPLIES 14
john doe
Lead
Posted on July 03, 2018 at 18:39

If you aren't using RTOS, you need to constantly poll the interface for activity

Yi Zhou
Associate III
Posted on July 04, 2018 at 13:50

I only disable DHCP future and set the correct static ip address. RTOS is actived. Nothing else changed. But the sample code can not work correctly.

Yi Zhou
Associate III
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
Imen.D
ST Employee
Posted on July 04, 2018 at 17:21

Hello,

You are right. This problem is reproduced with STM32CubeH7 V1.2.0, and not with previous versions as the cleaning/invalidating the cache manner has changed starting from V1.2.0.

So, adding a call of SCB_CleanInvalidateDCache() in low_level_output() function (as done in version V1.1.0 nor V1.0.0) resolves the issue. This call is removed in Version 1.2.0.

Our development tool team is aware about this issue and should fix this limitation in the coming release.

Thank you for reporting us the issue and we apologize for any inconvenience this may have caused you.

With Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on July 04, 2018 at 17:52

Dear Imen D

     Can stm32cubemx team give a sample ioc file, which can correctly generate the lwip project in nucleo-h743zi board. Thanks.

GreenGuy
Lead
Posted on July 05, 2018 at 03:54

Dear Imen D,

It would be sweet if they could fix this for FatFs with DMA code generation from CubeMX in the next release of STM32H7 as well.

Pretty Please.

JReim
Associate II

Would someone be so kind to provide a full working example, It is not working for me.

martonmiklos
Senior

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

martonmiklos
Senior

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