Skip to main content
Riscy
Associate III
November 20, 2022
Question

Ethernet with Nucleo-144 STM32F746GZ did not work with STM32CubeIDE 1.10.1 and STM32F7 library 1.70.1. The CubeMX is 6.6.1.2.

  • November 20, 2022
  • 16 replies
  • 5871 views

The Nucleo-144 F746GZ board worked fine with legacy Ethernet FW from System Workspace (as well as demo FW from System Workspace). I have added PG12 for Phy Reset however I am unable to get ethernet up via a twisted ethernet connection to the laptop. I was able to ping via legacy FW but not the Cube FW which I'm working on. I have Wireshark which APR broadcast did not occur with IP:192.168.41.7 / SN: 255.255.255.0 / DA:192.168.41.2. I have tried for many days and could not get it working.

I currently using STM32CubeIDE 1.10.1 and STM32F7 library 1.70.1. The CubeMX is 6.6.1.2. I'm familiar with Ethernet HAL Driver upgrade.

Attached.

Please help.

This topic has been closed for replies.

16 replies

Piranha
Principal III
November 20, 2022

> STM32Cube 1.10.1 and STM32F7 library 1.70.1. The CubeMX is 6.6.1.2

STM32Cube what? You mean CubeIDE! And then those version numbers for the other two products... You should check your vision.

Anyway, ST's Ethernet/lwIP code has never worked fine:

https://community.st.com/s/question/0D50X0000BOtfhnSQB/how-to-make-ethernet-and-lwip-working-on-stm32

And with the driver rework for F4 and F7 they managed to make it somewhat worse:

https://community.st.com/s/question/0D53W00001VYkb5SAD/stm32f417-lwip-udp-packets-are-being-truncated

Riscy
RiscyAuthor
Associate III
November 20, 2022

Thank you for the reply Piranha, but I already read them all and it looks like there are still many issues to resolve despite reworks on the ETH driver. Out of frustration, I forget to add IDE after STMCube, my deepest apologies. .It seems to be lacking ethernet build guideline documentation and UM1713 seems to be out of date. What bothers me there is no actual demo/example code package coming within Library STM32F7 and alike, generated by actual CubeMX files (and work around if any) as a reference base to get confidence. I like to stress CubeMX is a good ecosystem for simple peripherals, but unsure about the Ethernet side.

Riscy
RiscyAuthor
Associate III
November 20, 2022

I'm considering ordering Nucleo-144 H723 to give it a try, is this worth a venture?

LCE
Principal II
November 22, 2022

For what?

In my opinion the Nucleo boards are very good for getting to know the controller, for starting developments.

Here in Europe these boards are around 25€ ... couldn't be any lower.

Riscy
RiscyAuthor
Associate III
November 22, 2022

Yes, I just have the H74x Nucleo board. I'm giving a crack at it later on. They are useful boards to experiment with many things. However, I am more interested in F7.

Andrei Chichak
Lead
November 21, 2022

Last week I managed to get LwIP 2.1.3 running on an STM32F767. There are a bunch of issues with the ST sample code for the F7, actually for anything other than the H7s.

The setup of the MPU in the examples is just plain wrong. The proper start address should be 0x2007C000 for 16k and 0x2007C000 for 512 bytes, get rid of the setup for 4G at 0x0. The descriptors should be placed at 0x2007C000 and 0x2007C0A0. The RX buffer should be placed at 0x2007C200.

The RX buffer needs to be between 4 and 8 structs long, according to the comments, it is 12 and will not fit in any 16kB region (since it is 19kB in the examples). By reducing the size to 8, it comes out to 12kB and will fit into the non-cached, non-buffered region set up with the MPU.

The top of stack should be relocated BELOW 0x2007C000 or else stack growth will smash into the buffers and descriptors. They are descriptors, not decryptors.

LwIP is...LwIP. The documentation is hard to read because the code was hard to write. There are few to no examples, well there are the unit tests, and the same 2 ST examples (HTTP and echo). If you have problems with LwIP, the various forums will give you a timeout before an answer. Perhaps nobody, even in the developer group, actually uses LwIP. The only sample code you'll find is reposts of the older distributions. The LwIP people seem to not like RTOS', so unless you're banging chunks of silicon together, you're on your own.

So, it does work, but it's going to be a rough ride.

LCE
Principal II
November 22, 2022

> So, it does work, but it's going to be a rough ride.

Perfect summary!

The linker file...

exactly my latest problem with F7 ethernet.

Although I edited that file a lot, changing areas / space for the descriptors, I always forgot about the stack.

So, the problems are more on the STM32 HAL side.

Forget the ethernet driver.

Pavel A.
November 22, 2022

The MPU setup is a headache. Requirements for alignment vs size are hard to manage and link script does not help with this. They say, it gets much better in the new CM85.

Riscy
RiscyAuthor
Associate III
December 11, 2022

STM32Cube_IDE Version: 1.11.0

STM32 CubeMX: Version 6.7.0-RC2 

After downloading the updated version and having another go with the STM32F746 Eval board and ethernet finally worked correctly. I have implemented UDP Server and successfully echo short and long messages. Good work!!.

I was attempting to implement the DHCP protocol via CubeMX, but it did not work. I'm open to suggestions. Is there additional code to be implemented?

What the best way to do performance testing under UDP and TCP?

MSG_ST
ST Employee
February 6, 2023

Hi @Community member​ ,

I'm glad to hear that your initial problem was resolved after downloading updated tools versions.

For DHCP implementation there's some modifications on generated code that should be taken into consideration :

  • Placement of the RX_POOL buffers via #pragma location
  • Relocate the LwIP RAM heap pointer on the lwipopts.h file

Also ensure that LwIP parameters are well sized.

You could refer to the readme available here for LwIP configuration.

If you don't have to work with LwIP and FreeRTOS, there's various TCP/IP applications with NetXDuo and ThreadX available (links below) and maintained through regular maintenance releases :

TCP application, UDP application , iPerf application are developed under STM32F767ZIxx and can be easily tailored to any other supported device and development board.

I hope my answer helps.

Regards

Mahdy