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/CC3220SF-LAUNCHXL: CC3220SF LaunchXL programming Flash

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

Tool/software: Code Composer Studio

Hi Folks,

I Have tried to understand and implement the instructions by Michael in this link to program Energia code into Flash of CC3220SF Launchpad.

Solution from Michael

However, I do not have strong background in Bootloader or Uniflash and need some help to implement Michael's proposal.

Anyone has some step-by-step instructions for programming of flash with an Energia code?

Michael has some references to bootloader, /sys/ folder, *.bin file, etc. Which tool is Michael using? Uniflash? Where is the /sys/ folder he is refering to?

I really appreciate your help.

Thanks,

Sam

  • Part Number: CC3220SF-LAUNCHXL

    Tool/software: Code Composer Studio

    Hi folks,

    I am trying to use Jan's proposal to program launchXL flash with Energia code for CC3220SF.

    My bootloader

    However, I do not have strong background in Bootloader or Uniflash and need some help to implement Jan's proposal.

    Anyone has some step-by-step instructions for programming of flash with an Energia code?

    I really appreciate your help.

    Thanks,

    Sam

  • Hi Sam,

    I'm not an expert of the Energia solution (I've pointed you their forum yesterday to get better support:  http://forum.43oh.com/forum/125-energia-tivaccc3xxx/).

    This forum is focused on the Simplelink SDK solutions.

    However, i believe the problem is that Energia project only supports CC3220S devices, which have different memory configuration and addressing and thus will not work as is on your SF device. The S device executes its application code from the device's 256 KB RAM (both code and data are in the RAM), while an SF device runs from the internal 1MB flash (and the entire RAM can be used for data). 

    Both Jan and Michael solution will enable you to basically avoid the flash and run from the RAM of the SF (as if it an S device).

    If this is the only issue, I think a better solution would be to replace the linker command file of the Energia project to support an SF device. Below are two examples of the linker command files for SF and S

    /cfs-file/__key/communityserver-discussions-components-files/81/CC3220SF_5F00_LAUNCHXL_5F00_TIRTOS.cmd

    /cfs-file/__key/communityserver-discussions-components-files/81/CC3220S_5F00_LAUNCHXL_5F00_TIRTOS.cmd

    If you link your project with the right command file you will get a binary that is ready to be programmed to your device (using Uniflash). Please refer to the following http://www.ti.com/lit/ug/swru469g/swru469g.pdf for details about uniflash (the Energia binary would be your MCU image in this case).

    Again, since i'm not working regularly with the Energia environment, i'm not sure how difficult this would be but it should be feasible. You can try to ask about it in their forum.

    If you are not able to change the linker command setting, you can use either Michael (which uses features in the Advanced mode of Uniflash to write the Energia MCU image directly to RAM) or Jan(which uses an MCU image on the flash just to copy the Energia image to the device RAM) solutions. In both cases, the code will be executed from the RAM and work as in S device.

    The idea in both case is that you write the Energia image not as an MCU image (which in SF device, will be copied to Flash), but as a simple user file. According to Michael's solution if you save Energia binary as a user file called "/sys/mcuimg.bin" - the CC3220 bootloader will directly copy it to the RAM and not to the flash. As Michael mentioned you will need to update the properties of the file to fit an MCU image requirements. 

    Br,

    Kobi

     

  • Hi Kobi,

    Thanks so much for your detailed and prompt response.

    Here is my situation: I need to program CC3220SF using USB (and Energia) and then, unplug USB and run the program standalone without connection to USB.

    I have already applied external 3.3V to the board while programming CC3220SF through USB, and have placed jumpers to enable external supply. I am not applying any external 5V, only 3.3V.

    However, as soon as I unplug USB, program stops running, and I cannot sigure out why.

    I understand that the program is running off RAM when written into CC3220SF.

    I did not expect the disconnection of USB to disrupt an already running program.

    That's why I thought about burning the program into the flash and run it from the flash (rather than RAM) to avoid disruption due to USB unplugging.

    If you guys have any ideas about why USB unplugging  disrupts the program, I could use it as a solution as well.

    Regarding your response, I have a few follow up questions:

    The S device executes its application code from the device's 256 KB RAM (both code and data are in the RAM), while an SF device runs from the internal 1MB flash (and the entire RAM can be used for data). 

    Are you saying that every time I program CC3220SF using Energia/USB, program does not reside in RAM, but resides in flash? It should be running from RAM as I have not used Uniflash to burn into Flash. What do you mean by the above statement?

    Both Jan and Michael solution will enable you to basically avoid the flash and run from the RAM of the SF (as if it an S device).

    I was looking for a solution that would burn the program into flash and upon power up, would run the program automatically. As I mentioned I cannot figure out how to disconnect USB from the board and still have the program running. Also, as you know, if we press the RESET button on LaunchXL, it just clears everything.

    Thanks a lot for your help.

    Sam

  • It looks like you have issues with the power (when usb is not connected). the USB goes through the debug chip XDS which may reset the device upon plugin.

    Anyway, this mode of loading the code through the USB and trying to maintain the system working is only a temporary solution.

    Eventually, you will need to use the external file system (both S and SF device requires an external flash) to store the version, so it will work after reset / power off. And for that you will need to use Uniflash as explained. 

    I guess if you are using Energia, you have already used Uniflash to install a service pack on the file system. You will need to add the mcu image together with a certificate catalog and optionally user files that your application requires.

    You'll need to read the uniflash guide or the Getting Started guide of CC3220 for details.

    SF devie typically run off the internal flash and not from the RAM. After reset, the bootloader of the device will check the content of the file system and copy the MCU image (i.e. your application) to the internal execution memory. In S device - this would be the internal RAM. In SF - this would be the internal 1MB flash (by default SF uses XIP flash for the code, i.e. code is executed from the internal flash, and uses the entire RAM for data).

    The code compiled by Energia is compiled for S device, so the addresses of the code section are in the RAM. If you try to install such file on SF device, where the code is installed on the flash - it won't work.

    So you either you will change the Energia project to compile with the SF address map (as i suggested) or you run from RAM as in the other options.