想问一下CC3235S只能将"/sys/mcuimg.bin"读到ram里然后运行吗,能不能自己决定加载哪个镜像文件,比如自己写个"/sys/mcuimg2.bin",然后通过什么操作可以让板子复位重启后加载我想加载的文件到ram里运行,而不是默认加载"/sys/mcuimg.bin"
CC3200的SDK中有application_BootLoader的例程,好像通过"/sys/mcubootinfo.bin"可以决定active img,CC3235S是这么回事,好像没看到相关的介绍。
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只能将"/sys/mcuimg.bin"读到ram里然后运行吗,能不能自己决定加载哪个镜像文件,比如自己写个"/sys/mcuimg2.bin",然后通过什么操作可以让板子复位重启后加载我想加载的文件到ram里运行,而不是默认加载"/sys/mcuimg.bin"
CC3200的SDK中有application_BootLoader的例程,好像通过"/sys/mcubootinfo.bin"可以决定active img,CC3235S是这么回事,好像没看到相关的介绍。
好的,谢谢您,关于文件系统中的servicepack我还想请教一下,programer's guide中说servicepack不能公共读,只能公共写,如果需要读是需要mastertoken对吧,我想问问这个mastertoken在哪里可以获得
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] pFileName File Name buffer pointer \param[in] AccessModeAndMaxSize Options: As described below \param[in] pToken input Token for read, output Token for write AccessModeAndMaxSize possible input \n SL_FS_READ - Read a file \n SL_FS_WRITE - Open for write for an existing file (whole file content needs to be rewritten)\n SL_FS_CREATE|maxSizeInBytes,accessModeFlags SL_FS_CREATE|SL_FS_OVERWRITE|maxSizeInBytes,accessModeFlags - Open for creating a new file. Max file size is defined in bytes. \n For optimal FS size, use max size in 4K-512 bytes steps (e.g. 3584,7680,117760) \n Several access modes bits can be combined together from SlFileOpenFlags_e enum \return File handle on success. Negative error code on fail \sa sl_FsRead sl_FsWrite sl_FsClose \note belongs to \ref basic_api \warning \par Example - Creating file and writing data to it \code char* DeviceFileName = "MyFile.txt"; unsigned long MaxSize = 63 * 1024; //62.5K is max file size long DeviceFileHandle = -1; _i32 RetVal; //negative retval is an error unsigned long Offset = 0; unsigned char InputBuffer[100]; _u32 MasterToken = 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 above DeviceFileHandle = 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 \code DeviceFileHandle = sl_FsOpen((unsigned char *)DeviceFileName, SL_FS_CREATE|SL_FS_OVERWRITE| SL_FS_CREATE_MAX_SIZE( MaxSize ), NULL); \endcode \note Some 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