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.

TDA4VH-Q1: ESM Error in POK Module Initialization

Part Number: TDA4VH-Q1
Other Parts Discussed in Thread: TDA4VH

Hi TI Experts,

Customer is working on TDA4VH SDK9.1.

Customer references the sdl/test/pok sdlPOK_funcTest() to initialize POK.

Their test code is provided below.

    // Unlock the MMR in order to access the POK registers.
    *((uint32_t *)(SDL_WKUP_CTRL_MMR0_CFG0_BASE + SDL_WKUP_CTRL_MMR_CFG0_LOCK6_KICK0)) = KICK0_UNLOCK_VAL;
    *((uint32_t *)(SDL_WKUP_CTRL_MMR0_CFG0_BASE + SDL_WKUP_CTRL_MMR_CFG0_LOCK6_KICK1)) = KICK1_UNLOCK_VAL;
    sdlRet = SDL_POK_enablePP(SDL_POK_PRG_MAIN_ID, true);
    if(SDL_PASS == sdlRet)
    {
        sdlRet = SDL_POK_enablePP(SDL_POK_PRG_MCU_ID, true);
    }
    for(instance = SDL_FIRST_POK_ID + 1; instance < SDL_LAST_POK_ID + 1; instance++)
    {
        if(SDL_PASS == sdlRet)
        {
            SELFTEST_getPokOvStatus(instance, &isOV);
        }
        if(SDL_PASS == sdlRet)
        {
            if(0x1 == isOV)
            {
                PokCfg.voltDetMode = SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE;
                PokCfg.trim = SDL_PWRSS_TRIM_NO_ACTION;
                PokCfg.trimOV = 45;
            }
            else if (isOV == 0x0)
            {
                PokCfg.voltDetMode = SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE;
                PokCfg.trim = 0;
                PokCfg.trimOV = SDL_PWRSS_TRIM_NO_ACTION;
            }
            else
            {
                if(SDL_PASS == sdlRet)
                {
                    // This is Ping/Pong.
                    PokCfg.voltDetMode = SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE;
                    PokCfg.trim = 0;
                    PokCfg.trimOV = 45;
                }
            }            
        }
        if(SDL_PASS == sdlRet)
        {
            PokCfg.hystCtrl = SDL_PWRSS_HYSTERESIS_NO_ACTION;
            PokCfg.hystCtrlOV = SDL_PWRSS_HYSTERESIS_NO_ACTION;
            PokCfg.deglitch = SDL_PWRSS_DEGLITCH_NO_ACTION;
            PokCfg.pokEnSelSrcCtrl = SDL_POK_ENSEL_PRG_CTRL;
            PokCfg.detectionCtrl = SDL_POK_DETECTION_ENABLE;

            sdlRet = SDL_POK_init(instance, &PokCfg);
        }

They use SD Card boot and running on the MCU1-1 with freertos.

After analyzing the ESM error from the log, we found that these error are WKUP ESM error index 88, 90, 98 shown below.

Could you help provide some suggestions on what could cause these problems?

Thanks a lot!

Kevin

  • Hi Kevin, 

    These are the events for VDDSHV Main 1P8 Under Voltage (SDL_POK_VMON_EXT_MAIN_1P8_ID) and VDDSHV Main 3P3 Under Voltage (SDL_POK_VMON_EXT_MAIN_3P3_ID).

    Regards,

    Josiitaa

  • I have measured the "VDDSHV MAIN 1P8" and "VDDSHV MAIN 3P3" circuit, and the voltage values displayed are normal.

    Therefore, I am wondering whether the above ESM error is possible to be wrong positive. Or is there something wrong with my initialization code that causes an error?

    Regards,

    Yudan

  • Hi Yudan,

    I am going through your code and checking internally if these error events are expected. I will get back to you by mid next week. 

    Regards,

    Josiitaa 

  • Hi Jasiitaa,

    Is there any update?

    Regards,
    Yudan

  • Hi Yudan,

    Which POK instance are you trying to test? Could you try running the SDL standalone test and see if the issue is reproduced?

    Regards,

    Josiitaa

  • Hi Josiitaa RL, I refer to sdl_pok_test_app,  and  delete inject error.   ESM report  errors:

    test code:(just  block  inject error code)

    int32_t sdlPOK_funcTest(void)
    {
        int32_t                      testStatus, sdlRet = SDL_PASS, overallStatus = SDL_APP_TEST_PASS;
        SDL_POK_config               pPokCfg;
        bool                         usePorCfgFlag;
    #if defined (SOC_J721E)
        uint32_t                     esm_err_sig;
    #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
        uint32_t                     esm_err_sig_uv, esm_err_sig_ov;
    #endif
        SDL_POK_Inst                 instance;
        uint32_t                     i;
        uint32_t                     isOV;
        SDL_POK_staticRegs           pStaticRegs;

        //sdlPOK_test_printPOKs();
    #if defined (SOC_J721E)
        UART_printf(" Below are the POK ID values \n");
        UART_printf("  SDL_POK_VDDA_PMIC_IN_ID is:       0 \n");
        UART_printf("  SDL_POK_VDD_CORE_UV_ID is:        1 \n");
        UART_printf("  SDL_POK_VDDSHV_WKUP_GEN_UV_ID is: 2 \n");
        UART_printf("  SDL_POK_VDD_CPU_UV_ID is:         3 \n");
        UART_printf("  SDL_POK_VDDR_MCU_UV_ID is:        4 \n");
        UART_printf("  SDL_POK_VMON_EXT_UV_ID is:        5 \n");
        UART_printf("  SDL_POK_VDD_MCU_OV_ID is:         6 \n");
        UART_printf("  SDL_POK_VDDR_CORE_UV_ID is:       7 \n");
        UART_printf("  SDL_POK_VDDSHV_WKUP_GEN_OV_ID is: 8 \n");
        UART_printf("  SDL_POK_VDD_CORE_OV_ID is:        9 \n");
        UART_printf("  SDL_POK_VDDR_MCU_OV_ID is:        10 \n");
        UART_printf("  SDL_POK_VDD_CPU_OV_ID is:         11 \n");
        UART_printf("  SDL_POK_VDDR_CORE_OV_ID is:       12 \n");
        UART_printf("  SDL_POK_VMON_EXT_OV_ID is:        13 \n");
    #else
        UART_printf(" Below are the POK ID values \n");
        UART_printf("  SDL_POK_VDDA_PMIC_IN_ID is:       0 \n");
        UART_printf("  SDL_POK_VDD_CORE_ID is:           1 \n");
        UART_printf("  SDL_POK_VDDR_CORE_ID is:          2 \n");
        UART_printf("  SDL_POK_VDD_CPU_ID is:            3 \n");
        UART_printf("  SDL_VMON_EXT_ID is:               4 \n");
        UART_printf("  SDL_VMON_EXT_MAIN_1P8_ID is:      5 \n");
        UART_printf("  SDL_VMON_EXT_MAIN_3P3_ID is:      6 \n");
        UART_printf("  SDL_VDDR_MCU_ID is:               7 \n");
        UART_printf("  SDL_POK_VDDSHV_WKUP_GEN_ID is:    8 \n");
        UART_printf("  SDL_POK_CAP_VDDS_MCU_GEN_ID is:   9 \n");
        UART_printf("  SDL_POK_VDD_MCU_OV_ID is:         10 \n");
    #endif
    #if defined (BUILD_UART_SCANFMT)
        UART_printf("\n\n Enter the POK ID for the test  \n");
        UART_scanFmt ("%d \n", &instance);
        UART_printf(" Enter the voltage threshold the test  \n");
        UART_scanFmt ("%d \n", &pPokCfg.trim);
    #if defined (SOC_J721E)
        UART_printf(" Enter the Voltage Detection (0: UV, 1: OV) for the POK ID to monitor for the test  \n");
    #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
        UART_printf(" Enter the Voltage Detection (0: UV, 1: OV, 2: PP) for the POK ID to monitor for the test  \n");
    #endif
        UART_scanFmt ("%d \n", &pPokCfg.voltDetMode);
        if (pPokCfg.voltDetMode == 0U)
        {
             pPokCfg.voltDetMode = SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE;
        }
        else if (pPokCfg.voltDetMode == 1U)
        {
             pPokCfg.voltDetMode = SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE;
        }
    #if defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
        else
        {
            pPokCfg.voltDetMode = SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE;
            UART_printf(" Enter the voltage threshold for OV for the test  \n");
            UART_scanFmt ("%d \n", &pPokCfg.trimOV);
        }
    #endif
    #else
        UART_printf ("\n\nDefault test cycles through POKs, monitoring set to OV \n");
        pPokCfg.voltDetMode = SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE;
        pPokCfg.trim = 0;
    #endif

        for (i = SDL_FIRST_POK_ID + 1; i < SDL_LAST_POK_ID + 1; i++)
        {
            // instance = i;
    #if defined (SOC_J721E)
            sdlGetErrSig(i, &instance, &esm_err_sig, &usePorCfgFlag);
    #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
        sdlGetErrSig(i, &instance, &esm_err_sig_uv, &esm_err_sig_ov, &usePorCfgFlag);
    #endif
            sdlPOKGetUVOV(i, &isOV);
    //         if (isOV == 0x1)
    //         {
    //             pPokCfg.voltDetMode = SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE;
    // #if defined (SOC_J721E)
    //             pPokCfg.trim = 0;
    // #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
    //      pPokCfg.trim = SDL_PWRSS_TRIM_NO_ACTION;
    //             pPokCfg.trimOV = 0;
    // #endif
    //         }
    //         else if (isOV == 0x0)
    //         {
    //             pPokCfg.voltDetMode = SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE;
    //             pPokCfg.trim = 127;
    // #if defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
    //      pPokCfg.trimOV = SDL_PWRSS_TRIM_NO_ACTION;
    // #endif
    //         }
    // #if defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
    //  else
    //  {
    //             SDL_POK_enablePP(SDL_POK_PRG_MAIN_ID, true);
    //      SDL_POK_enablePP(SDL_POK_PRG_MCU_ID, true);
    //             /* This is Ping/Pong */
    //             pPokCfg.voltDetMode = SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE;
    //             pPokCfg.trim = 127;
    //             pPokCfg.trimOV = 0;
    //  }
    // #endif

            /* ESM Setup for POK tests */
    #if defined (SOC_J721E)
            sdlEsmSetupForPOK(esm_err_sig);
            sdlRet = ESMApp_registerIsr((uintptr_t)esm_err_sig);
    #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
        sdlEsmSetupForPOK(esm_err_sig_uv);
        sdlEsmSetupForPOK(esm_err_sig_ov);
        if (isOV == 0x1)
        {
                sdlRet = ESMApp_registerIsr((uintptr_t)esm_err_sig_ov);
        }
        else
        {
            sdlRet = ESMApp_registerIsr((uintptr_t)esm_err_sig_uv);
        }
    #endif
            if (sdlRet == SDL_PASS)
            {
               
                // sdlRet = SDL_POK_getStaticRegisters(instance,&pStaticRegs);
                // if (sdlRet == SDL_PASS )
                // {
                //      UART_printf ("\n static trim value is %d \n",pStaticRegs.trim );
                //      UART_printf ("\n static UV/OV value is %d \n", pStaticRegs.voltDetMode);
                // }

                // sdlRet = sdlPOK_Test(instance, &pPokCfg);

                if (sdlRet == SDL_PASS)
                {
                    testStatus = SDL_APP_TEST_PASS;
                }
                else
                {
                    testStatus = SDL_APP_TEST_FAILED;
                    overallStatus = SDL_APP_TEST_FAILED;
                }
                /* Re-set the trim value to a good value */
                if (isOV == 0x1)
                {
    #if defined (SOC_J721E)
                    pPokCfg.trim = 45;
    #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
                    pPokCfg.trim = SDL_PWRSS_TRIM_NO_ACTION;
                    pPokCfg.trimOV = 45;
                    pPokCfg.voltDetMode = SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE;
    #endif
                }
                else if (isOV == 0x0)
                {
                    pPokCfg.trim = 0;
    #if defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
                    pPokCfg.trimOV = SDL_PWRSS_TRIM_NO_ACTION;
                    pPokCfg.voltDetMode = SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE;
    #endif
                }
    #if defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
                else
                {
                        SDL_POK_enablePP(SDL_POK_PRG_MAIN_ID, true);
                        SDL_POK_enablePP(SDL_POK_PRG_MCU_ID, true);
                        pPokCfg.trim = 0;
                        pPokCfg.trimOV = 45;
                        pPokCfg.voltDetMode = SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE;
                }
    #endif
                UART_printf("reset to good config start\n");
                sdlPOK_Test(instance, &pPokCfg);
                UART_printf("reset to good config end\n");
    #if defined (SOC_J721E)
                /* Un register the Interrupt */
                ESMApp_unregisterIsr((uintptr_t)esm_err_sig);
    #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4)
            ESMApp_unregisterIsr((uintptr_t)esm_err_sig_uv);
    #endif
            }
            UART_printf("Test for instance %d %s\n\n", instance, (testStatus == SDL_APP_TEST_PASS) ? "PASSED" : "FAILED");
        }
        return (overallStatus);
    }
  • Hi,

    I will try and reproduce this issue with the SDL test app and get back to you in a couple of days.

    Regards,

    Josiitaa

  • Hi,

    UART_printf("reset to good config start\n");
                sdlPOK_Test(instance, &pPokCfg);
                UART_printf("reset to good config end\n");

    You are triggering the injection here in this API right? That is why you are seeing the errors I believe.

    Regards,

    Josiitaa

  • Hi ,  Here just config it to good value and enable it

  • And I config  POK  to other value, but  the instance 4, 5, 6(picture 1 shows the meanning) error always occured, and instance 1~3, 7~13 was disappeared.   In picture 2, we can see  that.

     

  • Hi,

    What do you mean by setting it to a good value? If I remove that sdlPOK_Test(instance, &pPokCfg), I do not see those interrupts.

    Regards,

    Josiitaa

  • Init and enable POK module  with no error.

  • Remove the  sdlPOK_Test(instance, &pPokCfg),  the POK module will not be initialized  and enabled, so  it do not  occur  errors.  Or can you  tell me  how to initialized and enabled POK module  with no errors.

  • Hi,

    I will try initializing without error injection and get back to you in a couple of days.

    Regards,

    Josiitaa

  • Hi ,

       Could you please change the sdl_pok.c line 46 #define DELAY 1 to 10 , rebuild and feedback to us. Thanks.

    Linjun

        

  • think you.  And  we set have delay function to 1ms, but not help

  • closed ,  our HW board error.