请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC3220S-LAUNCHXL 主题中讨论的其他器件:UNIFLASH
我错误地从 UniFlash 中的用户文件下删除了文件 mcubootimg.bin。 如何将此文件还原到工具中? 我需要它来为 CC3220器件生成十六进制文件。 该文件应显示在 mcuflashimg.bin 旁边
。
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.
我错误地从 UniFlash 中的用户文件下删除了文件 mcubootimg.bin。 如何将此文件还原到工具中? 我需要它来为 CC3220器件生成十六进制文件。 该文件应显示在 mcuflashimg.bin 旁边
。
该文件在 OTA 示例中生成(因为其结构包含看门狗超时以保护 OTA 之后的测试映像)。
您可以运行 OTA 示例以生成文件、也可以在您的示例之一中运行以下代码(当然、您可以根据给定的结构创建文件)。
typedef struct sBootInfo
{
uint8_t ucActiveImg;
uint32_t ulImgStatus;
uint32_t ulStartWdtKey;
uint32_t ulStartWdtTime;
}sBootInfo_t;
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_CREATE_MAX_SIZE(
sizeof(sBootInfo)) |
SL_FS_CREATE_SECURE | SL_FS_CREATE_PUBLIC_WRITE |
SL_FS_CREATE_NOSIGNATURE,
(_u32 *)&ulToken);
if(0 > lFileHandle)
{
//OTA_DBG_PRINT("OtaWatchDog: Error opening bootinfo file
// : %d\n\r",lFileHandle);
return(-1);
}
memset(&sBootInfo,0,sizeof(sBootInfo_t));
/* max 104 seconds */
sBootInfo.ulStartWdtTime = 40000000 * TimeoutInSeconds;
sBootInfo.ulStartWdtKey = APPS_WDT_START_KEY;
lRetVal =
sl_FsWrite(lFileHandle, 0, (uint8_t*)&sBootInfo, sizeof(sBootInfo_t));
lRetVal = sl_FsClose(lFileHandle, 0, 0, 0);
if(0 != lRetVal)
{
//OTA_DBG_PRINT("OtaWatchDog: Failed to close the bootinfo file");
return(-1);
}
#endif
//Enable WDT - done by PRCMCC3200MCUInit
//HWREG(0x4402E188) |= 0x00000020;
return(0);
}
下面是一个示例文件:
e2e.ti.com/.../mcubootinfo.bin
BR、
Kobi