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.

RTOS/AM5726: sbl_main.c DSP init

Part Number: AM5726

Tool/software: TI-RTOS

Hi Everyone

In my current project only the A15 is initialized and the other processors are not in use.

Now i would like to utilize the C66xx DSP so I need to do it in my MLO.

I opened sbl_main.c and found that the part which checks if the DPS's entry point !=0 was commented out. I uncommented it and added some printing to see if SBL_DSP1_BringUp is executed  but it seems that the entry point is 0 (code is below, i dont get the "DSP release" message)

if (Entry.entryPoint_DSP1 != 0)
{
/* Release the DSP1 core out of reset */
UART_printf("DSP release...");
SBL_DSP1_BringUp(Entry.entryPoint_DSP1);
UART_printf("Done !\n");
}

i assume that the entry point is being pouplated by SBL_ImageCopy(), however, it is very difficult to follow it. 

Can someone shed some light on this topic ? i realy need to get the DSP up and running from the SD card

Thanks

Maor

  • Maor,

    There is  no need to modify the  SBL to wake up the DSP from the SBL code.  The SBL decides to wakeup the DSP or not based on the multicore application image that it loads during ImageCopy.

    If you create the images as explained below, the SBL will wakeup the DSP and start DSP application code execution based on the entry point in DSP application.  It read the core ID when parsing the multicore boot image and also reads in the entry point from the app image. If DSP core ID is detected it will read in the entry point making it non-zero: This has been explained here:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_Foundational_Components.html#am57x

    I have  provided a screenshot for how to create an multicore application image that loads application on ARM, DSP  and M4(IPU)  for your reference.

    Hope this helps. Please let us know if you have any feedback questions that we can help with.

    Regards,

    Rahul

  • Thanks Rahul

    I followed the steps you wrote and generated the app file, it seems now that the SBL is entering the SBL_DSP1_BringUp function, however, it does not return from it. 

    if (Entry.entryPoint_DSP1 != 0)
    {
    /* Release the DSP1 core out of reset */
    UART_printf("DSP release...");
    SBL_DSP1_BringUp(Entry.entryPoint_DSP1);
    UART_printf("Done !\n");
    }

    Now i see "DSP release..." message but i don't see "Done !"

    I Investigated a little bit and added comments to SBL_DSP1_BringUp function.

    I found that it get stuck at the marked section

    void SBL_DSP1_BringUp(uint32_t EntryPoint)
    {
    uint32_t i = 0U;

    if(EntryPoint != 0U)
    {
    UART_printf("\nB4 SBL_DspEntryPointSet");
    /* Set the Entry point of the application in the trampolene code. */
    SBL_DspEntryPointSet(EntryPoint, dsp1Instruction);
    UART_printf("\nAfter SBL_DspEntryPointSet");
    /*
    ** Copy the dsp opcodes to create a trampoline at the specified memory
    ** location which is aligned at 0x400. This helps us in removing the
    ** entry address alignment limitation.
    */
    memcpy((void *) DSP1_ENTRY_ADDR, (void *)dsp1Instruction,
    sizeof(dsp1Instruction));
    }

    /*DSP L2RAM*/
    /* Set the Entry point */
    if (EntryPoint != 0U)
    {
    HW_WR_REG32(DSP1BOOTADDR, (DSP1_ENTRY_ADDR >> 0xAU));
    }
    else
    {
    HW_WR_REG32(DSP1BOOTADDR, (EntryPoint >> 0xAU));
    /* Self branch loop for DSP */
    for (i = 0; i < 8; i++) {
    HWREG(CSL_MPU_DSP1_L2_SRAM_REGS + 4 * i) = 0x12;
    }
    }

    /* Reset de-assertion for DSP CPUs */
    UART_printf("\nReset de-assertion for DSP CPUs");
    HW_WR_REG32((CSL_DSP_DSP1_PRM_REGS + RM_DSP1_RSTCTRL), 0x0);
    /* Check the reset state: DSPSS Core, Cache and Slave interface */
    UART_printf("\nCheck the reset state: DSPSS Core, Cache and Slave interface");
    while ((HW_RD_REG32((CSL_DSP_DSP1_PRM_REGS + RM_DSP1_RSTST)) & 0x3) != 0x3);
    /* Check module mode */
    UART_printf("\nCheck module mode");
    while ((HW_RD_REG32(CSL_MPU_DSP1_CM_CORE_AON_REGS + CSL_DSP1_CM_CORE_AON_CM_DSP1_DSP1_CLKCTRL_REG) & 0x30000) != 0x0);

    }

    Any ideas why ?

    Maor

  • Ok.. I found that in my sbl_main.c the call for SBL_SlaveCorePrcmEnable() was commented out.
    after i uncommented it, the boot got stuck.
    digging into it i found that IPU1 is enabled, but all the rest are not.
    I only kept IPU1 and DSP1 to be enabled for debug. I found that the call for DSP1_ClkEnable() is stuck, and when i dug there i found that the problem is in the SBL_PRCMModuleEnable at "check clock activity - ungated" section

    void SBL_PRCMModuleEnable(uint32_t domainOffset,
    uint32_t clkCtrlReg,
    uint32_t clkStCtrlReg,
    uint32_t clkActMask)
    {
    /* Enable the module */
    UART_printf("\nEnable the module");
    HW_WR_REG32(domainOffset + clkCtrlReg, PRCM_MODULEMODE_AUTO);
    /* Check for module enable status */
    UART_printf("\nCheck for module enable status");
    while(PRCM_MODULEMODE_AUTO !=
    (HW_RD_REG32(domainOffset + clkCtrlReg) & PRCM_MODULEMODE_MASK));

    /* Check clock activity - ungated */
    UART_printf("\nCheck clock activity - ungated ");
    while(clkActMask != (HW_RD_REG32(domainOffset + clkStCtrlReg) & clkActMask));
    }

    any ideas ?
  • Maor,

    Are you trying this on the AM572x IDK or on the custom board. The SBL_SlaveCorePRCMEnable is not commented out in our code base so can you check if there are other changes that could impact this setup. Before SBL_SlaveCorePRCMEnable, sbl_main calls SBL_Configure_AVS (sets up core voltages for alll core on the SOC) and Board_Init (sets up the module clocks). Can you confirm that the DSP clock related code in board library and the AVS/ABB configuration exists in your baseline.

    Check : pdk_am57xx_1_0_13\packages\ti\board\src\idkAM572x\idkAM572x_clock.c (DSP clock)

    Check pdk_am57xx_1_0_13\packages\ti\boot\sbl\board\src\sbl_avs_config.c (DSP core voltage)

    When the error occurs can you connect to the DSP core and ARM core see the program counter. When the hang occurs, can you load the symbols using sbl.out and check to see whether DSP entry point is detected correctly.  Could you indicate if the DSP L2 SRAM is being used in your application binary? Is the application that you are trying to boot loading all three cores? Can you confirm that there is no memory overlap between the SBL and application binaries.

    Regards,

    Rahul

  • Hi Rahul 

    Yes, i am working on a custom board.

    I reviewed the files you specified and removed comments parts that were commented out and were relevant to the DSP (I compared the code with the standard code), however, when i built the MLO the compiler specified "nothing to do" and did not build a new MLO (i guess that these files are not included in the build)

    However, i did manage to get the DSP to wake up by doing the following:

    In DSP1_ClkEnable() function, the original order of the function is SBL_PRCMModuleEnable and then SBL_PRCMSetClkOperMode, when i reversed the order my problem was resolved and the DSP now wakes up after the MLO is finished.

    Can you comment regarding what i have done ?

    Thanks

    Maor

  • Maor,

    Thanks for confirming that you are able to boot the DSP. We have tested the DSP wakeup only with the original sequence but I don`t see an issue in reversing the sequence but let me check with design team for their recommendation.

    Is it possible that you may have SBL_PRCMSetClkOperMode or equivalent CSL code is being called in your board_clock.c file?

    Regards,
    Rahul
  • Hi Rahul

    The SBL_PRCMSetClkOperMode  is not being called in my board_clock.c file. Which CSL code is equivalent to it ?

    Maor

  • Thanks for confirming. CSL equivalent for that may be some kind of write operation to CM_DSP1_CLKSTCTRL register.

    HW_WR_FIELD32(Offset + CtrlReg, CM_DSP1_CLKSTCTRL_CLKTRCTRL, CLOCKMODE);