This post was last edited by bigbat on 2019-2-22 11:52 After lighting up the LED in the previous article, start testing Ethernet.
The board is provided by ST, Board information This is the part I am more concerned about. At first, I used STM32CubeMX to test the network part, but it didn't work! I will describe this process below. First, after starting STM32CubeMX, the Borad Selector is selected to create the project, and the "ST NUCLEO-H743ZI" board project is specially selected. The first problem after creating the project is that the lwIP option is "gray"! Checking the problem description card, it says: It is because "CORTEX_M7 CPU DCache" is not enabled, so enable it.
After opening it, lwIP can be used as expected. Then use lwIP to set the IP address, find General Settings to turn off IPv4-DHCP, set my IP to 192.168.1.5, mask 255.255.255.0, gateway 192.168.1.1 to confirm it is correct, click Generate,
An error message appears saying: PHY settings are incomplete. I opened the ETH project, but was shocked. There was no PHY option at all. I clearly remembered that the PHY options and initialization were in the ETH tab! Why is it gone? I carefully checked the software prompts and found that it said that the PHY settings are completed by the lwIP part. Oh? I seemed to understand, so I went to the lwIP tab to find it. Sure enough, there was this option in Platform Settings. I selected LAN8742, then set up other projects, generated code, and succeeded.
I quickly compiled and generated it while it was hot, and downloaded it to the development board. Plug in the network cable and "test". Let's ping it first! It's tragic: "Unable to access the target host". The host was not found using arp -a. I continued to look for the cause. But there was very little information. A useful post said that it was necessary to "turn on the Ethernet global interrupt". Then I found the ETH setting card and turned on the setting. I generated the code again and downloaded it to the board, but the problem remained. It still couldn't ping. In other words, there was no such IP. I continued to search online and found that there was a BUG in STM32Cube_FW_H7_V1.3.0! It said that SCB_CleanInvalidateDCache() should be added before the function HAL_ETH_Transmit(). I looked at the code and found this sentence. I was quite puzzled. Later, I thought of using the DHCP function, so I turned on DHCP in the lwIP tab. After the program was executed, I turned on the router to check the DHCP list, but did not find the host "00:80:E1:00:00:00". I checked online and found that this MAC is a legal MAC of ST. I was really depressed, and wondered if the network card was broken. So I checked the lights on the network card and found that the "connection" light was on (green), and after pressing reset, the "data light" flashed (yellow). There should be no problem with the network card. So I started debugging and checked that the PHY initialization could also be executed. I had no clue at all. I went to look for the routines of the development board, but I couldn't find it after searching for a long time. The foreign master said it was in the package en.stm32cubeh7.zip. I opened it and found two projects, NUCLEO-H743ZI and STM32H743I-EVAL. I found \STM32Cube_FW_H7_V1.3.0\Projects\STM32H743ZI-Nucleo\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS, and the project. I opened it to compile, download, and run it. I found the IP from the router and opened the webpage. I found no problem.
Although the ping is different, the webpage is good, and there are pictures in it! It is not important whether it can be pinged, as long as the network is connected. Since there is no problem with the network card, why not? Keep trying to find out what the problem is.
This content is originally created by bigbat, a netizen on the EEWORLD forum. If you need to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source