This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DP83822I: compliance testing - 10BASE-T 0x0027 does nothing

Part Number: DP83822I

Hello together,

I have a problem running the compliance test on the DP83822I for the 10BASE-T Standard, since the 0x0027 register isn't doing anything for me. Sweat smile

I'm probably missing a instruction to enable this function, or the wrapper we wrote to write to the extended register isn't working correctly.

I'll try bypassing the function tomorrow. 

First I followed the SNLA266 for the tests since this manual sneaks around the use of 0x0027, but for a specific test my LeCroy Scope asks for a all Ones code.

Which should correspond  to a value of 0x0013 for register 0x0027, this doesn't work.

/*Start of Test modes*/
        // snla266 A.3 10BASE-Te Standsard Test Script MDI works but only with the 0x0016 not with 0x0027
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x001F, 0x8000); // software reset (clears register
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0000, 0x0100); // programs DUT to 10BASE-T mode
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0019, 0x0021); // programs DUT to Forced MDI mode
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0016, 0x7108); //programs DUT to generate data and enables analog loopback mode
        //HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0027, 0x0019);   // this should never work since 0x0027 is bigger than the biggest standard register (0x001F) 
        //HalEthInitStatus = writeExtRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0027, 0x0019); // this doesn't work I don't know why
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x001F, 0x4000); // digital reset (doesn’t clear reg
        // end
        HAL_Delay(1000);
        // snla266 A.3 10BASE-Te Standard Link Pulse works
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x001F, 0x8000); // software reset (clears register
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0000, 0x0100); // programs DUT to 10BASE-T mode
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0019, 0x0021); // programs DUT to Forced MDI mode
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x001F, 0x4000); // digital reset (doesn’t clear reg
        // end
        HAL_Delay(1000);
        // snla266 A.3 10BASE-Te All Ones doesn't work
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x001F, 0x8000); // software reset (clears register
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0000, 0x0100); // programs DUT to 10BASE-T mode
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0019, 0x0021); // programs DUT to Forced MDI mode  
        HalEthInitStatus = writeExtRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x0027, 0x0013);
        HalEthInitStatus = HAL_ETH_WritePHYRegister(&LWIP_MOD_ETHIF_EtherHandle, ETH_PHY_ADDRESS, 0x001F, 0x4000); // digital reset (doesn’t clear reg
        HAL_Delay(1000);

Can anybody tell me the secret to the 0x0027 register ?

Thanks in advance  Grinning

  • Hi Lukas,

    Register 0x0027 is in extended register space and you cannot access it directly. Please follow the Extended Register Space process according to Section 8.4.2.1 to write or read this register:
    8.4.2.1 Extended Register Space Access
    https://www.ti.com/lit/ds/symlink/dp83822i.pdf?ts=1669830898442&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FDP83822I

    Regards,
    Rahul

  • Hi Rahul,

    as far as I can tell our writeExtRegister() function is doing what is specified in the datasheet. And setting the LEDs to a specific behavior works just fine.

    ...
    #define PHY_REGCR (0x000D)
    #define PHY_REGCR_MMD31 (0x001F) /**< DEVAD = 11111 (general MMD register accesses) */
    #define PHY_REGCR_CMD_ADDRESS (0x0000) /**< CMD = 00 (address) */
    #define PHY_REGCR_CMD_DATA_NO_POST_INCREMENT (0x4000) /**< CMD = 01 (Data, no post increment) */
    #define PHY_ADDAR (0x000E)
    ...
    static HAL_StatusTypeDef writeExtRegister(ETH_HandleTypeDef *ETHHandle, uint32_t PHYAddr, uint16_t PHYReg, uint32_t RegValue)
    {
        HAL_StatusTypeDef HalEthStatus = HAL_OK;
    
        HalEthStatus |= HAL_ETH_WritePHYRegister(ETHHandle, PHYAddr, PHY_REGCR, (PHY_REGCR_CMD_ADDRESS | PHY_REGCR_MMD31));
        HalEthStatus |= HAL_ETH_WritePHYRegister(ETHHandle, PHYAddr, PHY_ADDAR, PHYReg); /* address to write to */
        HalEthStatus |= HAL_ETH_WritePHYRegister(ETHHandle, PHYAddr, PHY_REGCR, (PHY_REGCR_CMD_DATA_NO_POST_INCREMENT | PHY_REGCR_MMD31));
    
        /* Write value into indirectly addressed register */
        HalEthStatus |= HAL_ETH_WritePHYRegister(ETHHandle, PHYAddr, PHY_ADDAR, RegValue);
    
        return HalEthStatus;
    }
    ...

    Any other suggestions why it might not work ?

  • Hi Lukas,

    Let me try to replicate this in our lab and update you with my results.

    I have few other customer issues to debug this week, I will get back to you early next week.

    Thanks,
    Rahul