cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 transmit/receive raw IEEE 802.3 ethernet frames

LU
Associate

Hi,

Thanks in advance for your attention.

I'm wondering if any examples are available about transmit and receive raw ethernet frames.
The examples in STM32CubeH5 use the TCP/IP stack NetXDuo and transmit packets built on the upper layers of the stack and pass received packets to the upper layers.

How could I transmit/receive single raw ethernet frames to handle a custom layer 2 protocol?

Comparing with what is done by NetXDuo:

  1. In transmission (as in _nx_driver_hardware_packet_send) I could build the ETH_BufferTypeDef with the next pointer to NULL and send a single buffer?
  2. In reception (as in _nx_driver_hardware_packet_received) in HAL_ETH_ReadData, the HAL_ETH_RxLinkCallback must be implemented to chain all received packets from the Rx Descriptors? Is not possible to receive and process a single ethernet frame? It's confusing to me... And what is the purpose of HAL_ETH_RxAllocateCallback, should it be implemented?
  3. An alternative could be handling a custom layer 2 protocol in NetxDuo? Is it possible?

Thanks,
Best Regards.

Luca

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

Hi Luca,

Examples for STM32H7 and LwIP may be helpful. The latest are here. Also there is a STM32H7 driver in the FreeRTOS+ network stack project here. It is based on older version of the ST driver (which is IIRC in the "legacy" subfolder in the Cube H7 library).

View solution in original post

4 REPLIES 4
Pavel A.
Evangelist III

There are no official basic/raw ethernet examples for the H5 series (yet).

A short answer: it is possible to receive a single frame if the (single) buffer size is big enough. The same with send, if the whole frame is in a single buffer it will be sent at once. But there are reasons to split frames to several buffers.

To understand relation between descriptors and buffers better, unfortunately you have to read the RM :(

 

Hi Pavel A.,

Thanks for your response.
I'll go into more detail with the RM.

Are there any examples available for other series besides the H5? If so they could be a good starting point...

Thanks,
Best Regards.

Luca

Pavel A.
Evangelist III

Hi Luca,

Examples for STM32H7 and LwIP may be helpful. The latest are here. Also there is a STM32H7 driver in the FreeRTOS+ network stack project here. It is based on older version of the ST driver (which is IIRC in the "legacy" subfolder in the Cube H7 library).

Hi Luca,

 

I am testing FreeRTOS+LwIP on STM32H563 Nucleo board.

And I ported FreeRTOS + LwIP for STM32H563 Nucleo board.

Refer to the my GitHub link.

https://github.com/jobaek/H563ZI_LwIP_wRTOS

 

Please find it.