cancel
Showing results for 
Search instead for 
Did you mean: 

How to get started with ethernet with Nucleo-F767ZI using STM32CubeMX?

MBlanco
Associate II

Hello,

I'm new to using this ecosystem and I'm having trouble finding resources on how to get my ethernet working so that I can connect to AWS IoT. I'm not really sure what is platform specific or not in some the examples I found so I was wondering if there was a easy place to find this information.

1 ACCEPTED SOLUTION

Accepted Solutions
Amel NASRI
ST Employee

Hi @MBlanco​ ,

This article describes How to create project for STM32H7 with Ethernet and LwIP stack working.

I assume that the same steps can be applied for STM32F7. I suggest that you follow these steps and keep me informed if my proposal was helpful for you or not.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

9 REPLIES 9

It's going to be rough.

CubeIDE comes with support for LwIP as the tcp/ip stack. It doesn't look like LwIP has gotten updates since 2018. Is it stable or abandoned? It's hard to tell one way or the other (other then complaints from people that have used it before).

LwIP has two modes of use, with an RTOS and without. ST hooked LwIP in with FreeRTOS and there are a few simple samples to pull from.

The F and H 7 processors have fun issues(?) when doing DMA with the ethernet controller. You should run into multiple discussions on this forum regarding caching of the rx and tx buffers and descriptors. Look at the LwIP_HTTP_Server_Netconn_RTOS example (currently broken for that processor) in the .ld file. There are 4 extra memory regions defined. Elsewhere in the code there are the buffers and descriptors that get pushed into these regions, and the memory management unit is used to set the caching appropriately. The memory calculations aren't quite done right, but it's close enough for hobby stuff.

If you generate a program basis using CubeMX and choose a 767ZI processor, ethernet, LwIP, FreeRTOS, set your timer to 6, and choose all of the correct basic options, you still need to munge the .ld file, push the buffers and descriptors into the sections, and set up the MMU. That is not done for you in a generated project.

If you find other working examples, let everybody know. The LwIP documentation is mostly about how LwIP works internally, how to set up your tools to develop LwIP, and how to update the internal documentation. Apparently LwIP has no users, just developers. I think that is where FreeRTOS and their TCP/IP stack may be better, they assume that someone may actually have to use the code at some point, not just generate pull requests.

FreeRTOS has their own tcp/ip stack, I'm not sure what that says about their feelings about LwIP.

UM1713 gives an okay overview, but the interface to LwIP that comes with Cube has diverged and the user manual really only gives a hand waving overview now.

So would it be easier using a different framework if I need internet connectivity?

Can't say. I'm having a hell of a time understanding what is on offer. ST's version of LwIP seems to date to a commit on July 3, 2018. There have been a lot of updates since.

Amel NASRI
ST Employee

Hi @MBlanco​ ,

This article describes How to create project for STM32H7 with Ethernet and LwIP stack working.

I assume that the same steps can be applied for STM32F7. I suggest that you follow these steps and keep me informed if my proposal was helpful for you or not.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Yes, this worked for me, I was able to ping my UDP server.

The "stable" and "abandoned" aren't quite the opposite terms... Anyway, the development of lwIP is active, they just have not made the release recently. And, while the documentation could be much improved, the 95% of complains come from people, who do not read even the existing documentation. Like the STM32 HAL team, for example... But, when used properly, lwIP is very reliable and performing.

As for FreeRTOS TCP/IP stack - is't probably OK, but it should be noted that it's not as powerful and flexible as lwIP is.

Pajdoom
Associate II

Any progress? Is there a tutorial on how to connect Ethernet to NUCLEO-F767ZI and CubeIDE1.11.2? Not another, not similar, but exactly on NUCLEO-F767ZI.