W5500 MAC ADDRESS

W5500 칩과 STM32F103으로 구성된 회로를 구성하고 소스는 WIZ550web–v2.0.2.1를 편집하여 사용하고 있습니다. 싱글 제품일 때에는 네트웍 동작이 원활히 잘 되고 있는데 여러 대를 IP공유기에 연결하면 정상동작을 하지 않습니다.
원인을 찾아보니 IP공유기에 내부연결 정보를 확인하니 MAC 어드레스가 “00-08-DC-00-00-00” 이렇게 잡힙니다. 맥어드레스는 자사의 맥어드레스를 사용하고 있고 직접 라이팅을 하고 있습니다. 콘솔을 연결하면 저희가 셋팅한 맥어드레스가 디스플레이 되는데 공유기에 들어가서 보면 위즈넷 맥이 보이는 것 같습니다.
위즈넷 맥은 저희가 따로 셋팅을 안하고 있는데 어디에서 셋팅이 되는지 알 수 있을까요? 아무리 찾아봐도 위즈넷 맥을 셋팅하는 곳을 찾을 수가 없습니다. 먼저 경험하시거나 해결할 수 있는 팁이 있으시면 많은 조언 부탁 드립니다

Please post link to your sources of the library you use.
Looking at here and searching for “0xdc” I find:

ConfigData.c

#if 0
	s2e_packet.network_info_common.mac[0] = 0x00;
	s2e_packet.network_info_common.mac[1] = 0x08;
	s2e_packet.network_info_common.mac[2] = 0xDC;
	s2e_packet.network_info_common.mac[3] = 0x11;
	s2e_packet.network_info_common.mac[4] = 0x22;
	s2e_packet.network_info_common.mac[5] = 0x33;
#endif

But this code is disabled. Most probably here’s the place you have it set:

void DHCP_init(uint8_t s, uint8_t * buf)
{
   uint8_t zeroip[4] = {0,0,0,0};
   getSHAR(DHCP_CHADDR);
   if((DHCP_CHADDR[0] | DHCP_CHADDR[1]  | DHCP_CHADDR[2] | DHCP_CHADDR[3] | DHCP_CHADDR[4] | DHCP_CHADDR[5]) == 0x00)
   {
      // Assigning temporary MAC address, you should be set SHAR before call this function.
      DHCP_CHADDR[0] = 0x00;
      DHCP_CHADDR[1] = 0x08;
      DHCP_CHADDR[2] = 0xdc;      
      DHCP_CHADDR[3] = 0x00;
      DHCP_CHADDR[4] = 0x00;
      DHCP_CHADDR[5] = 0x00; 
      setSHAR(DHCP_CHADDR);     
   }

in dhcp.c.

You see that this routine reads address first, and if it is 0 sets to temporary default address. The only action you must do before calling dhcp initialization (after/during calling chip initialization routine) is to set SHAR to correct address, and then it will be kept preserved.

Or probably you can enable the first piece of code above and set correct MAC address for this specific module. But then you will have to compile for each module…

감사합니다. 수정해 보겠습니다

Hello Eugeny. I had a similar issue with DHCP and have been struggling to know where is the problem. Your reply here gave me the answer. Thank you.

1 Like