2018-07-03 08:56 AM
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 #stm32hSolved! Go to Solution.
2018-07-04 07:55 AM
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.
2018-07-03 09:39 AM
If you aren't using RTOS, you need to constantly poll the interface for activity
2018-07-04 04:50 AM
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.
2018-07-04 07:55 AM
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.
2018-07-04 08:21 AM
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
2018-07-04 10:52 AM
Dear Imen D
Can stm32cubemx team give a sample ioc file, which can correctly generate the lwip project in nucleo-h743zi board. Thanks.
2018-07-04 06:54 PM
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.
2018-10-29 01:51 AM
Would someone be so kind to provide a full working example, It is not working for me.
2018-10-29 08:03 AM
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...
2018-10-29 08:03 AM
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...