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 OTA

Other Parts Discussed in Thread: CC3220S

测试cloud_ota 时报错,如下,请问时什么问题,如何修复. error code -101.

OtaInit: call Ota_init
OTA_init: sizeof CdnClient=576, sizeof OtaArchive=4956
OTA_init: sizeof OtaLib_t=7736, sizeof OTA_memBlock=15600
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.github.com
OtaConfig: call OTA_set EXTLIB_OTA_SET_OPT_VENDOR_ID, VendorDir=OTA_CC3220S
OTA_run: call CdnClient_ConnectServer OTA server=api.github.com
CdnClient_ConnectServer: HttpClient_Connect api.github.com
HttpClient_Connect: IP_ADDR=13.250.94.254
HttpClient_Connect: WARNING Socket Connect, status=-468, Ignored...
OTA_run: CdnClient_ReqOtaDir, VendorDir=OTA_CC3220S
CdnGithub_SendReqDir: uri=/repos/sunrichman/cc3220s-ota/contents/
len is: 780
After recvAppend pRespBuf is: master","html_url":"github.com/.../20190117173519_CC3220S_cc3220s_cloud_ota.tar
the entire JSON pRespBuf is: [{"name":"20190117173519_CC3220S_cc3220s_cloud_ota.tar","path":"OTA_CC3220S/20190117173519_CC3220S_cc3220s_cloud_ota.tar","sha":"096d6d416bddc98710e23236930041e5cdb5a5d9","size":378880,"url":"https://api.github.com/repos/sunrichman/cc3220s-ota/contents/OTA_CC3220S/20190117173519_CC3220S_cc3220s_cloud_ota.tar?ref=master","html_url":"https://github.com/sunrichman/cc3220s-ota/blob/master/OTA_CC3220S/20190117173519_CC3220S_cc3220s_cloud_ota.tar","git_url":"https://api.github.com/repos/sunrichman/cc3220s-ota/git/blobs/096d6d416bddc98710e23236930041e5cdb5a5d9","download_url":"https://raw.githubusercontent.com/sunrichman/cc3220s-ota/master/OTA_CC3220S/20190117173519_CC3220S_cc3220s_cloud_ota.tar","type":"file","_links":{"self":"https://api.github.com/repos/sunrichman/cc3220s-ota/contents/OTA_CC3220S/20190117173519_CC3220S_cc3220s_cloud_ota.tar?ref=master","git":"https://api.github.com/repos/sunrichman/cc3220s-ota/git/blobs/096d6d416bddc98710e23236930041e5cdb5a5d9","html":"https://github.com/sunrichman/cc3220s-ota/blob/master/OTA_CC3220S/20190117173519_CC3220S_cc3220s_cloud_ota.tar"}}]
==== lian jun == file number:1
==== lian jun ==pathbuf:"#".[0]."download_url"
==== lian jun == test =pFileName:,FileNameKey:"#".[0]."download_url"[OtaJson_getMetadataFileName] Error: -101 , Couldn't get the data
OTA_run: ERROR CdnClient_ReqOtaDir, Status=-101

  • 这个报错是因为tar文件的路径太长。建议:
    1、修改 OtaJson.c,增加MAX_METADATA_FILENAME的长度,改完后需要重新编译
    2、缩短文件路径
  • 修改 MAX_METADATA_FILENAME后ok
    之后提示 "increasing MAX_BUNDLE_CMD_FILES=8"
    将MAX_BUNDLE_CMD_FILES 增大为17,但是OTA_init时出现了阻塞的现象,添log发现是在OtaArchive_init中执行memset时阻塞
    具体如下


    ----------------------------------------------------------- log --------------------------------------------------
    Pinging GW...!
    Ping done. Success rate: 100%

    HandlePingComplete: PingCounter=1
    Pinging GW...!
    Ping done. Success rate: 100%

    HandlePingComplete: OTA Command arrived
    OtaInit: statistics = 0, 0, 0
    OtaInit: call Ota_init
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=10320
    OTA_init: sizeof OtaLib_t=13100, sizeof OTA_memBlock=15600
    OTA_init: OTA lib version = OTA_LIB_2.0.0.7
    OTA_init: === lian jun1 ===
    OtaArchive_Init: === lian jun1 696,heap97952===

    ----------------------------------------------------------- 代码 --------------------------------------------------
    693 size_t xPortGetFreeHeapSize( void );
    694 int16_t OtaArchive_init(OtaArchive_t* pOtaArchive)
    695 {
    696 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d,heap%d===\r\n",__LINE__,xPortGetFreeHeapSize()));
    697 memset(pOtaArchive, 0, sizeof(OtaArchive_t));
    698 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    699 pOtaArchive->TotalBytesReceived = 0;
    700 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    701
    702 _SlOtaLibTrace(("OtaArchive_Init: OTA archive version = %s\r\n", OTA_ARCHIVE_VERSION));
    703 pOtaArchive->State = ARCHIVE_STATE_IDLE;
    704 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    705 pOtaArchive->CurrTarObj.lFileHandle = -1;
    706 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    707 pOtaArchive->BundleCmdTable.NumFiles = 0;
    708 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    709
    710 B64_Init();
    711 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    712 return ARCHIVE_STATUS_OK;
  • 这个问题已经解决,但又遇到新的问题:
    OTA_init时会出现阻塞,添加log发现阻塞再OtaArchive_init中
    ------------------------ log --------------------------
    Pinging GW...!
    Ping done. Success rate: 100%

    HandlePingComplete: PingCounter=1
    Pinging GW...!
    Ping done. Success rate: 100%

    HandlePingComplete: OTA Command arrived
    OtaInit: statistics = 0, 0, 0
    OtaInit: call Ota_init
    OTA_init: sizeof CdnClient=576, sizeof OtaArchive=10320
    OTA_init: sizeof OtaLib_t=13100, sizeof OTA_memBlock=15600
    OTA_init: OTA lib version = OTA_LIB_2.0.0.7
    OTA_init: === lian jun1 ===
    OtaArchive_Init: === lian jun1 696,heap97952===

    ------------------------ 代码 --------------------------
    693 size_t xPortGetFreeHeapSize( void );
    694 int16_t OtaArchive_init(OtaArchive_t* pOtaArchive)
    695 {
    696 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d,heap%d===\r\n",__LINE__,xPortGetFreeHeapSize()));
    697 memset(pOtaArchive, 0, sizeof(OtaArchive_t));
    698 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    699 pOtaArchive->TotalBytesReceived = 0;
    700 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    701
    702 _SlOtaLibTrace(("OtaArchive_Init: OTA archive version = %s\r\n", OTA_ARCHIVE_VERSION));
    703 pOtaArchive->State = ARCHIVE_STATE_IDLE;
    704 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    705 pOtaArchive->CurrTarObj.lFileHandle = -1;
    706 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    707 pOtaArchive->BundleCmdTable.NumFiles = 0;
    708 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    709
    710 B64_Init();
    711 _SlOtaLibTrace(("OtaArchive_Init: === lian jun1 %d===\r\n",__LINE__));
    712 return ARCHIVE_STATUS_OK;
    713 }