cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an example of using the stm32f7xx_hal_eth driver to send raw ethernet frames without using lwip ?

khaaal
Associate II

Hello community,

Can someone please provide me with an example of using the stm32f7xx_hal_eth driver to send raw ethernet frames without using lwip ?

I am trying to send raw ethernet frames with an STM32F746G-Disco but can't figure out what APIs to use. Like where to construct the ethernet frame header and specify mac adresses etc..

If someone has an example or an insight on the APIs to use can you please provide it.

Thanks

1 REPLY 1
Piranha
Chief II

As said in earlier topic, ethernetif.c file is an example of how to use ETH peripheral. And here is an additional example:

https://github.com/lsgunth/lwip_contrib/tree/master/ports/stm32f2x7/netif

https://en.wikipedia.org/wiki/Ethernet_frame

Ethernet frames are very simple. Typical header has destination/source MAC addresses and Ethertype field. It's only 2*6+2 = 14 bytes, that's it! There is no API for it in a drivers, because usage of these fields depends on higher layers. The trailing CRC will be added by ETH peripheral itself, if You don't disable it in transmit descriptor, and CRC of received frames can be stripped by hardware, if ETH_MACCR bit CSTF is set.