cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Ethernet MAC w/wo lwIP how to use ?

Posted on August 23, 2017 at 16:12

Hello everyone,

I try to start with the Ethernet Features of the STM32F746G-Disco / STM32F746ZGT-Nucleo-144 and I have Problems getting started and use it correctly. I found UM1713, AN3966 and of course the HAL Drivers Manual UM1725. For raw Ethernet packages, i am missing informatinos/functions how to prepare my data to use

HAL_ETH_TransmitFrame (

&heth

, (uint32_t)1500); or the receive Counterpart.

With lwIP enabled in CubeMX, I noticed that the initialisation of the Ethernet Hardware is not structured  the same as in raw Ethernet use. I want to use UDP / TCP data Exchange between 2 STM32 Boards first, but I was not able to find some examples how to start after creating the CubeMX Project. In the STM32Cube_FW_F7_V1.7.0 repositorys are only examples for Server applications on the STM32. Can somebody give me a hint or example?

Best regards,

Markus.

2 REPLIES 2
Posted on August 25, 2017 at 11:28

I did some further research and noticed that all Boards like Nucleo-144, Disco and EVAL Boards which include an Ethernet Port do not have an Ethernet Support in their BSP package. Also all AppNotes for Ethernet and lwIP with STM32 i found are some Kind of outdated (several years old). This rises my question, is the use of Ethernet under some Kind of NDA ? With the actual Hype of IoT, this is some kind of odd or I am missing something very obvious ?

With my STM32F746G-Disco, the best Option to get a working example of the Ethernet port is the ..\STM32Cube_FW_F7_V1.7.0\Projects\STM32746G-Discovery\Demonstration with VNC, but this is a full blown Project and really hard to understand as a starting Point for just using Ethernet Frames or lwIP with UDP/TCP connections.

With my Nucleo-144 STM32F746ZG, i noticed during creation of a new CubeMX Project that the missing HS quartz might be an Problem to use Ethernet correctly. It seems odd to me to add the Ethernet PHY, Magnetics and RJ45 connector on board but saving the quartz and preventing to get at least 25 MHz to the Ethernet MAC without a warning of CubeMX in the Clock section.

Can provide ST some up to date Information to me to use Ethernet +lwIP with STM32/CubeMX so i do not Need to reinvent the wheel ?

Best regards,

Markus.

________________

Attachments :

Nucleo-144_HS_CLK.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyTm&d=%2Fa%2F0X0000000b8M%2F_kk8YWqc_otV_2gmcykOWy6Hl7tqIemKVNX46BSR9.w&asPdf=false
Posted on August 29, 2017 at 14:46

So i started to reinvent the wheel and my first steps as a detection dog was successful. I recover the first information bits to my path to success enabling MAC and PHY.

The Nucleo-144 Board uses the MCO Output from the ST-Link to get a HS clock. Enabled it in CubeMX, no clock Errors anymore. If i break off the ST-Link, I Need to add the quartz to the Board.

In an other thread n this Forum was mentioned that the PHY address is 0 , not 1 like preconfigured in CubeMX. With the knowledge of the bootstrap Options in the schematics, this makes sense and explains why a configuration of the PHY is not nessesary done in Software. To use the advanced Features of the PHY, some extra code must be written.

I propose to change the default value of the PHY address in the CubeMX Settings and to add some bootstrap informations in the schematics of the boards.

The bootstrap options of the LAN8742A of the STM32F746ZG Nucleo-144 and the STM32F746G-Disco are the same, so code sharing will be easy.

I sense more Information bits to discover, but still hope there is a helpful Hand.

Best regards,

Markus.