cancel
Showing results for 
Search instead for 
Did you mean: 

how to find the MAC adress of F407 ?

mehmet.karakaya
Associate III
Posted on December 27, 2012 at 14:25

hello forum,

I am trying to send and receive UDP packets from my F407 to PC

however as shown below I need to know MAC adress of my F407

struct

eth_header

 {

 //

ether

frame

uint8_t

ether_src

[6]; ...............

memcpy

(frame->

ether_src

, &mymac, 6); in this line I need to have a valid MAC adress in mymac

my question how can I know the MAC adress of my F407 ?

thank you

#mac-uip #mac
5 REPLIES 5
trevor23
Associate III
Posted on December 27, 2012 at 14:49

The SMT32 does not have one, you have to assign one. You're supposed to purchase a range of MAC addresses for your own use, if you don't already own some. For development you could just pick one and hope it does not conflict with other devices on the same network (be careful where you use it). See this link for MAC address ranges.

http://standards.ieee.org/develop/regauth/oui/oui.txt

If you do pick one go for one from the private ranges. NOTE: This is at your own risk and I don't take any responsibility for you not purchasing a MAC address (The ones I use have been purchased).
mehmet.karakaya
Associate III
Posted on December 27, 2012 at 15:13

thank you ,

I am trying to send UDP packets to PC using uIP stack

and this F407 will only comunicate with a PC in the LAN ( not internet )

If I fill the ethernet frame

memcpy

(frame->

ether_src

, &mymac, 6);

 with a dummy MAC adress like mymac ={0x00, 0x10, 0x20, 0x30, 0x40, 0x50}

 

 

does uIP ''know'' about my MAC adressing ?

 

or how can I tell uIP about my MAC adress ? with a dummy MAC adress like mymac ={0x00, 0x10, 0x20, 0x30, 0x40, 0x50}does uIP ''know'' about my MAC adressing ?or how can I tell uIP about my MAC adress ?
Posted on December 27, 2012 at 20:53

I don't know.

ST's library uses this function to program the controller with a MAC address for it to recognize on the wire.

  /* initialize MAC address in ethernet MAC */

  ETH_MACAddressConfig(ETH_MAC_Address0, netif->hwaddr);

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
dandan9
Associate II
Posted on December 27, 2012 at 22:15

I've done my fair share of low level Ethernet packet handling in previous lives so perhaps some more basic information is in order here. At the PHY layer packets move around on Ethernet based on a six byte unique MAC address. When an IP stack connects to an Ethernet transport it uses ARP to try and figure out where to route packets, as the ARP table contains aged pairs of MAC and IP addresses.

As Trevor mentioned most companies developing commodity Ethernet interfaces purchase a block of MAC IDs and then assign them uniquely. This allows a customer to connect his interface to any network in the world without ambiguity.

But as a practical matter for what you are trying to do, you should just make one up and use it. Take the MAC ID from your PC and swap the two high order bytes. If you attach more F407s to your development network to exchange data over UDP just make sure the lower four bytes of all MAC IDs are unique (just like you'll assign IP addresses).

Dan

amin23
Associate II
Posted on December 28, 2012 at 09:43

Normally the MAC address is defined in main.h, you can inspire from the following example based on LwIP;

Firmware LwIP TCP/IP stack demonstration for STM32F4x7 microcontrollers: http://www.st.com/internet/mcu/product/252136.jsp

Application Note AN3966: http://www.st.com/internet/mcu/product/252136.jsp