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.

[FAQ] TDA4VM: Getting Shmoo plots for OSPI PHY tuning

Part Number: TDA4VM


Shmoo plots are a useful when it comes to debugging OSPI PHY tuning related issues. This FAQ explains the procedure of getting the shmoo plots from PDK PHY tuning algorithm.

  • Shmoo plots are basically a set of scatter plots of passing Rx_DLL and Tx_DLL values for a given read delay window.

    Please refer to the APP note in the link below get an understanding of the tuning algorithm.
    PHY_Tuning_App_Note

    1) Define the following Macros in nor_spi_phy_tune.c

    #define NOR_log UART_printf
    
    #define SHMOO_TX_DLL_START      (0U)
    #define SHMOO_TX_DLL_END        (128U)
    #define SHMOO_RX_DLL_START      (0U)
    #define SHMOO_RX_DLL_END        (128U)
    #define SHMOO_RD_DELAY_START    (0U)
    #define SHMOO_RD_DELAY_END      (4U)
    

    2) Add the following API in nor_spi_phy_tune.c

    static void NOR_spiPhyFindShmoo(OSPI_Handle handle, uint32_t offset)
    {
        OSPI_v0_HwAttrs const        *hwAttrs= (OSPI_v0_HwAttrs const *)handle->hwAttrs;
        int32_t shmooTxDLL, shmooRxDLL, shmooRdDelay, status;
        NOR_log("RD_Delay,\tTxDLL,\tRxDLL\n");
        for(shmooRdDelay = SHMOO_RD_DELAY_START ; shmooRdDelay < SHMOO_RD_DELAY_END ; shmooRdDelay++)
        {
            NOR_spiRdDelayConfig(handle, shmooRdDelay);
            for(shmooTxDLL = SHMOO_TX_DLL_START ; shmooTxDLL < SHMOO_TX_DLL_END ; shmooTxDLL+=4)
            {
                for(shmooRxDLL = SHMOO_RX_DLL_START ; shmooRxDLL < SHMOO_RX_DLL_END ; shmooRxDLL+=4)
                {
                    NOR_spiTxRxDllConfig(handle,shmooTxDLL,shmooRxDLL);
                    status = NOR_spiPhyRdAttack(hwAttrs->dataAddr + offset);
                    if(status == NOR_PASS)
                    {
                        NOR_log("%d,\t%d,\t%d\n", shmooRdDelay, shmooTxDLL, shmooRxDLL);
                    }
                }
            }
        }
    }

    3) Call this API from Nor_spiPhyDdrTune or Nor_spiPhySdrTune based on the mode you are using.

    RD_Delay,       TxDLL,  RxDLL
    2,      24,     0
    2,      24,     4
    2,      24,     8
    2,      24,     12

    2,      124,    68
    2,      124,    72
    2,      124,    76
    2,      124,    80
    2,      124,    84

    You may get this data for more than one read delay.

    Copy the data for each ready delay in excel and generate a scatter plot for Tx_DLL vs Rx_DLL, with Tx_DLL on x-asix. Please see the image for reference.

    Regards,
    Parth