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.

CC3220SF-LAUNCHXL: Retaining code on internal flash after reset

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: UNIFLASH, CC3220SF

Hi,

I am trying to load a .bin file on flash using CCS debug option, however after reset the code is not retained. 

After going through some posts  I got to know that, on reset the code from serial flash is loaded, and for internal flash to retain the code, flags like _SF_DEBUG_ and retain ulDebugHeader are to be added. 

After adding flags the code is not retained on internal-flash after reset. Due to some constraints it is not possible to use uniflash as of now.

Please suggest ways to retain code on internal-flash using CCS debug option.

Thank you,

Aditya

  • Hi Aditya,

    As you mentioned, those compiler/linker flags allow for retaining the internal flash program that was loaded by the debugger. This E2E post goes into the full explanation:
    e2e.ti.com/.../2160853

    One thing to clairify is that for the steps above to work, the external flash must not have a valid mcu binary image. Otherwise, the bootloader will still overwrite the internal flash contents with the external flash binary image. Thus, you need to use Uniflash at least once, to remove the binary image that is on your external flash. When I tested the above steps, flashing a Uniflash project with no MCU image allowed for the debug flags to work, making the debug image persistent on the CC3220SF.

    Out of curiosity, what constraints are preventing you from using Uniflash? There might be some workaround for your constraints. Failing that, if you absolutely cannot use Uniflash to remove your binary from the external flash, I can look further into the possibility of deleting the MCU image using sl_Fs* calls in the host application.

    Regards,
    Michael
  • Hi Michael,

    Thank you for the detailed explanation. Tried the steps on launch-pad after removing a valid binary on serial flash (missed earlier), and its working fine.
    However, on my project hardware I do not have accessibility to UART pins(HW constraint). Any workaround for the same?


    Thank you,
    Aditya
  • Hi Aditya,

    You can flash a gang image directly onto the external SPI flash using a generic SPI flashing tool. See the production line guide for details:
    www.ti.com/.../swra568.pdf
    You would use your no-MCU-image Uniflash project and create the gang image out of that, and after replacing the contents of your external flash with your gang image, you should be able to use the debug flag to persistently store code on the internal flash.

    In the future, I would recommend having the UART pins accessible to allow for easier programming and debug.

    Regards,
    Michael