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.

CCS/IWR6843: Direct usage of SBL_imageLoader(): Fail to Downloads the Application Metaimage from FLASH to respective RAMs

Part Number: IWR6843
Other Parts Discussed in Thread: UNIFLASH

Tool/software: Code Composer Studio

Hello,

I have an Application Firmware multicore-image (bin file) received from a peripheral device (via CAN Bus) and stored into Flash via Qspi (singleWrite()).

We decided not the use the SBL_imageFlasher() so far.

Due to the fact that we develop an own SBL code, I am trying to use the SBL_imageLoader() function directly.

So i did not use the provided functions: SBL_initTask() and SBL_init().

Problem:

The Metaheader and its value correctly parsed by the SBL_imageLoader() as expected.

But somehow the CCS debugging process aborts while this loop:

/* Download the Metaimage to RAM in chunks of 2K */
            for (loopCnt = 2U; ((loopCnt < (numBlocks)) && \
                        (g_sblMCB.bufferParserState != SBL_BUFFER_PARSER_COMPLETED)); loopCnt++)

{

}

Its hard to find out where exactly the aborting tooks place because why we dont use UART for printf()

My testing env is as following:

- CCS with a Blackhawk Emulator for Debugging.

- mmwave_sdk_03_02_00_04.

Any Ideas, or solution approaches for me ?.

Is my general approach to use the SBL_imageLoader() directly correct ?

I would be very thankful for your help.

  • Hi,

    Could you please verify if the below code is executing correctly:

    SemaphoreP_post(gSblMCB.threadCommSem1);
    QSPIFlash_sysDmaRead(qspiFlashHandle, dmaHandle, dmaChan, (rdPtr + index), (uint32_t)gSblMCB.currBuff, SBL_PING_BUFFER_SIZE / sizeof(uint64_t));
    SemaphoreP_pend(gSblMCB.threadCommSem2, SemaphoreP_WAIT_FOREVER);

    Thanks

    Yogesh

  • Hi,

    There is no debug abortion while executing These 3 Lines the first times.

    But after many many iterations through the loop the abortion occurs.

    It is hard to identify the precise location.

    There is a different behaviour when using CCS Debugging "step over" or just press "play".

    Have you got some good advice for Debugging Methods?

    How can i verifly that These lines are executing correctly?.

    Thanks,

    Thorben

     

  • Hi Thorben,

    Do you see any call stack on the "Debug" window. 

    Thanks

    Yogesh

  • Hi Yogesh,

    finally the SBL_imageLoader() is working. The Return value is correct so the image should be downloaded to RAM areas.

    Next Problem, i am trying to leave the own written SBL code and start the image FW (I hope to measure some hardcoded CAN-Messages to prove FW running).

    As an example In the provided SBL.c code it says:

    /* Download the metaimage present in the SFLASH into the RAM */
        retVal = SBL_imageLoader(qspiFlashHandle, (flashAddr + (uint32_t)SBL_METAIMAGE_OFFSET));

    /* Loading was successful, cleanup and restore the interrupt vector table */
        if (retVal == 0)
     {
         QSPIFlash_close(qspiFlashHandle);
         QSPI_close(gSblMCB.qspiHandle);
         SBL_transportDeinit();
         /* Disable interrupts before copying IVT. */
         HwiP_disable();
          /* Copy the interrupt vector table. */
         memcpy((void*)&_appVecs[0], (void*)&gSblMCB.sblIntVecTable, SBL_VECTOR_TABLE_SIZE);
     }
        /* Reset the MSS core */
        SOC_softReset(gSblMCB.socHandle, &retVal);
        BIOS_exit(0);

    An error occurs within SOC_softReset() by this code:

     /* Configure the register to issue R4F reset. */
            ptrSOCDriverMCB->ptrRCMRegs->SOFTRST1 = CSL_FINSR(ptrSOCDriverMCB->ptrRCMRegs->SOFTRST1, 7U, 0U, 0xADU);

    The Debugging process gets lost during execution of that line.

    I am thankful for any help,

    Thorben

  • Hi Thorben,

    The SOC_softReset() will reset the device and start booting from RAM. You will need to load symbols of the updated image to be able to debug after soft-reset.

    Also please refer to CAN SBL for reference:http://dev.ti.com/tirex/explore/node?node=AIbEoly4B7.jPYk1aCiO-A__AocYeEd__LATEST

    Thanks

    Yogesh

  • Hi Yogesh,

    thanks for the advice. How am i doing this exactly?. Is there any provided C-function in the SDK for loading "debug symbols" before SOC_softReset()?.

    If i get you right - the goal is to stay in CCS -Debug environment, to step into the loaded image ?.

    What happens if i flash my "own written" SBL code via the uniflash tool. (Currently I once flashed the "xwr68xx_ccsdebug.bin" for CCS Debugging).

    Will the "own written" SBL code run in "release mode", perform the SOC_softReset() and run the loaded image ?.

    Thanks for your help,

    Thorben

  • Hi Thorben,

    Yes, once the secondary boot loader has loaded the new meta-image, the CCS will not be able to reference the debug symbols.

    You do not want to load the updated meta-image since it is already getting executed, so you need to just load the symbols in order to debug the same.

    This needs to be done after mss soft reset. Please see attached image for reference:

    CCS is only for debugging. You should be able to see the same behaviors by flashing the SBL image.

    Thanks

    Yogesh