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.

RTOS/CC3220SF-LAUNCHXL: cc3220 OTA update problem

Part Number: CC3220SF-LAUNCHXL

Tool/software: TI-RTOS

Hey,

I am trying to use cloud ota example but have some issues according to the update guide. I use dropbox v2 as a server, made everything as the document but i have can not connected to file server[20006] issue. 

In fact i have some questions about these things: 

- The document uses the repository name as OTA_V2 but in otauser.h it uses #define OTA_VENDOR_DIR  "OTA_V2_MCU" :

Does it means if i use xxxx as a api name, do i have to use xxxx_MCU name for the ota vendor dir?

- After that, is all my need is changing ota vendor token and build the gmake.exe file and build the project? I think it is not all secured for the internet and dropbox connection, for example how can this demo example takes the https certification, date and time etc. I cannot see this parts when i was checking the code, so it seems a little mixed.

Thanks!

  • Hi taylanb,

    Please check out the SimpleLink Academy OTA lab: dev.ti.com/.../
    It has step-by-step instructions on the OTA process and how to obtain certificates for your server.

    Best regards,
    Sarah
  • Thanks Sarah, today i resolved naming issue but i have still problems about connecting. I have the same error code(OTA_RUN_STATUS_CONTINUE_WARNING_FAILED_CONNECT_FILE_SERVER (+20006L)), and for example i have tried this code snipped given in OTA Lab, sent below, and i had no error on uart .

    I think there is a SSL, TLS connection issue. All configurations are like the documents said now. Maybe you can check my configs if i send screenshots?

    Thanks!



    switch (pSock->SocketAsyncEvent.SockAsyncData.Type)
    {
    case SL_SSL_NOTIFICATION_WRONG_ROOT_CA:
    /* on socket error Restart OTA */
    UART_PRINT("SL_SOCKET_ASYNC_EVENT: ERROR - WRONG ROOT CA\n\r");
    UART_PRINT("Please install the following Root Certificate:\n\r");
    UART_PRINT(" %s\n\r", pSock->SocketAsyncEvent.SockAsyncData.pExtraInfo);
    SignalEvent(APP_EVENT_RESTART);
    break;

    default:
    /* on socket error Restart OTA */
    UART_PRINT("SL_SOCKET_ASYNC_EVENT socket event %d, do restart\n\r", pSock->Event);
    SignalEvent(APP_EVENT_RESTART);
    break;
    }
  • The code:

    The Dropbox api

    And the information from uart

    And thats why i used "DigiCert_SHA2_Extended_Validation_Server_CA.der" file, i downloaded it using this information: 

  • Hi taylanb,

    Can you define SL_ENABLE_OTA_DEBUG_TRACES in your otauser.h? It should be commented out. Then rebuild your library and application.

    Best regards,
    Sarah
  • Hi Sarah,

    It is not commented out. Maybe there is a problem in gmake.exe compiling if you say it looks like commented out?

  • Hi,
    I'm trying to find a way to solve the problem and figured this post, shared below. Do Josh means cloudOta example can't be tried using these certificates or this can be tried only for this code and can not assigned for any else examples? I don't have any else certificate file except inside the sdk.

    This is the posts URL: e2e.ti.com/.../623932


    And the post:

    Dear Vladimir -
    if you see Section 3.2 of this guide:

    dev.ti.com/.../Over_The_Air_Update_Guide.html

    you will see the dummy certificate for this is located in this folder: C:\ti\simplelink_cc32xx_sdk_1_50_00_06\tools\cc32xx_tools\ota-example-cert

    this is used to test that this is working in your applicaiton, but not for use in "real life"

    then you can buy the certificate from the vendor, for your production use:
    for example ==> www.digicert.com/.../order-1.php
    BR-

    Josh
  • Hi taylanb,

    Josh was referring to the dummy certificate that can be used for testing OTA. In the SimpleLink Academy OTA lab, this is what you flash to your device to load the pre-built image in task 3 and how you sign your own OTA image in task 4. You cannot go into production with this certificate, but this does not affect your demo testing.

    With the debug trace enabled, I expect more terminal output, especially from OTA_init since you are getting past that function. Can you verify that you are linking to the correct build of the OTA library in your workspace from your example project properties?

    If you haven't already, please try increasing the MAX_METADATA_FILENAME definition from task 1 step 4.

    Best regards,
    Sarah

  • 2.09.2018 00:45:53.240 [RX] - <LF>
    
    <LF><CR>
    
    ********************************************************************************<LF><CR>
    
    <HT>             OTA APP Application - Version 0.10.00.03        <LF><CR>
    
    ********************************************************************************<LF><CR>
    
    <LF><CR>
    
    SimpleLinkInitCallback: started in role 0<CR><LF>
    
    Host Driver Version: 3.0.1.39<CR><LF>
    
    Build Version 3.8.0.3.31.2.0.0.0.2.2.0.6<CR><LF>
    
     
    
    12.09.2018 00:45:54.526 [RX] - STA connected to AP [deleted] BSSID is [deleted]<CR><LF>
    
     
    
    12.09.2018 00:45:55.622 [RX] - IPv4 acquired: IP = 192.168.137.50<CR><LF>
    
    Gateway = 192.168.137.1<CR><LF>
    
    Pinging GW...!<CR><LF>
    
     
    
    12.09.2018 00:46:00.612 [RX] - Ping done. Success rate: 66%<CR><LF>
    
    <CR><LF>
    
    HandlePingComplete: PingCounter=1<CR><LF>
    
    Pinging GW...!<CR><LF>
    
     
    
    12.09.2018 00:46:07.602 [RX] - Ping done. Success rate: 33%<CR><LF>
    
    <CR><LF>
    
    HandlePingComplete: PingCounter=2<CR><LF>
    
    Pinging GW...!<CR><LF>
    
     
    
    12.09.2018 00:46:12.592 [RX] - Ping done. Success rate: 66%<CR><LF>
    
    <CR><LF>
    
    HandlePingComplete: PingCounter=3<CR><LF>
    
    Pinging GW...!<CR><LF>
    
     
    
    12.09.2018 00:46:19.582 [RX] - Ping done. Success rate: 33%<CR><LF>
    
    <CR><LF>
    
    HandlePingComplete: PingCounter=4<CR><LF>
    
    Pinging GW...!<CR><LF>
    
     
    
    12.09.2018 00:46:24.572 [RX] - Ping done. Success rate: 66%<CR><LF>
    
    <CR><LF>
    
    HandlePingComplete: OTA Command arrived<CR><LF>
    
    OtaInit: statistics = 0, 0, 0<CR><LF>
    
    OtaInit: call Ota_init<CR><LF>
    
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=4956<CR><LF>
    
    OTA_init: sizeof OtaLib_t=7736, sizeof OTA_memBlock=7800<CR><LF>
    
    OTA_init: OTA lib version = OTA_LIB_2.0.0.7<CR><LF>
    
    OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4<CR><LF>
    
    OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_SERVER_INFO,ServerName=api.dropboxapi.com<CR><LF>
    
    OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_CC3220SF<CR><LF>
    
    OTA_run: call CdnClient_ConnectServer OTA server=api.dropboxapi.com<CR><LF>
    
    CdnClient_ConnectServer: HttpClient_Connect api.dropboxapi.com<CR><LF>
    
    HttpClient_Connect: IP_ADDR=162.125.69.7<CR><LF>
    
     
    
    12.09.2018 00:46:26.967 [RX] - HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...<CR><LF>
    
    OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220SF<CR><LF>
    
    CdnDropbox_SendReqDir: uri=/2/files/list_folder<CR><LF>
    
    RespLen is 705, ProcessedSize is: 700<CR><LF>
    
    the entire JSON pRespBuf is:     OtaDir FileName=/OTA_CC3220SF/20180912004435_CC3220SF_OTA_CC3220SF.tar, FileSize=163840<CR><LF>
    
    OTA_run: CdnClient_ReqOtaDir, NumDirFiles=1<CR><LF>
    
    OTA_run: CdnClient_GetNextDirFile<CR><LF>
    
    OTA_run: CdnClient_GetNextDirFile: file=/OTA_CC3220SF/20180912004435_CC3220SF_OTA_CC3220SF.tar, size=163840<CR><LF>
    
    OtaArchive_Init: OTA archive version = OTA_ARCHIVE_2.0.0.4<CR><LF>
    
    _ReadOtaVersionFile: file ota.dat, status=SL_ERROR_FS_FILE_NOT_EXISTS<CR><LF>
    
    OtaArchive_CheckVersion: can't open version file, sign it as old version<CR><LF>
    
    OtaArchive_CheckVersion: accept the new version = 20180912004435_CC3220SF_OTA_CC3220SF.tar<CR><LF>
    
    OtaRunStep: status from Ota_run: OTA_RUN_STATUS_CHECK_NEWER_VERSION, accept and continue<CR><LF>
    
    _ReadOtaVersionFile: file ota.dat, status=SL_ERROR_FS_FILE_NOT_EXISTS<CR><LF>
    
    OtaRunStep: CurrentVersion=00000000000000, NewVersion=20180912004435, Start download ...<CR><LF>
    
    OTA_run: Call CdnClient_ReqFileUrl, filename = /OTA_CC3220SF/20180912004435_CC3220SF_OTA_CC3220SF.tar<CR><LF>
    
    CdnDropbox_SendReqFileUrl: uri=/2/files/get_temporary_link<CR><LF>
    
    HTTP request is:<CR><LF>
    
    POST /2/files/get_temporary_link HTTP/1.1<CR><LF>
    
    host: api.dropboxapi.com<CR><LF>
    
    Authorization: Bearer 5TnBHZDODbAAAAAAAAAAC_ONo6VAoG3s7eJlJg3IjeeYi8EMG8bLJ2-DMpTq-vLV<CR><LF>
    
    Content-Type: Application/Json<CR><LF>
    
    Content-Length:  66<CR><LF>
    
    <CR><LF>
    
    {"path": "/OTA_CC3220SF/20180912004435_CC3220SF_OTA_CC3220SF.tar"}<CR><LF>
    
    <CR><LF>
    
    <CR><LF>
    
    <LF>
    
     
    
    12.09.2018 00:46:29.314 [RX] - OTA_run: Call CdnClient_ConnectFileServer, url = dl.dropboxusercontent.com/.../AADaovSD_HIuYEkaiC73mTjv9ua-wnVZPccF5b9--W25ezu9radXc1d1U4gZ4DvNT2GkT71ob_z10oHaw3Z5gpuHr-rErUHGn8HPfVnyZJUotuYy1rj0QBL4HimvllxdxGqJEdccFRELt_zUOMiR8s1AzfjcIsvGPI3pIq370mShIzHNXz8-eXNgKtyZpaw-B3dxao4NRa9btuwUjLRoNRXmAAqqWwNiwaesDg_Lnx9eseySDRAE99ot5GR6SbjGhEnA2vptSQf5nidZD-_7Ao34Jw9mfzaJfL29ULQi1t-uoU3NzEyTewqlUk7zydP7rXKAZdl6RXlAhNSaqOY0YfblH54LZxH3N9Qyoy5M4RkCcVFpSUUO_n8anaR6it8QSGKojxXoObfUmI3tDwrFjaRj<CR><LF>
    
     
    
    12.09.2018 00:46:32.385 [RX] - HttpClient_Connect: IP_ADDR=162.125.69.6<CR><LF>
    
     
    
    12.09.2018 00:46:35.261 [RX] - HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...<CR><LF>
    
    OTA_run: Call CdnClient_ReqFileContent, url = dl.dropboxusercontent.com/.../AADaovSD_HIuYEkaiC73mTjv9ua-wnVZPccF5b9--W25ezu9radXc1d1U4gZ4DvNT2GkT71ob_z10oHaw3Z5gpuHr-rErUHGn8HPfVnyZJUotuYy1rj0QBL4HimvllxdxGqJEdccFRELt_zUOMiR8s1AzfjcIsvGPI3pIq370mShIzHNXz8-eXNgKtyZpaw-B3dxao4NRa9btuwUjLRoNRXmAAqqWwNiwaesDg_Lnx9eseySDRAE99ot5GR6SbjGhEnA2vptSQf5nidZD-_7Ao34Jw9mfzaJfL29ULQi1t-uoU3NzEyTewqlUk7zydP7rXKAZdl6RXlAhNSaqOY0YfblH54LZxH3N9Qyoy5M4RkCcVFpSUUO_n8anaR6it8QSGKojxXoObfUmI3tDwrFjaRj<CR><LF>
    
    CdnDropbox_SendReqFileContent: file=/apitl/1/AADaovSD_HIuYEkaiC73mTjv9ua-wnVZPccF5b9--W25ezu9radXc1d1U4gZ4DvNT2GkT71ob_z10oHaw3Z5gpuHr-rErUHGn8HPfVnyZJUotuYy1rj0QBL4HimvllxdxGqJEdccFRELt_zUOMiR8s1AzfjcIsvGPI3pIq370mShIzHNXz8-eXNgKtyZpaw-B3dxao4NRa9btuwUjLRoNRXmAAqqWwNiwaesDg_Lnx9eseySDRAE99ot5GR6SbjGhEnA2vptSQf5nidZD-_7Ao34Jw9mfzaJfL29ULQi1t-uoU3NzEyTewqlUk7zydP7rXKAZdl6RXlAhNSaqOY0YfblH54LZxH3N9Qyoy5M4RkCcVFpSUUO_n8anaR6it8QSGKojxXoObfUmI3tDwrFjaRj<CR><LF>
    
     
    
    12.09.2018 00:46:37.216 [RX] - OtaArchive_RunParse: set state=ARCHIVE_STATE_PARSE_HDR<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: filetype=5, directory=20180912004435_CC3220SF_OTA_CC3220SF/<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: filetype=5, directory=20180912004435_CC3220SF_OTA_CC3220SF/0/<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: filetype=5, directory=20180912004435_CC3220SF_OTA_CC3220SF/1/<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: filetype=5, directory=20180912004435_CC3220SF_OTA_CC3220SF/2/<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: FileType=0, FileName=ota.cmd, FileSize=2158<CR><LF>
    
    [_BundleCmdFile_Parse]    bundle cmd file=/sys/mcuflashimg.bin, sig_len=256, SHA_256_Digets=6ce31c27167b559df7b7d00fa71f93e8e9be6bf1d27da65b6c0bdc34f7c78c05,  cert=dummy-root-ca-cert, secured=1, bundle=1<CR><LF>
    
    [_BundleCmdFile_Parse]    bundle cmd file=digicert_high_assurance_ev_root_ca.der, sig_len=0, SHA_256_Digets=7431e5f4c3c1ce4690774f0b61e05440883ba9a01ed00ba6abd7806ed3b118cf,  cert=, secured=0, bundle=0<CR><LF>
    
    [_BundleCmdFile_Parse]    bundle cmd file=dummy-root-ca-cert, sig_len=0, SHA_256_Digets=34941765501d16a4ab776c3a74d89945f1a2575c5893069f62ffbe803f344549,  cert=, secured=0, bundle=0<CR><LF>
    
    [_BundleCmdFile_Parse]    bundle cmd file=dummy-trusted-ca-cert, sig_len=0, SHA_256_Digets=07ad6ba74b3921009edf184cb382c05a32baacf9c767f74427c094b2c56aa135,  cert=, secured=0, bundle=0<CR><LF>
    
    [_BundleCmdFile_Parse]    bundle cmd file=dummy_ota_vendor_cert.der, sig_len=0, SHA_256_Digets=a160b855d7a00a6002922181377249a80ecd6a738d23e1dd8976c8bb7fad1bcb,  cert=, secured=0, bundle=0<CR><LF>
    
    [_BundleCmdFile_Parse]    bundle cmd file=/sys/servicepack.ucf, sig_len=256, SHA_256_Digets=badae25dfc18f6987598e2f2ce1bda91dbdb7678846a515d345ca6ae3a842633,  cert=, secured=1, bundle=1<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: skip block align  RecvBufLen=620, SkipAlignSize=403<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: FileType=0, FileName=ota.sign, FileSize=70<CR><LF>
    
     
    
    12.09.2018 00:46:38.383 [RX] - OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: skip block align  RecvBufLen=858, SkipAlignSize=442<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: FileType=0, FileName=dummy-root-ca-cert, FileSize=975<CR><LF>
    
       Create/Open for write file dummy-root-ca-cert<CR><LF>
    
    OtaArchive_RunParseTar: Write size 928 to file dummy-root-ca-cert total 928.<CR><LF>
    
    OtaArchive_RunParseTar: Write size 47 to file dummy-root-ca-cert total 975.<CR><LF>
    
    <CR><LF>
    
     Hash verification succeeded.<CR><LF>
    
        Total archive file bytes 7631.<CR><LF>
    
    OtaArchive_RunParseTar: 1 files that are mentioned in the ota.cmd were saved<CR><LF>
    
    OtaArchive_RunParseTar: Downloading File Completed - Size=975<CR><LF>
    
    OtaArchive_RunParseTar: parsing archive file header<CR><LF>
    
    OtaArchive_RunParseTar: skip block align  RecvBufLen=1393, SkipAlignSize=49<CR><LF>
    
    OtaArchive_RunParseTar: FileType=0, FileName=/sys/mcuflashimg.bin, FileSize=111828<CR><LF>
    
       Create/Open for write file /sys/mcuflashimg.bin<CR><LF>
    
    <CR><LF>
    
    OtaArchive_RunParseTar: !!!!!! SECURITY ALERT !!!!! on pOpenFile, Status=-10365<CR><LF>
    
    <CR><LF>
    
     
    
    12.09.2018 00:46:39.820 [RX] - OTA_run: SECURITY ALERT OtaArchive_RunParse, Status=-20199<CR><LF>
    
     
    
    12.09.2018 00:46:40.822 [RX] - <CR><LF>
    
    OtaRunStep: FATAL ERROR from Ota_run -21004 !!!!!!!!!!!!!!!!!!!!!!!!!!!<CR><LF>
    
    <CR><LF>
    
    Test failed: State = 6, Event = 17<CR><LF>
    
    Event handler failed..!! <CR><LF>

  • Hi taylanb,

    -10365 is a file system error SL_ERROR_FS_INVALID_TOKEN_SECURITY_ALERT which looks like you're trying to open a file without providing the token.

    1) Did you sign your mcuimage.bin or any user files in your OTA image with a file token? It would be this parameter in ImageCreator:

    2) Did you sign the OTA image as shown in task 4 step 5?

    3) Did tasks 1-3 work for you with the pre-built OTA image on the provided GitHub?

    Best regards,

    Sarah

  • Hi taylanb,

    Were you able to resolve your issue?

    Best regards,
    Sarah
  • Hi taylanb,

    I haven't heard back from you in a while, so I'm assuming you were able to resolve your issue. If not, please reply to this thread. If the thread is locked, please click the "Ask a related question" button and include any additional details you may have.

    Best regards,
    Sarah