Error Report: Module Lan9218.c, function Lan_SetMacAddress

Discussion created by gpetrowitsch on Feb 16, 2010
Latest reply on Feb 19, 2010 by CraigG

Hi all,


just in case anyone has problems with this:

I found an error in the Module Lan9218.c stored at

  c:\Program Files\Analog Devices\VisualDSP 5.0\Blackfin\lib\src\drivers\ethernet\lan9218\

and which is used e.g. on the EZ-Kit for the BF548 to demonstrate the LwIP.


For function Lan_SetMacAddress, we find this code:


void Lan_SetMacAddress(unsigned char *mac_addr)
  unsigned int dwHigh16;
  unsigned int dwLow32;
  dwLow32 = ( (mac_addr[3]<<24) | (mac_addr[2]<<16) |(mac_addr[1]<<8) | mac_addr[0] );
  dwHigh16 = ( (mac_addr[6]<<8) | mac_addr[5] );

  // set MAC addr
  Lan_SetMacRegDW(g_pLAN9221, ADDRH, dwHigh16);
  Lan_SetMacRegDW(g_pLAN9221, ADDRL, dwLow32);


The assignment to dwHigh16 is wrong. It must be:

  dwHigh16 = ( (mac_addr[5]<<8) | mac_addr[4] );


Kind regards,