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/CC3220MODA: Firmware does not work with CC3220SF after flashing with Image Creator

Part Number: CC3220MODA
Other Parts Discussed in Thread: UNIFLASH, CC3220SF, ENERGIA, CC3220S

Tool/software: Code Composer Studio


I have created a new project with UniFlash/Image Creator, added dummy keys, the Service Pack and mcuflashimg.bin.

When I select the binary of serial_wifi_CC3220SF_LAUNCHXL_tirtos_gcc, it starts OK and prints some info after board power-up.

However, when I flash any (even simplest) Energia sketch (.bin), it fails to start. Nothing is printed to the console. The same Energia sketch runs OK using the CCS debugger.

I use the same project and keys, just the bin file is changed.
I'm using CC3220SF module + an external XDS110 from MSP432 LaunchPad on Linux.


  • Hi Volodymyr,

    The CC3220 support for Energia is still in Beta, and it does not support flashing to persistent storage, only to RAM. Not sure why the binary doesn't work when you try flashing with Uniflash, given that the Energia seems to be calling the same .bin generation tool that is called when you compile an SDK example project with gcc/ccs.

    As this forum has to do with SimpleLink Wi-Fi product-specific support, we are unable to offer further Energia help.
    Please see the 43oh forum for Energia questions: https://43oh.com/

    Regards,
    Michael
  • Hi Volodymyr,

    So it looks like Energia does not correctly build the code in order for it to run on the CC3220SF. This is because it maps all code to SRAM and doesn't actually utilize the internal flash on the SF part. The bootloader of the SF expects there to be code on the internal flash and not the SRAM which is why it fails to start the device after you flash it with Uniflash. With the debugger, you can load the code into SRAM and point the PC to your code in SRAM, which is why you can use JTAG to load and run your energia sketches.

    I hope that clears up why energia .bin files do not work on the CC3220SF properly. As I mentioned before, energia-related applications are not supported on this forum, so if you have further energia questions please post them at the energia forum: forum.43oh.com/.../

    Regards,
    Michael
  • Hi,

    Michael, well described.

    It looks relatively easy to create workaround for this issue till be SF fully supported by Energia. If somebody will be interested, maybe I will be able create small bootloader for this purpose.

    Jan
  • Hey... I'm interested!

  • Hi,

    During few days I will look on it.

    Jan
  • Hi,

    I have functional concept. It was easier than I expect. Now I need slightly to polished the code and release it here in next few days.

    Jan
  • Wow! wonderful news, thanks!

  • Hi All,

    Here is a raw and very unoptimised version of bootloader which allow to run binary generated by Energia at CC3220SF chip. I will be happy, if someone will be able test this bootlaoder. I tested it only at blinky example from Energia 18 actually. Please report any issues.

    How can be used:

    - file boot-energia.bin need to be uploaded by Uniflash as MCU image (including all certificates, keys, etc. - see http://www.ti.com/lit/pdf/swru469 )

    - file generated by Energia need to be uploaded into file energia.bin

    Reporting errors at UART:

    In case of issue is message on UART (115200bd) shown and bootloader is halted.

    Know issues:

    - booting take long time - approximately 5sec

    - Energia code sometimes not boot up (not investigated yet what is going on)

    Bootlaoder file (boot-energia.bin):

    boot-energia.zip

    Jan

  • Thank you.  I will report back later today when I have some time to attempt.

  • Jan,

    I am a bit confused on this step:

    "file generated by Energia need to be uploaded into file energia.bin"

    Currently I have created my own custom code with CCS (in the Energia sketch) and generated an 'abc.bin' file.  

    I uploaded your boot-energia.bin file with Uniflash and see the below picture now in Putty:

    How exactly do I proceed from here to flash my custom abc.bin file?

  • Hi Ryan,

    You simply need to name the bin file that is generated by Energia as 'energia.bin' before flashing it onto the CC3220SF in uniflash. You don't need to rename your abc.bin file on your PC's filesystem, but you just need to name it to energia.bin in the add file interaction in Uniflash so that on the CC3220SF's external flash you have it named as energia.bin.

    Jan:

    Thanks a lot for creating this bootloader. I have been trying to figure out why Energia doesn't generate the CC3220SF binary properly, and it seems like Energia uses the CC3220S linker file for both CC3220S+SF projects. I've been trying to get Energia to build with the CC3220SF gcc linker file we have in the SDK, but there's some problem with the generated .bin. While I can now get Energia to properly put code in the internal flash of the CC3220SF, there's some still some memory allocation problem as the generated .bin is ridiculously large in size (~500MB).

    I tested your bootloader with a more complex energia example with networking(docs.exosite.com/.../ ), and it seems to work like a charm so far. While Energia support for the CC3220SF is being developed and debugged, your bootloader will undoubtedly be valuable for users who want to keep Energia code persistently on their CC3220. I really appreciate the work you have put in making this work.

    Regards,
    Michael

  • Hi Michael,

    Yes, I agree that this few lines of code is one ugly workaround only, till not be SF devices fully supported by Energia. I am pretty surprised that it works even with large binaries from Energia. My observations with the linker file for CC3220SF was same as yours.

    This code expects that binary is linked into RAM with entry-point 0x20004000. RAM stuff is linked into first 16kB. That few lines of code do this only:
    - turn-on NWP
    - open file 'energia.bin' and load content of file to RAM from address 0x20004000
    - close file and turn-off NWP
    - jump to entry-point 0x20004000

    I am contributing to this forum (CC31xx/CC32xx) only few years, but I need to say that yours answers are superb and accurate. That quality of answers was not here before. Keep up the good work. But if I may a comment. In case you inserting link into braces, do not forget insert space after link.


    Ryan:

    Michael have right. You need upload your file 'abc.bin' into sFlash with name 'energia.bin'.

    Jan

  • Thanks everyone!  This worked great!