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.

AWR1642: How to prevent device halt at SOC_INIT?

Part Number: AWR1642

Hello team,

Customer is facing the issue, that the device will halt at APP SOC_INIT while the power supply is not good(with ripple or undervoltage status).

So, customer is asking if we can do the GPADC reading before the SOC_INIT(To make sure the power supply is good), Or enable the watchdog before the SOC_init.

Then, while the device goes into the halt, the watchdog also can bring it back.

Is it possible to enable the watchdog before the SOC_INIT? And any risk that SOC_INIT FAIL? Is the watchdog use same clock as the MSS or the watchdog will not be impact by the SOC_INIT fail.

Thanks.

Regards,

Wesley

  • in some status, the device can pass the SOC_INIT in SBL. Then halt at APP code SOC_INIT.

    Customer use LM53625+LP87524 power solution without any external watchdog or supervisor.

  • Hello team,

    I had successful seperate the SOC_INIT in 2part, and add the watchdog init between this 2 SOC_INIT part.

    Can you please take a look any risk here? is it watchdog works when the code halt at SOC_deviceInit?

    I had highlight the change in below code.

    Thanks.

    In mss_main.c

    /* Initialize the SOC Module: This is done as soon as the application is started
    * to ensure that the MPU is correctly configured. */
    gMmwMssMCB.socHandle = SOC_init (&socCfg, &errCode);
    if (gMmwMssMCB.socHandle == NULL)
    {
    System_printf ("Error: SOC Module Initialization failed [Error code %d]\n", errCode);
    return -1;
    }
    watchdogTest(1);
    watchdogHandle = Watchdog_open(0, &watchdogParams);

    SOC_init_deviceinit (gMmwMssMCB.socHandle, &errCode);

    In "C:\ti\mmwave_sdk_02_00_00_04\packages\ti\drivers\soc\src\soc.c"

    SOC_Handle SOC_init (SOC_Cfg* ptrCfg, int32_t* errCode)
    {
    SOC_DriverMCB* ptrSOCDriverMCB;

    /* Allocate memory for the SOC Driver: */
    ptrSOCDriverMCB = MemoryP_ctrlAlloc (sizeof(SOC_DriverMCB), 0);
    if (ptrSOCDriverMCB == NULL)
    {
    /* Error: Unable to allocate the memory */
    *errCode = SOC_ENOMEM;
    }
    else
    {
    /* Initialize the allocated memory */
    memset ((void *)ptrSOCDriverMCB, 0, sizeof(SOC_DriverMCB));

    /* Copy over the configuration: */
    memcpy ((void *)&ptrSOCDriverMCB->cfg, (void*)ptrCfg, sizeof(SOC_Cfg));

    /* Populate the SOC Driver block: */
    ptrSOCDriverMCB->ptrRCMRegs = (RCMRegs*)gSOCHwAttrib.rcmBaseAddress;
    ptrSOCDriverMCB->ptrTopRCMRegs = (TOPRCMRegs*)gSOCHwAttrib.topRcmBaseAddress;
    ptrSOCDriverMCB->ptrGPCFGRegs = (GPCFGRegs*)gSOCHwAttrib.gpcfgRegBaseAddress;
    ptrSOCDriverMCB->ptrDSSRegs = (DSSRegs*)gSOCHwAttrib.dssRegBaseAddress;

    /* Do we need to initialize the system clock? */
    if (ptrCfg->clockCfg == SOC_SysClock_INIT)
    {
    /* YES: Unhalt the BSS: */
    SOC_unhaltBSS((SOC_Handle)ptrSOCDriverMCB, errCode);

    /* Switch to 200MHz clock, then wait for APLL calibration is done by BSS */
    SOC_waitAPLLCalibration(ptrSOCDriverMCB);
    }
    else
    {
    /* Fall through and bypass the clock configuration */
    }

    /* Perform any device specific initialization: */
    //SOC_deviceInit (ptrSOCDriverMCB, errCode);
    }
    return (SOC_Handle)ptrSOCDriverMCB;
    }

    void SOC_init_deviceinit(SOC_Handle handle, int32_t* errCode)
    {
    SOC_DriverMCB* ptrSOCDriverMCB;
    ptrSOCDriverMCB = (SOC_DriverMCB*)handle;
    SOC_deviceInit (ptrSOCDriverMCB, errCode);

    }

    Regards,

    Wesley

  • Hello Wesley,

    SOC_Init basically un-halts BSS and/or DSS. In SBL this un-halt is bypassed but in the application this flow is must as you need BSS and DSS to execute.

    During BSS un-halts, device draws slightly high current momentary which may cause this issue if all the power rails are not providing enough current to the device.

    Now when you say that on customer board, they need to check the power supply first. 

    Above code change looks fine but in part1, BSS unhalt takes place which might be reason for this block. so even in this case application will block during soc_init-part1.

    If you are using SDK 3.x version then watchdog_open function requires soc-handle (within Watchdog_Params) which is returned by soc_init function. So for debug purpose you need to make below code into soc_init-part2  (which includes BSS unt-halt code snippet).

    /* Do we need to initialize the system clock? */
    if (ptrCfg->clockCfg == SOC_SysClock_INIT)
    {
    /* YES: ungate/Unhalt the BSS: */
    SOC_ungateClock((SOC_Handle)ptrSOCDriverMCB, SOC_MODULE_BSS, errCode);
    SOC_unhaltBSS((SOC_Handle)ptrSOCDriverMCB, errCode);
    /* Switch to 200MHz clock, then wait for APLL calibration is done by BSS */
    SOC_waitAPLLCalibration(ptrSOCDriverMCB);
    }
    else
    {
    /* Fall through and bypass the clock configuration */
    }

    /* Perform any device specific initialization: */
    SOC_deviceInit (ptrSOCDriverMCB, errCode);

    And finally I would request you to check thier board and power supply to solve this issue on top of these debug changes.

    Regards,

    Jitendra