Skip to main content
Explorer II
October 13, 2023
Solved

STM32H5 transmit/receive raw IEEE 802.3 ethernet frames

  • October 13, 2023
  • 2 replies
  • 3806 views

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

    This topic has been closed for replies.
    Best answer by Pavel A.

    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).

    2 replies

    Super User
    October 15, 2023

    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 :(

     

    LUAuthor
    Explorer II
    October 16, 2023

    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

    Graduate
    December 1, 2023

    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.

    Pavel A.Answer
    Super User
    October 16, 2023

    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).