TI中文支持网
TI专业的中文技术问题搜集分享网站

关于CC3235S的MCUimg和file system

Other Parts Discussed in Thread:CC3235S, CC3200, UNIFLASH

想问一下CC3235S只能将"/sys/mcuimg.bin"读到ram里然后运行吗,能不能自己决定加载哪个镜像文件,比如自己写个"/sys/mcuimg2.bin",然后通过什么操作可以让板子复位重启后加载我想加载的文件到ram里运行,而不是默认加载"/sys/mcuimg.bin"

CC3200的SDK中有application_BootLoader的例程,好像通过"/sys/mcubootinfo.bin"可以决定active img,CC3235S是这么回事,好像没看到相关的介绍。

Kevin Qiu1:

可以在高级模式中修改

,

Zhiyuan HE:

但是uniflash烧录后好像只有一个mcuimg,我希望的是通过uniflash烧一个mcuimg,然后通过网络或者spi数据传输利用程序再写一个mcuimg2,然后依旧是通过程序完成某种切换操作后(CC3200是更改"/sys/mcubootinfo.bin"中的active img),复位,系统开始运行mcuimg2,所有想问问CC3235S怎么做。

,

Kevin Qiu1:

CC3235S的SDK中没有application_BootLoader例程,没有提供类似的方法,可以参考
C:\ti\simplelink_cc32xx_sdk_4_20_00_07\examples\rtos\CC3235S_LAUNCHXL\demos\cloud_ota
C:\ti\simplelink_cc32xx_sdk_4_20_00_07\examples\rtos\CC3235S_LAUNCHXL\demos\local_ota例程升级

,

Zhiyuan HE:

您好,关于文件系统我还有点问题,sl_FsClose(FileHdl,0,'A',1);这个函数按照programer's guide文档的说法,应该和文件没关闭直接断开电源是一样的效果,所有如果文件是failsafe的,那么调用sl_FsClose(FileHdl,0,'A',1);应该还原成旧版本的,但是我在CC3235S上打开mcuimg.bin,随便写入几个字符后调用sl_FsClose(FileHdl,0,'A',1);后发现还是写进去了,请问这是怎么回事。

另一个问题,因为abort是不正常关闭,所以对于正常关闭的加密(secure-signed)文件应该调用sl_FsClose(file_handle, CeritificateFileName, Signature, SignatureLen);但是CeritificateFileName为"dummy-root-ca-cert"的话,无论signature是什么字符串,只要不是空的,都可以正常关闭文件,想问问是怎么回事。是不应该选择"dummy-root-ca-cert"这个证书还是说本来就是这样的

,

Kevin Qiu1:

1.If the file was created with a FAILSAFE flag, the storage of the nonactive content is erased; thus, if the device was powered off before the file closure, the file contains the last valid content.
2.是的,dummy-root-ca-cert是一个虚拟的证书,只能用来调试,发布产品时需要自己创建证书

,

Zhiyuan HE:

好的,谢谢您,关于文件系统中的servicepack我还想请教一下,programer's guide中说servicepack不能公共读,只能公共写,如果需要读是需要mastertoken对吧,我想问问这个mastertoken在哪里可以获得

,

Kevin Qiu1:

Zhiyuan HE 说:servicepack不能公共读,只能公共写,

具体是在哪里看到的?

Servicepack是由TI提供的,包含了对设备代码的修复,可以通过OTA应用程序刷新ServicePack

C:\ti\simplelink_cc32xx_sdk_4_20_00_07\tools\cc32xx_tools\servicepack-cc3x35

关于MasterToken看下:

/*!\endcond
*/
/*!\brief open file for read or write from/to storage device\param[in]pFileNameFile Name buffer pointer\param[in]AccessModeAndMaxSizeOptions: As described below\param[in]pTokeninput Token for read, output Token for writeAccessModeAndMaxSize possible input\nSL_FS_READ- Read a file\nSL_FS_WRITE- Open for write for an existing file (whole file content needs to be rewritten)\nSL_FS_CREATE|maxSizeInBytes,accessModeFlagsSL_FS_CREATE|SL_FS_OVERWRITE|maxSizeInBytes,accessModeFlags- Open for creating a new file. Max file size is defined in bytes.\nFor optimal FS size, use max size in 4K-512 bytes steps (e.g. 3584,7680,117760)\nSeveral access modes bits can be combined together from SlFileOpenFlags_e enum\returnFile handle on success. Negative error code on fail\sasl_FsRead sl_FsWrite sl_FsClose\notebelongs to \ref basic_api\warning\parExample- Creating file and writing data to it\codechar*DeviceFileName = "MyFile.txt";unsigned longMaxSize = 63 * 1024; //62.5K is max file sizelongDeviceFileHandle = -1;_i32RetVal;//negative retval is an errorunsigned longOffset = 0;unsigned charInputBuffer[100];_u32MasterToken = 0;// Create a file and write data. The file in this example is secured, without signature and with a fail safe commit//create a secure file if not exists and open it for write.DeviceFileHandle =sl_FsOpen(unsigned char *)DeviceFileName,SL_FS_CREATE|SL_FS_OVERWRITE | SL_FS_CREATE_SECURE | SL_FS_CREATE_NOSIGNATURE | SL_FS_CREATE_MAX_SIZE( MaxSize ),&MasterToken);Offset = 0;//Preferred in secure file that the Offset and the length will be aligned to 16 bytes.RetVal = sl_FsWrite( DeviceFileHandle, Offset, (unsigned char *)"HelloWorld", strlen("HelloWorld"));RetVal = sl_FsClose(DeviceFileHandle, NULL, NULL , 0);// open the same file for read, using the Token we got from the creation procedure aboveDeviceFileHandle =sl_FsOpen(unsigned char *)DeviceFileName,SL_FS_READ,&MasterToken);Offset = 0;RetVal = sl_FsRead( DeviceFileHandle, Offset, (unsigned char *)InputBuffer, strlen("HelloWorld"));RetVal = sl_FsClose(DeviceFileHandle, NULL, NULL , 0);\endcode<br>- Create a non secure file if not already exists and open it for write\codeDeviceFileHandle = sl_FsOpen((unsigned char *)DeviceFileName,SL_FS_CREATE|SL_FS_OVERWRITE| SL_FS_CREATE_MAX_SIZE( MaxSize ),NULL);\endcode\noteSome of the flags are creation flags and can only be set when the file is created. When opening the file for write the creation flags are ignored. For more information, refer to chapter 8 in the user manual.*/#if _SL_INCLUDE_FUNC(sl_FsOpen)
_i32 sl_FsOpen(const _u8 *pFileName,const _u32 AccessModeAndMaxSize,_u32 *pToken);
#endif

,

Zhiyuan HE:

在CC3x20, CC3x35 SimpleLink™ Wi-Fi® and Internet of Things Network Processor programer's guide的8.4.3.2看到的

不过我找到另一种方法绕开这个问题了,还是谢谢您

,

Kevin Qiu1:

好的

赞(0)
未经允许不得转载:TI中文支持网 » 关于CC3235S的MCUimg和file system
分享到: 更多 (0)