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.

[参考译文] CC3235S:OTA 实现

Guru**** 2555630 points
Other Parts Discussed in Thread: CC3235S

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

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/924747/cc3235s-ota-implementation

器件型号:CC3235S

您好!

一位客户测试了 CC3235S 上的 OTA 功能、他在 OOB 项目中添加了一些代码、效果很好。 但如果执行 OTA 并重新引导、它会卡住。 断电重新启动可以解决此问题、可以更新项目而不会出现任何卡滞。

但断电重启并不那么方便、为何 OTA 重启受阻?

他尝试添加看门狗、但它似乎不起作用。 如果您建议调试或解决此问题、敬请参考。

void WatchCallbackFxn (Watchdog_handle)
{
Watchdog_clear (watchdogHandle);
}
watchdog_Init()
{
Watchdog_init();
Watchdog_Params_init (params);
params.resetMode = Watchdog_reset_on;
params.callbackFxn =(Watchdog_Callback) WatchCallbackFxn;
看门狗 Handle = Watchdog_open (CONFIG_Watchdog_0、params);
if (watchdogHandle ==空)
{
usleep(1);
}
}

void * controlTask (void * pvParameters)
{
…………
Watchdog_setReload (watchdogHandle、150000);
} 

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

    平台是什么? 是定制板还是 TI LaunchPad?

    在 OTA 中、我们建议通过引导加载程序使用看门狗。 您应该编写文件"/sys/mcubootinfo.bin "并在 sBootInfo.ulStartWdtTime 中设置持续时间。请参阅以下代码(来自 CloudOTA 示例)。 复位后(当系统文件位于 n 位置时)、引导加载程序将在运行新映像之前设置看门狗。 如果看门狗过期(未提交新代码)、引导加载程序将恢复到之前的(工作中)映像。

    int32_t Platform_CommitWdtConfig (int32_t TimeoutInSeconds)
    {
    #ifdef CC32XX
    int32_t lFileHandle;
    uint32_t ulToken = 0;
    sBootInfo_t sBootInfo;
    int32_t lRetVal;
    
    lFileHandle = sl_FsOpen (
    (unsigned char *)"/sys/mcubootinfo.bin、
    SL_FS_create | SL_FS_OVERWRITE |
    SL_FS_CREASE_MAX_SIZE (
    sizeof (sBootInfo))|
    SL_FS_CREASE_SECURE | SL_FS_CREATE _PUBLICE_WRITE |
    SL_FS_CREATE_NOSIGNATURE、
    (_u32 *)&ulToken);
    
    if (0 > lFileHandle)
    {
    //ota_DBG_PRINT ("OtaWatchdDog:打开 bootinfo 文件时出错
    // :%d\n\r\n",lFileHandle);
    return(-1);
    }
    
    memset (&sBootInfo、0、sizeof (sBootInfo_t));
    /*最大104秒*/
    sBootInfo.ulStartWdtTime = 40000000 *超时秒;
    sBootInfo.ulStartWdtKey = APPS_WDT_START_KEY;
    lRetVal =
    sl_FsWrite (lFileHandle、0、(uint8_t*)&sBootInfo、sizeof (sBootInfo_t));
    lRetVal = sl_FsClose (lFileHandle、0、0);
    if (0!= lRetVal)
    {
    //ota_DBG_PRINT ("OtaWatchdDog:无法关闭引导信息文件");
    return(-1);
    }
    #endif
    //启用 WDT -由 PRCMCC3200MCUInit 完成
    //HWREG (0x4402E188)|= 0x00000020;
    返回(0);
    }
    

    在执行 MCU 复位之前、请确保调用"sl_Stop()"。

    请发送整个 OTA 过程的日志(在 otauser.h 中启用 OTA 库日志:"sl_enable_ota_debug_Traces")。

    BR、

    Kobi