how to program MAC address in FRDMK64.(for ethernet)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to program MAC address in FRDMK64.(for ethernet)

1,025 Views
sudhakarp
Contributor V

Hi,

i am using FRDMK64f120 controller, KDS 2.0 and ksdk 1.1.0.

i want to program MAC address to kinetis K64 controller. i know development board coming with MAC address.

but for our development(our hardware design) how to program MAC address.just give some idea.

we dont need to program MAC adress every time. only one time for new board .like bootloader code we are loading only one time like that.

is any perticular location available for writing MAC ADDRESS. if yes how to do? or give some other option.

while programming through P&E multi link is any possible to write Mac address.

thanks and regards,

sudhakar p

Labels (1)
0 Kudos
4 Replies

598 Views
soledad
NXP Employee
NXP Employee

Hello,

Please check the below example code, you can find more information in the Freescale MQX™ RTOS RTCS User's Guide. This document is located at the path: C:\Freescale\KSDK_1.2.0\doc\tcpip\mqx_rtcs

#define ENET_IPADDR IPADDR(192,168,1,4)

#define ENET_IPMASK IPADDR(255,255,255,0)

#define ENET_IPGATEWAY IPADDR(192,168,1,1)

uint32_t setup_network(void)

{

uint32_t error;

_enet_address enet_address;

error = RTCS_create();

if (error) return error;

ENET_get_mac_address (BSP_DEFAULT_ENET_DEVICE, ENET_IPADDR, enet_address);

error = ipcfg_init_device(BSP_DEFAULT_ENET_DEVICE, enet_address);

if (error) return error;

error = ipcfg_bind_boot(BSP_DEFAULT_ENET_DEVICE);

if (error) return error;

TFTTIP = ipcfg_get_tftp_serveraddress(BSP_DEFAULT_ENET_DEVICE);

TFTPserver = ipcfg_get_tftp_servername(BSP_DEFAULT_ENET_DEVICE);

TFTPfile


Have a great day,

Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

598 Views
sudhakarp
Contributor V

hi,

     if i did like that every board i want to change my application code. without changing application code is any other way available for MAC Address writing into flash at perticular address. so i can use same firmware for different custom board. i mean is any way to program through code dumping itself.

and also when i use "ENET_get_mac_address" or "SET_mac "actually which address its storing MAC address . actually i need exact

address location can you tell exact address.

thanks and regards,

sudhakar p

0 Kudos

598 Views
soledad
NXP Employee
NXP Employee

Hello,

The MAC address is not shipped with the board. You must get MAC address set with IEEE. Then you can flash a MAC address of the rage you purchased in your device.

For this you need a TCP/IP stack and Freescale provide MQX with RTCS

For example, using MQX4.2 you can find many RTCS examples, httpsrv is one. After instal MQX4.2 you can find it at the path 

C:\Freescale\Freescale_MQX_4_2\rtcs\examples\httpsrv

Once you run this example you can see a web server on address 192.168.1.202

Have a nice day!

Sol

598 Views
drummer
Contributor IV

I have a program that injects a serial number into each production unit through a custom protocol.

I use the upper flash area of the chip to store the data. I call it flash_data. each unit is therefore unique.

We have reserved a block of mac addresses for our units. 

ENET_get_mac_address (IPCFG_default_enet_device,

      flash_data. serial_number,

       IPCFG_default_enet_address);

0 Kudos