Skip to main content
Abhishek Anand
Associate II
Jun 6, 2018 8:00 PM UTC
Question

Ethernet Packet Broadcast using just MAC address

Posted on June 06, 2018 at 22:00

Hello Everyone, I need do a MAC address broadcast of  an ethernet data packet to a network by using the destination address as ff:ff:ff:ff:ff:ff . I don't want to an assign an ip to my devkit. Just want to do a layer 2 broadcast. I'm using STM32F207ZG. Which API's should i use for this and how can i do this? Thanks 

    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    Jun 6, 2018 8:30 PM UTC
    Posted on June 06, 2018 at 22:30

      HAL_ETH_TransmitFrame(&EthHandle, framelength); ??

    STM32Cube_FW_F4_V1.21.0\Projects\STM324xG_EVAL\Applications\LwIP\LwIP_IAP\Src\ethernetif.c

    Look at the F4 examples, basically an F2 with a CM4F rather than a CM3, *very* similar. I can build CM3 code that runs on both platforms and selects clock speeds dynamically (ie 120 MHz vs 168 MHz, AHB/APB), not super complicated, and the F4 gets more attention and code examples.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Abhishek Anand
    Associate II
    Jun 6, 2018 11:10 PM UTC
    Posted on June 06, 2018 at 23:10

    Hey Clive,

    Thank You very much for your help but I guess LwIP middleware is used if you're trying to include aTCP/IP stack to work with TCP/IP protocols, I just want to keep it till data link layer. Correct me if i'm wrong i'm new to this? But what i'm trying to do is to send an ethernet packet just using the mac address assigned to mydevkit and flood all the other devices on the network using destination address ff:ff:ff:ff:ff:ff and check it on wireshark whether is detects my ethernet packet. I don't want to assign any ip address to my board i want to transfer ethernet packet just by the mac address(Mac address broadcast). Do i need to include LwIP or anykind of middleware for this? 

    Tesla DeLorean
    Guru
    Jun 7, 2018 12:25 AM UTC
    Posted on June 07, 2018 at 00:25

    I was citing code that used the raw frame interface. Strip out the stuff you don't want. Grep the source trees for other examples if you need them.

    Here the HAL library itself for the F4, will be equivalent for F2

    STM32Cube_FW_F4_V1.19.0\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_eth.c

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..