AnsweredAssumed Answered

support for taking  dump of MII register and Eth_phy register dump

Question asked by vallinath s on Apr 4, 2013
Latest reply on Apr 5, 2013 by vallinath s
Branched to a new discussion

IAR: 6.5


Application: Ethernet based code


Need to take the dump of the mii register block and also the eth_phy register block .


Currently using the function eth_phy_reg_dump(int ch, int phy_addr) which part of the eth_phy.c header file


Code part :

int_32       error;


  _enet_address          enet_address;

    /* runtime RTCS configuration */

   _RTCSPCB_init = pcbs;

   _RTCS_msgpool_init = msgs;

   _RTCS_socket_part_init = sockets;

       error = RTCS_create();

   if (error == RTCS_OK) {

      ip_data.ip = ENET_IPADDR;

      ip_data.mask = ENET_IPMASK;

      ip_data.gateway = ENET_IPGATEWAY;

      ENET_get_mac_address(BSP_DEFAULT_ENET_DEVICE, ENET_IPADDR, enet_address);

      ipcfg_init_device(BSP_DEFAULT_ENET_DEVICE, enet_address);


      printf("\n register dump \n");


      // check link status

      printf("\nWaiting for ethernet cable plug in ... ");

      while(!ipcfg_get_link_active(BSP_DEFAULT_ENET_DEVICE)) {};

      printf("Cable connected\n");


The highlighted part of the code need to look into , here the   eth_phy_reg_dump function passing the "ch" as 0 and phy_addr as "configPHY_ADDRESS" which is 1 and defined in userconfig.h file .


The  function definition of  eth_phy_reg_dump(int ch, int phy_addr) as follows:

int eth_phy_reg_dump(int ch, int phy_addr)


    int j, settings;

    printf("\n    MII Register Block\n");


    for (j = 0; j < 32; j++)


        mii_read(ch, phy_addr, j, &settings);

        if (!(j % 4))

            printf("\n0x%02X-0x%02X : %04X ", j, j + 3, settings);


            printf("%04X ", settings);



    return 0;



problem: when build and download and run the code , on the serial port the out put is :

register dump

and nothing is getting printed , the printf inside eth_phy_reg_dump is not getting printed on the serial port . is  dump is happening ?? are we on the right track ,or there is any alternative way to take a dump of MII register block and eth_phy register block , please suggest