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.

LAUNCHXL-CC26X2R1: external memory OAD not booting into downloaded image

Guru 18595 points
Part Number: LAUNCHXL-CC26X2R1

Tool/software:

Dear all,

I think I am almost there. I use my external memory to receive my OAD image.

The image is received, CRC calculated OK, everything seems to work fine.

However, my BIM does not seem able to boot such properly downloaded image. Please see the following screenshot with debugger watched variables.

As you can see, it checks OK all conditions.

Do you see something that immediately appears as wrong?

I checked the len of the image and is exaclty 293668 so it is ok.

Maybe flashPageNum or imgFxdHdr->prgEntry?

Please let me know any suggestion and have a nice day.

  • Hi kazola,

    The BIM and App SPI pins needs to be the same if you are using custom board.

    -kel

  • Hi Markel,

    The App receives the file OK. The BIM reads it OK. Otherwise it would not reach the point in the screenshot.

    I don't think it's the SPI pins, I changed them and seem correct, but thanks.

  • Hi kazola,

    The simple peripheral off chip oad example modified for custom board should work. That is if you modified it properly. Have you tried that, or is this what you are currently doing?

    Also, if I remember correctly there is a special procedure in debugging BIM and OAD App. Which, I already forgot.

    -kel

  • I did that.

    Everything seems to be working but the code does not jump.

    Thanks.

    Let's wait for other inputs.

  • Hi Kazola,

    Thank you for reaching out.

    If I may a few thoughts:

    - Can you check the address of application vector table is 0x00000090 (i.e. 144)? I guess this can be checked within the map file, then double checked with the flash content at this address.

    - Can you run once outside of debug mode - Markel has a point and the program behavior might be slightly altered by the debugger

    - Can you use the debugger to execute the same as what jumpToPrgEntry() would do? (I am copying the code here for convenience)

    ¨/*******************************************************************************
     * @fn          jumpToPrgEntry
     *
     * @brief       This function jumps the execution to program entry to execute
     *              application
     *
     * @param       vectorTable - address of application vector table.
     *
     * @return      None.
     */
    
    void jumpToPrgEntry(uint32_t *vectorTable)
    {
        /* The following code resets the SP to the value specified in the
         * provided vector table, and then the Reset Handler is invoked.
         *
         * Per ARM Cortex specification:
         *
         *           ARM Cortex VTOR
         *
         *
         *   Offset             Vector
         *
         * 0x00000000  ++++++++++++++++++++++++++
         *             |    Initial SP value    |
         * 0x00000004  ++++++++++++++++++++++++++
         *             |         Reset          |
         * 0x00000008  ++++++++++++++++++++++++++
         *             |          NMI           |
         *             ++++++++++++++++++++++++++
         *             |           .            |
         *             |           .            |
         *             |           .            |
         *
         * */
    
        /* Reset the SP with the value stored at vector_table[0] */
        __asm volatile ("MSR msp, %0" : : "r" (vectorTable[0]) : );
    
        /* Jump to the Reset Handler address at vector_table[1] */
    
        ( (void (*)(void)) (*(vectorTable + 1)) )();
    }
    

    I hope this will help,

    Best regards,

  • Hi Clement,

    Thanks for your time in advance

    This is the content of the map file, the beginning of it.

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    FLASH_IMG_HDR  00000000 00000090 0000008d 00000003 R X
    ENTRY                    00000090 00000040 0000003c 00000004 R X
    FLASH                    000000d0 00055f30 0004ba3d 0000a4f3 R X
    RTOS_SRAM         20000000 0000012c 00000000 0000012c RW X
    SRAM                     20000fdf 00013021 0000b378 00007ca9 RW X

    The following screenshot shows you it seems to match. Please notice how the BIM managed to do most of the job OK.

    Even the retval of the highligted line returns 0, so success.

    The next call to extFlashWrite, even if not controlled, returns True, so success.

    Please see in the following one, it even goes down to jumping.

    I also used the debugger to do what you asked.

    Please see for example vectorTable[8] seems to be the typical 0001 OAD version.

    Now I am going to try without the debugger just as you asked, but I guess meanwhile you have enough information to do a guess.

    Have a nice day and thanks for your help, hope we can solve this.

    PS: as an additional check, I sent via the Simplelink Connect App a modified version of the image I am sending, with the softVer set to 0,0,0,9 instead of the default 0,0,0,1. This was meant to allow us to see if the BIM is seeing the sent image. Please check in the following screenshot this is the case.

    My next step is running this without the debugger but I don't expect much changes, since it is not booting in this new '9' file.

  • Hi Clement,

    I managed to make this work and was able to at least run one image downloaded by OAD.

    So other people can know, the problem is sometimes the BIM cannot extFlashOpen() when running not attached to the debugger.

    Any idea what the problem might be? It might be useful decerasing its baudrate? Now is 4000000 which does not seem very high but, I don't mind decreasing it.

    Also I cannot find the special procedure to debug BIM and OAD. Can you direct me to it?

    Thanks.

    I will update this thread accordingly and open a new one if I find more issues during the following days.

  • Hi Kazola,

    Thank you for the additional details provided.
    To summarize, it seems OAD works without debugger, but it does not work when the debugger is detached. Correct? And when, the debugger is detached, the issue comes from extFlashOpen(), am I correct?

    When running the SPI at 4 MHz, you are close to its limits (see §9.8 of https://www.ti.com/lit/swrs207), but should still be on the right side. For this reason, I would recommend running one test to see if something maybe happening in this area.

    In addition, assuming the issue is limited to extFlashOpen(), I think it makes sense to try reproducing the issue without the OAD part - i.e. with just the SPI part. You should also consider implementing some sort of logging inside the extFlashOpen() function, it could help identifying the issue. This will save you debugging time on the long run.

    Here are a few debug leads I can think of:

    • If you are not using a LaunchPad, a HW review might be suitable. In general, the debugger allows to power the board in a slightly different manner. If you end up with a non-correctly powered Flash, SPI operations will fail.
    • I have seen before SPI signals (SCK, PICO, POCI, CS) conflicting with the debug signals - especially in complex systems where several pins are being reassigned. Such pin conflict could lead to SPI initialization failure, or failure when interfacing the flash.
    • For sanity, I would recommend to verify if erasing the flash before attempting the OAD operation has an impact.

    If the above does not help, could you specify whether you have made some modifications in the BIM code? Modifications include code changes, altering the optimization level, etc.

    I cannot find the special procedure to debug BIM and OAD. Can you direct me to it?

    I am not sure I am aware of such procedure. Let me check with some colleagues and come back to you if I hear about it.

    Best regards,

  • Sorry, for some sort of confusion with my comment. The special procedure is debugging dual image BIM and APP OAD. Also, debugging without writing to flash. 

    But, anyway if you ported the BIM off-chip and simple peripheral off-chip OAD correctly to your custom board and then you tested the OAD several times means it's reliable. If you modify the simple peripheral off-chip OAD to your requirements the OAD should work and you do not need to debug it.

    -kel