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.

BOOSTXL-CC3135: Firmware Update

Part Number: BOOSTXL-CC3135
Other Parts Discussed in Thread: CC3135, UNIFLASH, CC3120,

Hi TI Support, 

I would like to ask some questions about flashing the service pack (or the CC3135 embedded firmware ) of my CC3135 : 

  1. Should I only use the Uniflash tool ? Using UART connectivity ? 
  2. Can I use the Host MCU ( an STM32 in my use case ) to flash the service pack of the CC3135 over the SPI ? 
  3. Can I use the Serial Flash to upgrade the service pack of the CC3135 module ? 

I want to update the service pack of the CC3135 using my STM32 microcontroler and it is connected only using SPI interface. 

Regards, 

Ghada. 

  • Hi Ghada,

    The initial programming image (containing the servicepack) must be written using the UART interface. Our primary tool for doing this is the ImageCreator tool in Uniflash. However, it is possible (for production line purposes) to use an external host which implements the bootloader protocol to perform the programming. 

    Please see the production line guide for details:

    http://www.ti.com/lit/swra647

    Your question appears to be about updating the servicepack (firmware) in the field through your host controller though. This is supported by writing the servicepack to the filesystem through the host driver API which will use the SPI interface.

    For an example of how this is done on a host MCU with the CC3120, please refer to the MSP432 OTA example in the Wi-Fi plug-in SDK and the associated training in SimpleLink Academy.

    http://dev.ti.com/tirex/explore/node?node=ABcd3tIkTEyB-4cx9ZIVxA__s6qGmnm__LATEST

    Best Regards,

    Ben M

  • Hi Benjamin , 

    Thank you for your quick response. 

    I'm looking for updating the CC3135 module (not initial programming image). 

    The scope of this update is not by using OTA procedure. I have to update the CC3135 firmware over the host via SPI lines. 

    In the CC3135 SDK, I have found this function : sl_FsProgram, and it is implemented in ProgramImage procedure example. 

    So, Can I use this API to update the firmware of the CC3135 ? 

    Best Regards, 

    Ghada 

  • Hi Ghada,

    Understood. You can use the sl_FsProgram() API to replace the initial programming image used by the CC3135. See section "8.12.1.2.2 Host Programming" in the network processor programmer's guide: 

    http://www.ti.com/lit/swru455

    If you use the sl_FsProgram() API, you overwrite the entire programming image and lose the failsafe capability of the file. This may be okay for the system if the host MCU always has the ability to reload the original image, but it is not recommended as the update mechanism.

    If you just want to update the servicepack over time (even if you are not receiving the data over the Wi-Fi interface as in a traditional OTA update), you can update the servicepack file on the file system using the normal sl_FsOpen/sl_FsWrite APIs while referencing the "/sys/servicepack.ucf" file name. For example -

    /* Below is just a high-level example and not intended to be used directly */
    
    // Open servicepack file
    fileHandle = sl_FsOpen("/sys/servicepack.ucf", FsOpenFlags| SL_FS_CREATE_MAX_SIZE( FileSize ), (unsigned long *)&ulToken);
    
    
    // Write new content - may need to be done in multiple chunks with while loop
    status = sl_FsWrite(fileHandle, offset, dataBuf, length);
    ...
    
    // Close the servicepack file with servicepack signature file
    status = sl_FsClose(fileHandle, 0, (unsigned char *)servicePackImageSig, sizeof(servicePackImageSig));

    Best Regards,

    Ben M

  • Hi 

    In this case, what is the difference between the sl_FsWrite and the sl_FsProgram API ? 

    theses two functions aims to write the ucf service pack file of the CC3135. 

    The ucf file is generated from Uniflash tool or is found in \simplelink_sdk_wifi_plugin_2_40_00_22\tools\cc31xx_tools\servicepack-cc3x35, it is right ? 

    Best Regards, 

    Ghada. 

  • Hi 

    I finally found the difference between the sl_FsWrite() and sl_FsProgram(). 

    In fact, the sl_FsWrite() writes only one opened file of the Flash memory, contrariwise, the sl_FsProgram write the entire Flash memory of the BOOSTXL-CC3135 module. It's right ? 

    I am finnaly able to update the CC3135 Firmware over host SPI thanks to the sl_FsProgram API, and I knows that this operation lose the failsafe capability of the CC3135 module. 

    But unfortunately, the update of the service pack file using sl_FsWrite API failed, 

    In fact, I used this code source: 

        //     Open servicepack file
        fileHandle = sl_FsOpen("/sys/servicepack.ucf",  SL_FS_OVERWRITE 
                               |SL_FS_CREATE_SECURE |SL_FS_CREATE_PUBLIC_WRITE| 
                                 SL_FS_CREATE_FAILSAFE , (unsigned long *)&ulToken);
        
        offset = 0; 
        do
        { 
          if (len < WRITE_CHUNK_SIZE) 
          { 
            writeLen = len; 
          } 
          else 
          { 
            writeLen = WRITE_CHUNK_SIZE; 
          } 
          status = sl_FsWrite(fileHandle, offset, &(buf[offset]), writeLen); 
          offset += writeLen; 
          len -= writeLen; 
        }while ( len > 0); 
        
        
        //     Close the servicepack file with servicepack signature file
        status = sl_FsClose(fileHandle, NULL, (unsigned char *)servicePackImageSig,0);

    the WRITE_CHUNK_SIZE is equal to 1500, and the buff represents the 4.1.0.28_3.1.0.5_3.1.0.17.ucf service pack file that I found under simplelink_sdk_wifi_plugin_2_40_00_22\tools\cc31xx_tools\servicepack-cc3x35. 

    This Procedure fails on the sl_FsClose function, it returns SL_ERROR_FS_ILLEGAL_SIGNATURE, I think that I should add servicePackImageSig value, but in document datasheet, it is written that "When closing (after open for write) the service pack file or the trusted root-certificate catalog file, a signature must be supplied with a null certificate". that's why I putted a Null certificate and signature value. 

    So why It fails? 

    What did I miss ? 

    Next, After performing several tests, I have some more questions: 

    1. After Program procedure, It is recommended to power Off and On the CC3135 module in order to use the newer version of the programed image. So, is there any flow or description that indicates how the CC3135 module jumps to the new image that it detects on the External flash memory ? 
    2. In case of error of programming and let's guess that I have neither UART or External SPI flash programmer, how should i proceed for restoring the CC3135 module? Is there any factory default image that let me in any time restore it ? 

    Thank you for your help. 

    Ghada. 

  • Hi Ghada,

    Yes, you are correct in your understanding of the difference between the API calls.

    The signature you should use when closing the servicepack should not be null. It should be the matching "xx.ucf.signed.bin" file for the servicepack that you are loading.

    You can use the servicepack from the WiFi plug-in as you are doing for your test, but I recommend you move to our latest servicepack release for the CC3x35 devices soon. The servicepack for the CC3135 and the CC3235 devices are the same and, due to the release cadence for the Wi-Fi plug-in, the servicepack included in the plug-in is not the latest. The latest servicepack is available in the same directory of the CC32xx SDK. I recommend you download this and pull the servicepack from it -

    http://www.ti.com/tool/download/SIMPLELINK-CC32XX-SDK

    Regarding your additional questions -

    1. We don't have documentation that describes the overall flow for the process, but in general the device has an embedded bootloader that will detect the new gang image and extract that into the filesystem on a reset.

    2. The SimpleLink Wi-Fi devices do support a restore to factory mechanism. Please see section 8.13 of the Network Processor Programmer's guide (http://www.ti.com/lit/swru455). Note that a call to the sl_FsProgram API will cause the default factory image to be overwritten. Using sl_FsWrite only on the servicepack, you will be able to safely transition the servicepack file and have the ability to maintain the factory default.

    Best Regards,

    Ben M