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的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是这么回事,好像没看到相关的介绍。

  • 可以在高级模式中修改

  • 但是uniflash烧录后好像只有一个mcuimg,我希望的是通过uniflash烧一个mcuimg,然后通过网络或者spi数据传输利用程序再写一个mcuimg2,然后依旧是通过程序完成某种切换操作后(CC3200是更改"/sys/mcubootinfo.bin"中的active img),复位,系统开始运行mcuimg2,所有想问问CC3235S怎么做。
  • 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例程升级
  • 您好,关于文件系统我还有点问题,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"这个证书还是说本来就是这样的
  • 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是一个虚拟的证书,只能用来调试,发布产品时需要自己创建证书
  • 好的,谢谢您,关于文件系统中的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

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

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