cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling Ethernet Interface on Nucleo-H743ZI2

HA87
Associate III

Hi,

I am developing a TCP/IP server for my application on the Nucleo-H743ZI2 board. I want to use LWIP with FreeRTOS to allow threading and have a similar syntax to POSIX sockets.

So far I found the following two examples:

(1) This tutorial targets the same CPU family STM32H7 but a different board. https://community.st.com/s/article/How-to-create-project-for-STM32H7-with-Ethernet-and-LwIP-stack-working

(2) An example in STM32 Repository in the following path: STM32Cube_FW_H7_V1.8.0\Projects\NUCLEO-H743ZI\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS

However, this example does not use CubeMX which is extremely important in my case as I use it to manage many interfaces in my project (QSPI, I2C, ADC, etc)

I followed the first example steps and I adapted some stuff based on what I found in the source files of the second example. However, I could not ping the board at all. I attached project files (Test_Ethernet).

Here are the steps that I've done (I attach snapshots at the end):

  1. Created a new project on STM32CubeIDE 1.4.0 using STM32Cube_FW_H7_V1.8.0.
  2. Started configuring the project using the embedded CubeMX in CubeIDE.
  3. I select "No" to "Initialize all peripherals in default mode.
  4. Here is a snapshot of my clock configuration. I configure the clock to 400 MHz. I also set the high-speed clock (HSE) to bypass mode.
  5. Configure the Ethernet interface
    1. Setting the mode to RMII with all the GPIOs maximum output speed set to High.
    2. Enable ethernet global interrupt with preemption priority set to 5.
  6. Configure Cortex-M7. Here I enable ICache and DCache with MPU Contro Mode set to Background Region Privileged accesses only. Then, I set two memory protection units as follows:
  7. Configure FreeRTOS
    1. Enable the FreeRTOS with CMSIS_V1 API.
    2. Increase the size of the default task stack to 256 words.
  8. Configure LwIP as in example (1).
  9. Add DATA_IN_D2_SRAM to macro definitions in the project.
  10. Modify linkerscript as in example (1).

So what am I missing in my steps or configurations?

Thanks

0693W000007CsFWQA0.png0693W000007CsJJQA0.png0693W000007CsIWQA0.png0693W000007CsJxQAK.png

8 REPLIES 8
HA87
Associate III

Any reply or hint from ST support or anyone in the ST community?

We've been stuck with this for quite some time and we tried different settings but it seems STM32CubeMX is still buggy when it comes to the Ethernet interface with some specific boards.

Uttr.1
Associate

I have the same problem with this board. Could anyone help with an Ethernet example created using CubeMx. Thank you.

@Uttr.1​ With which ethernet example?

From my (very limited) experience with Nucleo-H743ZI2, the ST example in Cube H7 package does work (even with the buggy low level driver and other issues mentioned).

If you generate a new project in CubeIDE or CubeMX, it is not expected to work TL;DR

so always do start from these examples, do not change a single bit until it works.

-- pa

@Pavel A.​ I've used that example there and it works. I even added TCP echo functionality and it also works but as I mentioned above my main issue with this example it is not based on CubeMX. I would like to have CubeMX since in my project I've to handle many interfaces and it is very convenient to do that with CubeMX.

@Piranha​ Thanks for sharing. I've seen your threads before. It is a bit annoying that we've to dig into low-level stuff and deviate from just focusing on application development on these MCUs.

@HA87​ 

> I've used that example there and it works.

Very good. Now you are ready to the next step: carefully merge the working example with code generated by CubeMX/IDE.

Start from almost empty Cube generated project where only the clocks are configured as they should be.

Merge the ETH initialization into this. Test that it still work.

Then add other interfaces.

This unfortunately is easier to do than explain. Some experience with Cube would be helpful.

-- pa

@Pavel A.​ I did not do your approach but I did something different. So after following the CubeMX example I started looking into differences between source files in my freshly generated project and the working example. I manually modified all the parts related to the Ethernet interface and the configuration used for MPU. Unfortunately so far no success. The reason is both LWIP and FreeRTOS files generated by CubeMX look a bit different from the ones used in the working example. So I might have missed something there.

I will try your approach with a complete project and then manually patch it with an Ethernet definition.