Viewing Data in Management Data Input/Output (MDIO) Registers – KBA89251

Version: **

 

Question: How do you view and verify the MDIO register contents when using the SetData function of the MDIO Interface to move data to the MDIO registers?

 

Answer:

Check the MDIO component to determine to which REGISTER_SPACE the address belongs. Once you know this, calculate the index needed to access the register by subtracting the initial address of that REGISTER_SPACE from the address in question. Arrays are defined in the MDIO_SLAVE_REG.c file.

For example, assume you want to view the address 0x8205. If the REGISTER_SPACE_3 starts at 0x8200 and ends at 0x8206, you know that 0x8205 belongs to REGISTER_SPACE_3. The index is 0x8205 – 0x8200 = 5.

Now go to MDIO_SLAVE_REG.c and check the REGISTER_SPACE_3 array, which is:

uint16 MDIO_SLAVE_registerPage_3[MDIO_Slave_REG_PAGE_3_SIZE];

Add the MDIO_SLAVE_registerPage_3[5] in the Watch window of the debugger. Now you can see whether the content of this address is changing.