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.

CC3220S-LAUNCHXL: How to flush ServericePack using host driver API?

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

in simplelink_cc32xx_sdk_1_30_01_03 file:///C:/ti/simplelink_cc32xx_sdk_1_30_01_03/tools/cc32xx_tools/servicepack-cc3x20/README.html

it said that

The ServicePack can also be flushed using host driver API’s or OTA application (please refer for the SimpleLink CC3x20 SDK for more information)

how to do it? which API can operate the ServicePack?

  • Hello,

    First, you are using an older SDK. It is recommended to upgrade to the latest 1.50.00.06.

    Regarding writing the servicepack from the host, please see instructions below:

    /* if cc3220r or cc3220s, use 256KB --> 262144
       if cc3220sf, use 512KB --> 524288 */
    
       FileSize = 262144;
       FsOpenFlags = SL_FS_CREATE | SL_FS_OVERWRITE | SL_FS_CREATE_FAILSAFE | SL_FS_CREATE_SECURE | SL_FS_CREATE_PUBLIC_WRITE;
       lFileHandle = sl_FsOpen((uint8_t *)pFileName,	FsOpenFlags | SL_FS_CREATE_MAX_SIZE( FileSize ), (unsigned long *)&ulToken);
       Status = sl_FsWrite(lFileHandle, 0, (uint8_t *)Buf, strlen(Buf));	// assuming the buffer includes all the data required, otherwise, write in chunks with moving offset
       Status = sl_FsClose(lFileHandle, NULL , (uint8_t *)pSignBuf, SignLen);	// signature buffer and length corresponds to the signature file of the servicepack. should be 256

    Regards,

    Shlomi

  • Thank you!

    There are 4 more question I want to know.

    1. What value of ulToken should be assigned in sl_FsOpen?

    2. Is pFileName = "/sp_3.3.0.0_2.0.0.0_2.2.0.4.bin" or pFileName = "/sys/sp_3.3.0.0_2.0.0.0_2.2.0.4.bin"?

    3. I find the sp_3.3.0.0_2.0.0.0_2.2.0.4.ucf.signed.bin in C:\ti\simplelink_cc32xx_sdk_1_30_01_03\tools\cc32xx_tools\servicepack-cc3x20.

    Do I need add this file to my uniflash project in location such as /sys/sp_3.3.0.0_2.0.0.0_2.2.0.4.ucf.signed.bin?

    Then assign pSignBuf = "/sys/sp_3.3.0.0_2.0.0.0_2.2.0.4.ucf.signed.bin" and SignLen = 256?

    4. Do I need update the file named sp_3.5.0.0_2.0.0.0_2.2.0.5.ucf in SDK and named servicepack.ucf I got it from my CC3220S by uniflash?

    Is the way to update this file is same as the  /sp_3.3.0.0_2.0.0.0_2.2.0.4.bin?

    Thank you for give me more information about this !

  • Hi,

    You can read more in the NWP guide, chapter 8. It is here http://www.ti.com/lit/ug/swru455c/swru455c.pdf

    Regarding your questions:

    •  What value of ulToken should be assigned in sl_FsOpen?

    since the servicepack is opened as PUBLIC_WRITE, you do not need to supply a token. You can leave it NULL

    • Is pFileName = "/sp_3.3.0.0_2.0.0.0_2.2.0.4.bin" or pFileName = "/sys/sp_3.3.0.0_2.0.0.0_2.2.0.4.bin"?

    the servicepack filename is reserved. It is '/sys/servicepack.ucf'

    • I find the sp_3.3.0.0_2.0.0.0_2.2.0.4.ucf.signed.bin in C:\ti\simplelink_cc32xx_sdk_1_30_01_03\tools\cc32xx_tools\servicepack-cc3x20. Do I need add this file to my uniflash project in location such as /sys/sp_3.3.0.0_2.0.0.0_2.2.0.4.ucf.signed.bin?

    no, the signature is used when you call sl_FsClose().

    • Then assign pSignBuf = "/sys/sp_3.3.0.0_2.0.0.0_2.2.0.4.ucf.signed.bin" and SignLen = 256?

    the length is 256 but the pointer should point to the 256 bytes array, not the filename.

    • Do I need update the file named sp_3.5.0.0_2.0.0.0_2.2.0.5.ucf in SDK and named servicepack.ucf I got it from my CC3220S by uniflash?

    As I said, the filename should be '/sys/servicepack.ucf'

    • Is the way to update this file is same as the  /sp_3.3.0.0_2.0.0.0_2.2.0.4.bin?

    the bin file is for Uniflash only. It contains the *.ucf and its signature together with some metadata. It is not used with programming via your host

  • Thank you!

    • Then assign pSignBuf = "/sys/sp_3.3.0.0_2.0.0.0_2.2.0.4.ucf.signed.bin" and SignLen = 256?

    the length is 256 but the pointer should point to the 256 bytes array, not the filename.

    for this question, 

    1. Is the way to get the 256 bytes array is open the ucf.signed.bin for read and read this file to the pSignBuf buffer array? What is the name stored in CC3220S and I can open it for read?

    2. I'm updating the /sys/servicepack.ucf, do I need update the signed.bin of this ucf file first then use it for Status = sl_FsClose(lFileHandle, NULL , (uint8_t *)pSignBuf, SignLen); close the open for write  /sys/servicepack.ucf? Also what's name of the signed.bin of this ucf?

  • Hello,

    1. Is the way to get the 256 bytes array is open the ucf.signed.bin for read and read this file to the pSignBuf buffer array? What is the name stored in CC3220S and I can open it for read?

    [shlomi] yes, you can open and read the 256 bytes and place it in an array. Then, pass it to the argument of sl_FsClose(). It is not stored anywhere on the file system and you cannot read it. It is just passed during closing a file and verified on-the-fly by the device.

    2. I'm updating the /sys/servicepack.ucf, do I need update the signed.bin of this ucf file first then use it for Status = sl_FsClose(lFileHandle, NULL , (uint8_t *)pSignBuf, SignLen); close the open for write  /sys/servicepack.ucf? Also what's name of the signed.bin of this ucf?

    [shlomi] again, the signed.bin signature needs to be supplied during closing the file and it is not stored anywhere.

    Shlomi

  • I got it. Thank you very much!