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.

CODECOMPOSER: how to erase all flash when using j-link programmer

Guru 18625 points

Part Number: CODECOMPOSER

Hi,

I have switched from XDS110 to J-Link to program my CC26x2R in CCS 10.4.

However, I don't see anywhere any option such as "Erase all unprotected sectors" which XDS110 has.

So my question is simple, how can I completely erase the flash of my CC26x2R device using CCS and J-Link?

Thanks!

  • Kazola,

    I am not sure that this functionality is available.

    When launching a debug session with an XDS110 I can see that a GEL file called cc26x2_xds.gel gets loaded into the debugger.  This has a MassErase function in it.

    menuitem "CC13x2_CC26x2"
    /**
     * \brief    This function issues a board reset before erasing the device flash.
     *           This function disconnects from target after completion.
     *           NOTE: If CM4 DAP is locked, make sure to disable "Custom configuration"
     *                 from all sub paths in the device's target connection file (.ccxml).
     */
    hotmenu MassErase()
    {
        GEL_TextOut("Initializing.\n", "MassErase()");
        _isMassErase = 1;
    
        // Disconnect from target. This must be done for each module in the device debug sub-system hierarchy.
        DisconnectIfConnected(); // Cortex
        GEL_EvalOnTarget("<parent>", "DisconnectIfConnected()", 1); // DAP (Cortex' parent)
        GEL_EvalOnTarget("<parent>", "GEL_EvalOnTarget(\"<parent>\",\"DisconnectIfConnected()\", 1)", 1); // Icepick (DAP's parent)
    
        // Do board reset
        GEL_TextOut("Issuing Board Reset.\n", "MassErase()");
        GEL_AdvancedReset("Board Reset");
    
        // Reconnect to Icepick
        GEL_EvalOnTarget("<parent>", "GEL_EvalOnTarget(\"<parent>\",\"ConnectIfDisconnected()\", 1)", 1);
    
        // Issue mass erase from Icepick and disconnect
        GEL_EvalOnTarget("<parent>", "GEL_EvalOnTarget(\"<parent>\",\"IP_CC26xx_CHIPERASE = 1\", 1)", 1);
        GEL_EvalOnTarget("<parent>", "GEL_EvalOnTarget(\"<parent>\",\"DisconnectIfConnected()\", 1)", 1);
    
        // Workaround on engineering devices. Disconnect and reconnect for chip erase to take effect.
        ConnectIfDisconnected();
        DisconnectIfConnected();
        _isMassErase = 0;
    
        GEL_TextOut("Mass erase complete.\n", "MassErase()");
    }

    When using a jlink a different GEL file cc26x2_jlnk.gel gets loaded. It does not have an equivalent function.  Looking at the function it seems to use the ICEPick to do the mass erase.  It could be that the JLink is not able to use the ICEPick to do that as it is TI specific debug IP.  I will need to loop in the connectivity team to comment.  I suspect that is also impact which flash options are available from CCS.

    Regards,

    John

  • Kazola,

    I was able to confirm that the mass erase option is not available.

    For the other flash options SEGGER is not using the options inside of CCS but is doing this in their software stack somewhere.  Maybe you can configure that via JLink Commander?  I would suggest contacting SEGGER support, they should be able to help with this.

    Regards,
    John