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: Issues getting the cloud_ota example working

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

Hey guys,

I am trying to run your cloud_ota example on my Launch-CC3220MODASF dev kit using a dropbox server. I feel like I am setting everything up right, but Uniflash is giving me the following error when I try to flash the device: Operation failed: Image creation failure: Error ! Signature file name is empty 

Here is what I have done, let me know what seems incorrect:

1. I created a dropbox account and added a developer app (which I generated a token for), it looks like this:

2. There is now a folder in my dropbox account titled FLECK_TEST_OTA, just like my app in my developers account. I added a folder inside that titled OTA_CC3220SF, to match the vendor directory defined in otauser.h in the cloud_ota example. The definition looks like: #define OTA_VENDOR_DIR "OTA_CC3220SF"

3. In otauser.h I defined the OTA_VENDOR_TOKEN as the value I generated in my app in step 1 under "Generated access token". I also defined SL_ENABLE_OTA_DEBUG_TRACES and DISABLE_OTA_SWITCH_TRIGGER in otauser.h and cloud_ota.c, as described in the instructions.

4. This is where things started to get confusing. I opened up Uniflash while my board was connected and waited for Uniflash to find it under Detected Devices. I then hit start. On the next screen I created a new project titled OTA.

5. Under Files->Trusted Root-Certificate Catalog I added the following files:

For the Source File I put: ti\simplelink_cc32xx_sdk_2_40_02_00\tools\cc32xx_tools\certificate-playground\certcatalogPlayGround20160911.lst

For the Signature Source File I put: ti\simplelink_cc32xx_sdk_2_40_02_00\tools\cc32xx_tools\certificate-playground\certcatalogPlayGround20160911.lst.signed_3220.bin

It looks like this:

This step concerns me as the instructions weren't super explicit about what to put here. Did I use the correct files in this step??

6. Under User Files I added a folder titled "sys" and added the .bin file I got when I compiled the cloud_ota example. I renamed it to mcuflashimg.bin and put the following properties:

7. This is another step that I'm concerned I did improperly. I now added the following files to the root directory:

ti\simplelink_cc32xx_sdk_2_40_02_00\tools\cc32xx_tools\certificate-playground\dummy-root-ca-cert

ti\simplelink_cc32xx_sdk_2_40_02_00\tools\cc32xx_tools\certificate-playground\dummy-trusted-ca-cert

 ti\simplelink_cc32xx_sdk_2_40_02_00\tools\cc32xx_tools\certificate-playground\dummy-trusted-cert

I wasn't sure at all what to add for the Dropbox certificate. I downloaded digicerthighassuraceevrootca.crt from Dropbox's website and added that as well. I believe it was called DigiCert High Assurance EV Root CA and came from this page: https://www.digicert.com/digicert-root-certificates.htmIs this the proper certificate I need from Dropbox? Where do I find the proper Dropbox certificate and does it need a specific name? The instructions were incredibly vague about this part so I'm pretty certain this part is incorrect.

My User Files now look like this:

8. I clicked the Burn button and then Create OTA. I named it 20191114 (today's date in YYYYMMDD format, as suggested in the instructions) and saved it. I then placed the .tar file that it produced in Dropbox under FLECK_TEST_OTA->OTA_CC3220SF. I assume that I just place the .tar file in there? I don't need to extract the folders/files within and put them in there instead?

9. I connected to my board with the Connect button and then pressed Program Image (Create & Program), and it gave me the following error: Operation failed: Image creation failure: Error ! Signature file name is empty 

I don't really understand why I'm getting that error as I did enter a Signature Source File name in Step 5. I looked through all of the tabs and didn't see anything that was left blank either. Why is there an issue programming the board?

Thanks for the help,

Charles

  • Hi Charles,

    Try dummy-trusted-cert-key instead of dummy-trusted-ca-cert-key for the mcu image. Also dummy-trusted-cert for the certificate file name option.

    Jesu

  • Hey Jesu,

    I'm not 100% sure what you meant, but I did the following:

    1. I added the dummy-trusted-cert-key to the User Files, as shown below.

    2. Under the mcuflashimg.bin I changed the Private Key File Name to dummy-trusted-cert-key and the Certification File Name to dummy-trusted-cert, as shown below.

     

    When I tried to program I still had the same issue, so this does not appear to have been the problem.

    Thanks!

    Charles

  • That is what I meant!

    Did you follow our OTA setup guide? I have personally followed this myself and get it working with dropbox. Task 2 step 6 shows you how to get the root CA. Please follow the steps closely. It is also a bit of a tutorial so all the steps are necessary but you should still end up with a working example by task 6.

    http://dev.ti.com/tirex/explore/node?node=ACE5ggZRybEJNZUcnzc3ww__fc2e6sr__LATEST

    Jesu

  • Hey Jesu,

    It looks like the guide that you posted is different than the one that I've been using. I'm a little confused about what I should be doing on the Trusted Root-Certificate Catalog tab in Uniflash. Should I be using the default Trusted Root-Certificate Catalog? Or which Source File and Signature Source File should I be using?

    The User Files in there look different than in the guide I was using as well, so I will try replicating this guide and see if that fixes the problem. I'll update what happens with that.

    Thanks again,

    Charles

  • I tried changing the certs used on the User Files page and I still got the same error as before: Operation failed: Image creation failure: Error ! Signature file name is empty 

  • Hi Charles,

    You shouldn't have to do anything with the catalog. By default my Uniflash project is like this: I believe default option will work as well.

    It does not seem this problem is even OTA related. Could you check if you have the secure option checked for any of your user files apart from mcuimg? I can purposefully re-create this problem by checking the secure option on a file and not providing a private key/signature file + certificate.

    Jesu

  • Hey Jesu,

    I actually got it to program by just deleting my Uniflash project and starting over. I am now having a new issue where my device doesn't seem to be connecting to the dropbox server. This is what I'm seeing:

    HandlePingComplete: OTA Command arrived
    OtaInit: statistics = 0, 0, 0
    OtaInit: call Ota_init
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=4956
    OTA_init: sizeof OtaLib_t=7736, sizeof OTA_memBlock=7800
    OTA_init: OTA lib version = OTA_LIB_2.0.0.7
    OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4
    OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_SERVER_INFO,ServerName=api.dropboxapi.com
    OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_CC3220SF
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com
    HttpClient_Connect: IP_ADDR=162.125.1.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=1/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue fornext OTA retry

    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com
    HttpClient_Connect: IP_ADDR=162.125.1.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=2/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue fornext OTA retry

    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com
    HttpClient_Connect: IP_ADDR=162.125.1.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=3/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue fornext OTA retry

    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com
    HttpClient_Connect: IP_ADDR=162.125.1.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=4/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20006, continue fornext OTA retry

    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com
    HttpClient_Connect: IP_ADDR=162.125.1.7
    HttpClient_Connect: ERROR Socket Connect, status=-456
    CdnClient_ConnectServer: ERROR HttpClient_Connect, Status=-20304
    OTA_run: ERROR CdnClient_ConnectServer, Status=-20304

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=5/5, MAX_CONSECUTIVE_OTA_ERRORS!!!
    OtaRunStep: ignore it just for loop testing

    It doesn't look like it's even getting to the point where it needs a certificate. Any ideas?

    Thanks again,

    Charles

  • Hi Charles,

    The logs show you're getting a -456 error which indicates you're using the wrong root CA. Did you follow task 2 step 6 in our OTA guide like I mentioned before?

    Jesu

  • Hey Jesu,

    Good catch! I had a typo, I wrote .cert instead of .crt. I'm now having a new issue that I'm struggling with. This is what I'm seeing (I only posted one iteration of the error as it's pretty long):

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=3/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20009, continue fornext OTA retry

    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com
    HttpClient_Connect: IP_ADDR=162.125.7.7
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220SF
    CdnDropbox_SendReqDir: uri=/2/files/list_folder
    RespLen is 746, ProcessedSize is: 741
    the entire JSON pRespBuf is: OtaDir FileName=/OTA_CC3220SF/20191120111245_CC3220SF_OTA.tar, FileSize=163840
    OTA_run: CdnClient_ReqOtaDir, NumDirFiles=1
    OTA_run: CdnClient_GetNextDirFile
    OTA_run: CdnClient_GetNextDirFile: file=/OTA_CC3220SF/20191120111245_CC3220SF_OTA.tar, size=163840
    OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4
    _ReadOtaVersionFile: file ota.dat, status=SL_ERROR_FS_FILE_NOT_EXISTS
    OtaArchive_CheckVersion: can't open version file, sign it as old version
    OtaArchive_CheckVersion: accept the new version = 20191120111245_CC3220SF_OTA.tar
    OtaRunStep: status from Ota_run: OTA_RUN_STATUS_CHECK_NEWER_VERSION, accept and continue
    _ReadOtaVersionFile: file ota.dat, status=SL_ERROR_FS_FILE_NOT_EXISTS
    OtaRunStep: CurrentVersion=00000000000000, NewVersion=20191120111245, Start download ...
    OTA_run: Call CdnClient_ReqFileUrl, filename = /OTA_CC3220SF/20191120111245_CC3220SF_OTA.tar
    CdnDropbox_SendReqFileUrl: uri=/2/files/get_temporary_link
    HTTP request is:
    POST /2/files/get_temporary_link HTTP/1.1
    host: api.dropboxapi.com
    Authorization: Bearer Nse_bog76rAAAAAAAAAAM-eOg9fCg7UhemXTAogoFud3h2aG6z78NYxHnWL4VFJa
    Content-Type: Application/Json
    Content-Length: 57

    {"path": "/OTA_CC3220SF/20191120111245_CC3220SF_OTA.tar"}

    OTA_run: Call CdnClient_ConnectFileServer, url = dl.dropboxusercontent.com/.../AO7qBT47-JzP6WkMlt3me4NIF9D_CvZdQoTYEuHa4mp8Sq-BCT7ghVu-J36xACNBkibAOrLZ2mybs9vSugcyEfUkSvzyGzhj7j_WNmylACk8-kXMFNp3ol3RDGNZUBd4hqWzNFVvMA0-7uxcWXWjTGW7kniWYZfISo_MNW9Pthj7CZdh65xkJ5sTSWfYZ4Z8cJjNOm9UkKkbSycJVMwJr_mv2ED1ViWv2AlJoLlBppXrbQOhnnUmvwYQmQcOu4g5XwhiCi5rnfM2iGYivQUiDek-cIirz7GpS8_wi4EOStYAxtSJKCqRsbMRmk3CK7cDZeJboc7Hceu4AVwsryudvx3UnMr4VPVZij4-FQp0lnmIZXqymGbDBNlOcTZcDMztn6M
    HttpClient_Connect: IP_ADDR=162.125.7.6
    HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
    OTA_run: Call CdnClient_ReqFileContent, url = dl.dropboxusercontent.com/.../AO7qBT47-JzP6WkMlt3me4NIF9D_CvZdQoTYEuHa4mp8Sq-BCT7ghVu-J36xACNBkibAOrLZ2mybs9vSugcyEfUkSvzyGzhj7j_WNmylACk8-kXMFNp3ol3RDGNZUBd4hqWzNFVvMA0-7uxcWXWjTGW7kniWYZfISo_MNW9Pthj7CZdh65xkJ5sTSWfYZ4Z8cJjNOm9UkKkbSycJVMwJr_mv2ED1ViWv2AlJoLlBppXrbQOhnnUmvwYQmQcOu4g5XwhiCi5rnfM2iGYivQUiDek-cIirz7GpS8_wi4EOStYAxtSJKCqRsbMRmk3CK7cDZeJboc7Hceu4AVwsryudvx3UnMr4VPVZij4-FQp0lnmIZXqymGbDBNlOcTZcDMztn6M
    CdnDropbox_SendReqFileContent: file=/apitl/1/AO7qBT47-JzP6WkMlt3me4NIF9D_CvZdQoTYEuHa4mp8Sq-BCT7ghVu-J36xACNBkibAOrLZ2mybs9vSugcyEfUkSvzyGzhj7j_WNmylACk8-kXMFNp3ol3RDGNZUBd4hqWzNFVvMA0-7uxcWXWjTGW7kniWYZfISo_MNW9Pthj7CZdh65xkJ5sTSWfYZ4Z8cJjNOm9UkKkbSycJVMwJr_mv2ED1ViWv2AlJoLlBppXrbQOhnnUmvwYQmQcOu4g5XwhiCi5rnfM2iGYivQUiDek-cIirz7GpS8_wi4EOStYAxtSJKCqRsbMRmk3CK7cDZeJboc7Hceu4AVwsryudvx3UnMr4VPVZij4-FQp0lnmIZXqymGbDBNlOcTZcDMztn6M
    OtaArchive_RunParse: set state=ARCHIVE_STATE_PARSE_HDR
    OtaArchive_RunParseTar: parsing archive file header
    OtaArchive_RunParseTar: filetype=5, directory=20191120111245_CC3220SF_OTA/
    OtaArchive_RunParseTar: parsing archive file header
    OtaArchive_RunParseTar: filetype=5, directory=20191120111245_CC3220SF_OTA/0/
    OtaArchive_RunParseTar: parsing archive file header
    OtaArchive_RunParseTar: filetype=5, directory=20191120111245_CC3220SF_OTA/1/
    OtaArchive_RunParseTar: parsing archive file header
    OtaArchive_RunParseTar: filetype=5, directory=20191120111245_CC3220SF_OTA/2/
    OtaArchive_RunParseTar: parsing archive file header
    OtaArchive_RunParseTar: FileType=0, FileName=ota.cmd, FileSize=2156
    OtaArchive_RunParseTar: ERROR in _BundleCmdFile_Parse, Status=-1
    OTA_run: ERROR OtaArchive_RunParse, Status=-1

    _OtaCheckConsecutiveErrors: ConsecutiveOtaErrors=4/5, return only WARNNING
    OtaRunStep: WARNING Ota_run, Status=20009, continue fornext OTA retry

    I found a similar thread that had the same issue here: https://e2e.ti.com/support/wireless-connectivity/wifi/f/968/t/629090

    But the answer doesn't seem to make sense to me. They said that they weren't using the latest version of Uniflash, but we are using a much more current version than even existed back then. I am on 5.0, so I could update to 5.2, but that doesn't seem like it makes sense. Is there anything else I could be missing? Am I supposed to be generating my own certificates and keys? I assumed the demonstration ones would work with Dropbox.

    I did notice that I was initially using the wrong SDK instruction guide, so I did update my certificates to match that. Here are pictures of what my certificates look like right now:

    Thanks again for the help!

    Charles

  • You're welcome Charles.

    What key did you use to generate the OTA image?

    Jesu

  • Hey Jesu,

    I used the dummy_ota_vendor_key.der file when generating the OTA image.

    Thanks!

    Charles

  • Hmmm. Did you set OTA_VENDOR_DIR according to the name of the directory in your Dropbox? I'm referring to the steps in task 5. Keep in mind you have to rebuild the ota project then your project for the changes to take effect and finally create a new image if you had to make a change.

    Jesu

  • Hey Jesu,

    I'm not sure I actually rebuilt the OTA project, but it does look like it's looking in the right spots. In the printout I just sent it has the proper path and the proper bearer token. It's possible it's getting that from Dropbox, though, I suppose. What's the easiest way to rebuild the ota project? Is there a tool for that?

    Thanks!

    Charles

  • A small update: I changes the OTA_VENDOR_TOKEN value in the otauser.h file and I was no longer able to access Dropbox, so it looks like my changes to otauser.h are taking affect even though I'm not rebuilding the library?

    Thanks!

    Charles

  • Hi Charles,

    Your changes should not reflect when running the example unless you build the ota library or you have the ota project as a dependency to your application project but it is not like that by default. Basically any time you change an OTA file you have to rebuilt the OTA library. Either way to build you just right click on the ota project you imported in the project explorer window and click rebuild in the pop up drop down. Make sure to build your application project after.

    Jesu

  • Hey Jesu,

    You were right, I wasn't compiling the ota library! It looks like it's working now.

    Thanks so much for the help!

    Charles