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.

[参考译文] LAUNHHXL-CC3235SF:无法使用云 OTA 示例代码从分机箱进行 OTA 更新

Guru**** 2562120 points
Other Parts Discussed in Thread: CC3235SF

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1075730/launchxl-cc3235sf-not-able-to-ota-update-from-dropbox-by-using-cloud_ota-sample-code

部件号:LAUNHHXL-CC3235SF
线程中讨论的其他部件:CC3235SFMSP432P401RCC3120

您好 TI,

    我们面临的问题与外置固件中的 OTA 更新有关,以前它运行良好,但从最近几天开始就没有。日志如下。


HandlePingComplete:OTA 命令已到达

OtaInit:统计= 0,12,3

OtaInit:调用 Ota_init

OTA 初始化:CdnClient=576,OtaArchive=4956

OTA 初始化:sizeof OtaLib_t=7736,sizeof OTA 内存 Block=7800

OTA 初始化:OTA lib 版本= OTA LIB_2.0.0.7

OtaArchive_Init:OTA 存档版本= OTA 存档_2.0.0.4

OtaConfig:致电 OTA 设置 EXTLIB_OTA 设置/opt/Server_info,ServerName=api.dropboxapi.com

OtaConfig:致电 OTA 设置 EXTLIB_OTA 设置/opt/vendor_ID,VendorDir=AC001_OTA DIR_10

OTA 运行:调用 CdnClient_ConnectServer OTA 服务器= api.dropboxapi.com

CdnClient_ConnectServer:HttpClient_Connect api.dropboxapi.com

HttpClient_Connect:IP_ADDR=162.125.81.19

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:CdnClient_ReqOtaDir,VendorDir=AC001_OTA DIR_10

CdnDropbox SendReqDir:Uri =/2/files/list_folder

答辩人为799人,处理大小为:794人

整个 JSON pRespbuf 为:(空)

OTA 运行:CdnClient_ReqOtaDir,NumDirFiles=1

OTA 运行:CdnClient_GetNextDirFile

OTA 运行:CdnClient_GetNextDirFile:file=/AC001_OTA;DIR_10/20220209123607_CC3235SF_SFProject.tar,大小=307200

OtaArchive_Init:OTA 存档版本= OTA 存档_2.0.0.4

OtaArchive_CheckVersion:当前版本 str = 20200831111705

OtaArchive_CheckVersion:新版本 str = 20220209123607

OtaArchive_CheckVersion:更新版本- 20220209123607

OtaRunStep:Status from Ota_run:OTA 运行状态检查更新版本,接受并继续

OtaRunStep:CurrentVersion=20200831111705,NewVersion=20220209123607,开始下载...

OTA 运行:调用 CdnClient_ReqFileUrl,文件名=/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar

CdnDropbox SendReqFileUrl:Uri =/2/files/Get_Temporary 链接

HTTP 请求是:
发布/2/files/Get_Temporary 链接 HTTP/1.1
嘉宾:api.dropboxapi.com
授权:不记名 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
内容类型:Application/JSON
内容长度:67

{"path":"/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar"}


OTA 运行:调用 CdnClient_ConnectFileServer,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

HttpClient_Connect:IP_ADDR=162.125.81.15

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:调用 CdnClient_ReqFileContent,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

OTA 运行:下载错误,CdnClient_RecvSkipHdr Status=0


_OtaCheckConfuriveErrors:安全错误=1/5,仅返回警告

OtaRunStep:警告 Ota_run,Status=20008,继续进行下一步 OTA 重试

OTA 运行:调用 CdnClient_ConnectServer OTA 服务器= api.dropboxapi.com

CdnClient_ConnectServer:HttpClient_Connect api.dropboxapi.com

HttpClient_Connect:IP_ADDR=162.125.81.19

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:CdnClient_ReqOtaDir,VendorDir=AC001_OTA DIR_10

CdnDropbox SendReqDir:Uri =/2/files/list_folder

答辩人为799人,处理大小为:794人

整个 JSON pRespbuf 为:(空)

OTA 运行:CdnClient_ReqOtaDir,NumDirFiles=1

OTA 运行:CdnClient_GetNextDirFile

OTA 运行:CdnClient_GetNextDirFile:file=/AC001_OTA;DIR_10/20220209123607_CC3235SF_SFProject.tar,大小=307200

OtaArchive_Init:OTA 存档版本= OTA 存档_2.0.0.4

OtaArchive_CheckVersion:当前版本 str = 20200831111705

OtaArchive_CheckVersion:新版本 str = 20220209123607

OtaArchive_CheckVersion:更新版本- 20220209123607

OtaRunStep:Status from Ota_run:OTA 运行状态检查更新版本,接受并继续

OtaRunStep:CurrentVersion=20200831111705,NewVersion=20220209123607,开始下载...

OTA 运行:调用 CdnClient_ReqFileUrl,文件名=/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar

CdnDropbox SendReqFileUrl:Uri =/2/files/Get_Temporary 链接

HTTP 请求是:
发布/2/files/Get_Temporary 链接 HTTP/1.1
嘉宾:api.dropboxapi.com
授权:不记名 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
内容类型:Application/JSON
内容长度:67

{"path":"/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar"}


OTA 运行:调用 CdnClient_ConnectFileServer,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

HttpClient_Connect:IP_ADDR=162.125.81.15

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:调用 CdnClient_ReqFileContent,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

OtaArchive_RunParse:设置 status=archive_State_parse_hdr

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=4000
20220209123607_CC3235SF_SFProject/

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=97,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=g="",
“安全”:1,
"捆绑包":1,
“文件名”:"/sys/mcualimg.bin"
},

《文摘》:“34941765,

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=32,文件名=ndle":1,
“文件名”:“dummy_ota_vendor_cert.der"
},

“文摘”:“252aae7c24f42ba2c0f667fe42b4e6b7c3c76df1f,

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=103,文件名=6JApZPHmyZprS0TJtrLny3fA4MqXddcpyqizyV7cplG4rMrVG+5dlkmMQKPHmApXyHekVXAik8LdJMbyQizyV619,5dlkMdZwd8WQ9+5dx 高速网络

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:文件名模式错误

OtaArchive_Rollback:错误 SL_FsCtl,状态=-10282

OTA 运行:错误 OtaArchive_RunParse,状态=-20102


_OtaCheckConfuriveErrors:安全错误=2-5,仅返回警告

OtaRunStep:警告 Ota_run,Status=20009,继续进行下一步 OTA 重试

OTA 运行:调用 CdnClient_ConnectServer OTA 服务器= api.dropboxapi.com

CdnClient_ConnectServer:HttpClient_Connect api.dropboxapi.com

HttpClient_Connect:IP_ADDR=162.125.81.19

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:CdnClient_ReqOtaDir,VendorDir=AC001_OTA DIR_10

CdnDropbox SendReqDir:Uri =/2/files/list_folder

答辩人为799人,处理大小为:794人

整个 JSON pRespbuf 为:(空)

OTA 运行:CdnClient_ReqOtaDir,NumDirFiles=1

OTA 运行:CdnClient_GetNextDirFile

OTA 运行:CdnClient_GetNextDirFile:file=/AC001_OTA;DIR_10/20220209123607_CC3235SF_SFProject.tar,大小=307200

OtaArchive_Init:OTA 存档版本= OTA 存档_2.0.0.4

OtaArchive_CheckVersion:当前版本 str = 20200831111705

OtaArchive_CheckVersion:新版本 str = 20220209123607

OtaArchive_CheckVersion:更新版本- 20220209123607

OtaRunStep:Status from Ota_run:OTA 运行状态检查更新版本,接受并继续

OtaRunStep:CurrentVersion=20200831111705,NewVersion=20220209123607,开始下载...

OTA 运行:调用 CdnClient_ReqFileUrl,文件名=/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar

CdnDropbox SendReqFileUrl:Uri =/2/files/Get_Temporary 链接

HTTP 请求是:
发布/2/files/Get_Temporary 链接 HTTP/1.1
嘉宾:api.dropboxapi.com
授权:不记名 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
内容类型:Application/JSON
内容长度:67

{"path":"/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar"}


OTA 运行:调用 CdnClient_ConnectFileServer,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

HttpClient_Connect:IP_ADDR=162.125.81.15

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:调用 CdnClient_ReqFileContent,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

OTA 运行:下载错误,CdnClient_RecvSkipHdr Status=0


_OtaCheckConfidiveErrors:ConfidiveOtaErrors=3/5, Return Only WARNING

OtaRunStep:警告 Ota_run,Status=20008,继续进行下一步 OTA 重试

OTA 运行:调用 CdnClient_ConnectServer OTA 服务器= api.dropboxapi.com

CdnClient_ConnectServer:HttpClient_Connect api.dropboxapi.com

HttpClient_Connect:IP_ADDR=162.125.81.19

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:CdnClient_ReqOtaDir,VendorDir=AC001_OTA DIR_10

CdnDropbox SendReqDir:Uri =/2/files/list_folder

答辩人为799人,处理大小为:794人

整个 JSON pRespbuf 为:(空)

OTA 运行:CdnClient_ReqOtaDir,NumDirFiles=1

OTA 运行:CdnClient_GetNextDirFile

OTA 运行:CdnClient_GetNextDirFile:file=/AC001_OTA;DIR_10/20220209123607_CC3235SF_SFProject.tar,大小=307200

OtaArchive_Init:OTA 存档版本= OTA 存档_2.0.0.4

OtaArchive_CheckVersion:当前版本 str = 20200831111705

OtaArchive_CheckVersion:新版本 str = 20220209123607

OtaArchive_CheckVersion:更新版本- 20220209123607

OtaRunStep:Status from Ota_run:OTA 运行状态检查更新版本,接受并继续

OtaRunStep:CurrentVersion=20200831111705,NewVersion=20220209123607,开始下载...

OTA 运行:调用 CdnClient_ReqFileUrl,文件名=/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar

CdnDropbox SendReqFileUrl:Uri =/2/files/Get_Temporary 链接

HTTP 请求是:
发布/2/files/Get_Temporary 链接 HTTP/1.1
嘉宾:api.dropboxapi.com
授权:不记名 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
内容类型:Application/JSON
内容长度:67

{"path":"/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar"}


OTA 运行:调用 CdnClient_ConnectFileServer,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

HttpClient_Connect:IP_ADDR=162.125.81.15

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:调用 CdnClient_ReqFileContent,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

OtaArchive_RunParse:设置 status=archive_State_parse_hdr

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=4000
20220209123607_CC3235SF_SFProject/

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=97,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=g="",
“安全”:1,
"捆绑包":1,
“文件名”:"/sys/mcualimg.bin"
},

《文摘》:“34941765,

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=32,文件名=ndle":1,
“文件名”:“dummy_ota_vendor_cert.der"
},

“文摘”:“252aae7c24f42ba2c0f667fe42b4e6b7c3c76df1f,

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=103,文件名=6JApZPHmyZprS0TJtrLny3fA4MqXddcpyqizyV7cplG4rMrVG+5dlkmMQKPHmApXyHekVXAik8LdJMbyQizyV619,5dlkMdZwd8WQ9+5dx 高速网络

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:文件名模式错误

OtaArchive_Rollback:错误 SL_FsCtl,状态=-10282

OTA 运行:错误 OtaArchive_RunParse,状态=-20102


_OtaCheckConfuriveErrors:安全错误=4/5,仅返回警告

OtaRunStep:警告 Ota_run,Status=20009,继续进行下一步 OTA 重试

OTA 运行:调用 CdnClient_ConnectServer OTA 服务器= api.dropboxapi.com

CdnClient_ConnectServer:HttpClient_Connect api.dropboxapi.com

HttpClient_Connect:IP_ADDR=162.125.81.19

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:CdnClient_ReqOtaDir,VendorDir=AC001_OTA DIR_10

CdnDropbox SendReqDir:Uri =/2/files/list_folder

答辩人为799人,处理大小为:794人

整个 JSON pRespbuf 为:(空)

OTA 运行:CdnClient_ReqOtaDir,NumDirFiles=1

OTA 运行:CdnClient_GetNextDirFile

OTA 运行:CdnClient_GetNextDirFile:file=/AC001_OTA;DIR_10/20220209123607_CC3235SF_SFProject.tar,大小=307200

OtaArchive_Init:OTA 存档版本= OTA 存档_2.0.0.4

OtaArchive_CheckVersion:当前版本 str = 20200831111705

OtaArchive_CheckVersion:新版本 str = 20220209123607

OtaArchive_CheckVersion:更新版本- 20220209123607

OtaRunStep:Status from Ota_run:OTA 运行状态检查更新版本,接受并继续

OtaRunStep:CurrentVersion=20200831111705,NewVersion=20220209123607,开始下载...

OTA 运行:调用 CdnClient_ReqFileUrl,文件名=/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar

CdnDropbox SendReqFileUrl:Uri =/2/files/Get_Temporary 链接

HTTP 请求是:
发布/2/files/Get_Temporary 链接 HTTP/1.1
嘉宾:api.dropboxapi.com
授权:不记名 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
内容类型:Application/JSON
内容长度:67

{"path":"/AC001_OTA DIR_10/20220209123607_CC3235SF_SFProject.tar"}


OTA 运行:调用 CdnClient_ConnectFileServer,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

HttpClient_Connect:IP_ADDR=162.125.81.15

HttpClient_Connect:警告套接字连接,状态=-468,已忽略...

OTA 运行:调用 CdnClient_ReqFileContent,URL = uc40c6f54b63b279cfc281b88d37.dl.dropboxusercontent.com/.../file

OtaArchive_RunParse:设置 status=archive_State_parse_hdr

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=4000
20220209123607_CC3235SF_SFProject/

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=51,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=97,文件名=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=g="",
“安全”:1,
"捆绑包":1,
“文件名”:"/sys/mcualimg.bin"
},

《文摘》:“34941765,

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=32,文件名=ndle":1,
“文件名”:“dummy_ota_vendor_cert.der"
},

“文摘”:“252aae7c24f42ba2c0f667fe42b4e6b7c3c76df1f,

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:不支持的文件类型=103,文件名=6JApZPHmyZprS0TJtrLny3fA4MqXddcpyqizyV7cplG4rMrVG+5dlkmMQKPHmApXyHekVXAik8LdJMbyQizyV619,5dlkMdZwd8WQ9+5dx 高速网络

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:filetype=5,directory=

OtaArchive_RunParseTar:解析归档文件头

OtaArchive_RunParseTar:文件名模式错误

OtaArchive_Rollback:错误 SL_FsCtl,状态=-10282

OTA 运行:错误 OtaArchive_RunParse,状态=-20102


_OtaCheckConfidiveErrors:ConfidiveOtaErrors=5/5, MAX_CONTINUAL_OTA 错误!!

OtaRunStep:Ota_run -21003的致命错误!!!!!!!!!!!!!!!!!!!!!!!!

SDK 版本: simplelink_cc32xx_sdk_5_20_00_06。

示例:cloud_OTA。

捆绑包文件如下:

otauser.h 文件

/*
 * Copyright (c) 2018, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#ifndef __OTA_USER_H__
#define __OTA_USER_H__

#ifdef    __cplusplus
extern "C" {
#endif

#include <stdlib.h>

#include <ti/drivers/net/wifi/simplelink.h>
#include <ti/net/ota/ota.h>

#define SL_ENABLE_OTA_DEBUG_TRACES /* uncomment to enable internal OTA debug info */
#ifndef SL_ENABLE_OTA_DEBUG_TRACES
#define _SlOtaLibTrace(pargs) 
#else

#ifdef _WIN32

#define _SlOtaLibTrace(pargs)  printf pargs

#elif __MSP432P401R__

extern void LogMessage(const char *pcFormat, ...);
#define _SlOtaLibTrace(pargs)  LogMessage pargs

#else /*CC32xx*/

//extern int Report(const char *format, ...);
//#define _SlOtaLibTrace(pargs)  Report pargs

extern int Display(const char *pcFormat,...);
#define _SlOtaLibTrace(pargs)  Display pargs

#endif

#endif

#define OTA_SERVER_GITHUB      1
#define OTA_SERVER_DROPBOX_V2  2
#define OTA_SERVER_CUSTOM      99

/* The following configuration skips the CDN server handshake,
 * and simply downloads an OTA TAR file from provided URL
 * (of an HTTP server). 
 * Note: For ease of use, a macro definition is provided below for 
 * the file URL (see OTA_FILE_SERVER_URL) which is used by the application 
 * to initialize the OTA library. But, the actual URL is assumed to be dynamic
 * (and temporary). The value should be provided by the applications by 
 * calling OTA_set just before the OTA gets triggered (i.e. before calling OTA_run).
 */
#define OTA_FILE_DOWNLOAD      100

/* USER SHOULD DEFINE HERE WHICH CLOUD TO USE */
/* -------------------------------------------*/
//#define OTA_SERVER_TYPE    OTA_SERVER_GITHUB
#define OTA_SERVER_TYPE    OTA_SERVER_DROPBOX_V2
//#define OTA_SERVER_TYPE      OTA_FILE_DOWNLOAD

/* OTA server info */
/* --------------- */

#ifdef _WIN32
#define OTA_VENDOR_DIR  "OTA_CC3120"
#elif __MSP432P401R__
#define OTA_VENDOR_DIR  "OTA_CC3120"
#else
#define OTA_VENDOR_DIR  "AC001_OTA_DIR_10" //"BSS_BS"//
#endif

#if OTA_SERVER_TYPE == OTA_SERVER_GITHUB

/* Github server info */
#define OTA_SERVER_NAME                 "api.github.com"
#define OTA_SERVER_IP_ADDRESS           0x00000000
#define OTA_SERVER_SECURED              1


/* Github vendor info */
#define OTA_VENDOR_ROOT_DIR             "/repos/<user account>/<user directory>"
//#define OTA_VENDOR_TOKEN              "<User defined Github token>"
#ifndef OTA_VENDOR_TOKEN
#error "Please define your personal cloud account token in OTA_VENDOR_TOKEN above"
#endif

/******************************************************************************
 * An Important Note regarding the GitHub Certificates:
 * GitHub is about to replace the servers' certificates. The change may impact
 * the GitHub OTA server, the GitHub Content server or both. OTA Library Users 
 * should prepare in advance by updating the root CA certificates (for devices
 * in the field).
 * Up to now both servers were verified using "DigCert_High_Assurance_CA.der".
 * Recently GitHub updated their OTA Server to use a certificate that needs to 
 * be verified with "DigiCert_Global_Root_CA.der" (This requires update of
 * OTA_SERVER_ROOT_CA_CERT). 
 * Working with GitHub, TI was able to postpone the change so the library users 
 * can update their devices.
 * The exact date of the change and the content of the change are TBD by GitHub
 * (customers are encouraged to contact GitHub for details).
 *
 * For CC323x customers, TI offer an easier approach. The 
 * "RootCACerts.pem" contains both the old and the new root CA certificates.
 * If used here, this PEM file will enable the connection before and after the
 * change. Unfortunately, this method is not supported by CC3220 devices
 * and thus specific certificate needs to be defined per server.
 * 
 * Having this, it is very important to include a backup method in your code.
 * In case of GitHub failure, the backup can trigger a load from a secondary 
 * server or it can enable the Local OTA method.
 ******************************************************************************/
//#define OTA_SERVER_ROOT_CA_CERT         "DigCert_High_Assurance_CA.der"
//#define OTA_CONTENT_SERVER_ROOT_CA_CERT "DigCert_High_Assurance_CA.der"
#define OTA_SERVER_ROOT_CA_CERT           "RootCACerts.pem"
#define OTA_CONTENT_SERVER_ROOT_CA_CERT   "RootCACerts.pem"
#define OTA_SERVER_AUTH_IGNORE_DATA_TIME_ERROR
#define OTA_SERVER_AUTH_DISABLE_CERT_STORE

#elif OTA_SERVER_TYPE == OTA_SERVER_DROPBOX_V2

/* Dropbox V2 server info */
#define OTA_SERVER_NAME                 "api.dropboxapi.com"
#define OTA_SERVER_IP_ADDRESS           0x00000000
#define OTA_SERVER_SECURED              1

/* Dropbox V2 vendor info */
#define OTA_VENDOR_TOKEN              "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
#ifndef OTA_VENDOR_TOKEN
#error "Please define your personal cloud account token in OTA_VENDOR_TOKEN above"
#endif
/******************************************************************************
 * An Important Note regarding the DropBox Certificates:
 * DropBox is about to replace the servers' certificates. The change may impact
 * the DropBox OTA server, the DropBox Content server or both. OTA Library Users
 * should prepare in advance by updating the root CA certificates (for devices
 * in the field).
 * Up to now both servers were verified using "DigCert_High_Assurance_CA.der".
 * Recently DropBox updated their OTA Content Server to use a certificate that 
 * needs to be verified with "DigiCert_Global_Root_CA.der" (This requires update 
 * of OTA_CONTENT_SERVER_ROOT_CA_CERT).
 * Working with GitHub, TI was able to postpone the change so the library users
 * can update their devices.
 * The change is planned for August 2021. The exact content of the change is TBD 
 * by DropBox (customers are encouraged to contact DropBox for details).
 *
 * For CC323x customers, TI offer an easier approach. The
 * "RootCACerts.pem" contains both the old and the new root CA certificates.
 * If used here, this PEM file will enable the connection before and after the
 * change. Unfortunately, this method is not supported by CC3220 devices
 * and thus specific certificate needs to be defined per server.
 *
 * Having this, it is very important to include a backup method in your code.
 * A fallabck in case of DropBox failure may include triggering a load from 
 * a secondary server or enabling the Local OTA method.
 ******************************************************************************/

//#define OTA_SERVER_ROOT_CA_CERT         "DigCert_High_Assurance_CA.der"
//#define OTA_CONTENT_SERVER_ROOT_CA_CERT "DigCert_High_Assurance_CA.der"

#define OTA_SERVER_ROOT_CA_CERT           "RootCACerts.pem"
#define OTA_CONTENT_SERVER_ROOT_CA_CERT   "RootCACerts.pem"
#define OTA_SERVER_AUTH_IGNORE_DATA_TIME_ERROR
#define OTA_SERVER_AUTH_DISABLE_CERT_STORE

#elif OTA_SERVER_TYPE == OTA_SERVER_CUSTOM

/* add your customer server header here */
#include ""

/* Github server info */
#define OTA_SERVER_NAME                 ""
#define OTA_SERVER_IP_ADDRESS           0x00000000
#define OTA_SERVER_SECURED              1

/* Vendor info */
#define OTA_VENDOR_TOKEN                "User defined token"

#define CdnVendor_SendReqDir           
#define CdnVendor_ParseRespDir          
#define CdnVendor_SendReqFileUrl        
#define CdnVendor_ParseRespFileUrl      

#elif OTA_SERVER_TYPE == OTA_FILE_DOWNLOAD
#define OTA_SERVER_SECURED              1
//#define OTA_CONTENT_SERVER_ROOT_CA_CERT "DigCert_High_Assurance_CA.der"
#define OTA_CONTENT_SERVER_ROOT_CA_CERT   "RootCACerts.pem"

#endif


#ifdef  __cplusplus
}
#endif /* __cplusplus */

#endif /* __OTA_USER_H__ */

请尽快回复,  

请提前感谢

沙洲

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好,

    您似乎有一些基本解析错误。 例如,它无法正确解析文件类型。

    你能告诉你它的工作发生了什么变化?

    您可以共享 OTA 期间使用的 tar 文件吗?

    什洛米