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.

[参考译文] CCS/CC3220SF-LAUNCHXL:使用 slimagecreator 创建 Gang 映像

Guru**** 2576215 points
Other Parts Discussed in Thread: CC3220SF, UNIFLASH

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

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/718269/ccs-cc3220sf-launchxl-gang-image-creation-using-slimagecreator

器件型号:CC3220SF-LAUNCHXL
主题中讨论的其他器件:CC3220SFUNIFLASH

工具/软件:Code Composer Studio

由于我们需要将自定义文件添加到在生产过程中分配的 Gang 映像中、因此我们使用 UNI-Flash 提供的 SLImagecreater.exe 构建了自己的映像创建器。
按照以下步骤创建映像:
1.纤体项目新名称 --device CC3220SF --mode production --overwrite
2. slimagecreater 项目 add_file --name --file -fs_path -覆盖
3. slimagecreater 项目 add_file --name --file -fs_path -覆盖
4. slimagecreater 项目 add_file --name --file -fs_path -覆盖
5.使用以下命令将一些 owm 创建的文件添加到项目中
  slimagecreater 项目 add_file --name --file -fs_path --failsafe flags --overwrite
6. slimagecreater 项目 add_file --name --file --mcu --priv --cert --failsafe 标志--overwrite --max_size 524288
7. slimagecreater set_sp --name --file
8. slimagecreater project set_certstore --name --file --sign
9.纤体主题重新配置--name --file "\reconfig.json"
10.纤体项目 create_image --name --file dump.sli

对创建的映像进行编程后、UC 开始工作、但 NWP 不会启动。 ~65秒后、smplink-API 运行超时:
[00065.559][错误]-致命错误:检测到异步事件超时[事件操作码=0x8] </r></n>
[00065.567]---- > smplink 状态已启动->错误</r></n>
[00065.572] SMPLNK:smplink_start -2005,重置 NWP...</r></n>
[00066.178] SMPLNK:[line:430,error code:-2005] SMPLNK:Device error,please refer "device errors codes" section in error.h</r></n>

当我对由 UNITFlash 创建的映像使用相同的配置时、一切都可以正常工作。 同样、在开发模式下创建映像(使用虚拟可信链)时、我们自己创建的映像也会启动。


有什么想法、会导致这种行为?

谢谢、
Christian

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

    如何对映像进行编程? SLI 映像只能用于 UART 编程、因此如果您使用的是 SPI、它将不起作用。

    您能否尝试在没有最后一个 create_image 行的情况下运行该脚本、然后在 GUI 中检查项目以确保所有参数都正确? 也许当您仅使用 GUI 时、您输入的参数会有所不同。

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

    Kristen、您好!

    通过 UART 使用工具"CC3X20EMBEDDEDPROG"对映像进行编程。 它适用于使用 Uniflash 创建的生产映像、也适用于使用我们的工具创建的开发映像。

    我已经调试了我的工具并在上一次 SLI 调用之前停止执行。 然后、我比较了生成的.db 文件、甚至将内容修改为相等。 仍然无法正常工作。 项目文件夹中生成的所有证书以及 mcuimage 都是相等的(二进制比较)。 我还能比较什么?

    谢谢、此致、
    Christian

    添加了:
    我刚才比较了整个目录、包括 sl_temp 文件夹(使用 ImageConfig.xml 逐文件查看要比较的文件)。 包括生成的文件(UCF、bin、...)的文件大小,所有内容都是相同的。 将文件添加到项目中的顺序是否相关?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    Kristen、您好!
    您能否优先处理此帖子、因为客户被禁止生产。

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

    您是否曾尝试使用 slimagecreator 创建的映像、然后使用 Uniflash 对其进行编程? 反之亦然?

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

    我已经使用我们的编程工具(基于 CC3X20EMBEDDEDPROG)对 Uniflash 映像进行了编程、该工具正在工作、并且刚刚通过 Uniflash 对自己创建的映像进行了编程。 没有改变。 自己创建的映像无法启动 NWP。

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

    您使用的是 Uniflash 的哪个版本? 您的编程工具如何工作? 我注意到您在脚本中拼错了 SLImageCreator.exe、您是否可以通过某种方式复制和粘贴它?

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

    很抱歉耽误你的时间。 我已经添加了一条注释、但这在某种程度上丢失了...
    Uniflash 版本4.3.1.1835

    以下内容基本上是原始内容、删除的客户名称和更改的证书除外。

    以下是脚本(VisualBasic):

    tempBuffer ="project new --name "+ cFIRMWARE_VERSION +"--device CC3220SF --mode production --overwrite"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、True、True、15000、 tempResult)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#2失败:"+ tempResult)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project add_file --name "+ cFIRMWARE_VERSION +"--file "+""""+ currentWorkingFolder +"\server_ca"--fs_path "server_ca"--overwrite"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#3"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project add_file --name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\company_cert --fs_path company_cert --overwrite"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#3"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project add_file --name "+ cFIRMWARE_VERSION +"--file "+""""+ currentWorkingFolder +"\root_ca"--fs_path "root_ca"--overwrite"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#3"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project add_file --name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\factory_cert --fs_path factory_cert --flags failsafe --overwrite"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、True、True、15000、 tempResult)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#4"+ vbCrLf + tempResult 失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project add_file --name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\factory_priv_key --fs_path factory_priv_key --flags failsafe --overwrite"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#4"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project add_file --name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\factory_conf --fs_path factory_conf --flags failsafe --overwrite"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#4"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project add_file --name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\mcuflashimage.bin --mcu --priv"+ currentWorkingFolder +"\cert company_key --cert company_cert --failsafe flags --overwrite --max_size 524288"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#5"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project set_sp -name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\sp_3.8.0.3_2.0.0.0_2.2.0.6.bin"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#6"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project set_certstore --name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\certcatalog20171221.lst"+"--signed "+ currentWorkingFolder +"\cert20171221.lst.signed_3220.bin"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#7"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    ' reconfig.json 的内容:
    '"{"SimpleLink":{"apSsid":"XYZ -"+ Chr (machine_SN (11))+ Chr (machine_SN (12))+ Chr (machine_SN (13))+"""、"deviceName":"name "、"MacineAddress"}"+"Macine":"
    tempBuffer ="project reconfig --name "+ cFIRMWARE_VERSION +"--file "+ currentWorkingFolder +"\reconfig.json"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、15000、 tempBuffer)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#8"失败)
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

    tempBuffer ="project create_image --name "+ cFIRMWARE_VERSION +"--file dump.sli"
    if (RunProcessWithExitCode ("slimagecreator.exe"、tempBuffer、False、True、30000、 tempResult)<>0)
    console.WriteLine ("错误:创建 flashImage 步骤#9失败("& tempResult &"")")
    cleanUpFiles (projectFolder、True)
    返回-1
    结束 IF

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

    亚伦、克里斯汀、

    此问题"解决"。 客户意外按下此按钮。

    此致、Bernd

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

    请尝试使用由 Uniflash GUI 创建的工程、然后通过命令行添加其他文件。

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

    我已经尝试了以下操作:
    -创建了完整的新 UNITFlash 项目并添加了 mcuflashimage.bin 和有效的证书链
    -打开命令行并执行展开的命令:
    -slimagecreator project add_file --name ProductionTool_Test --file "path\To\file\factory_conf"--fs_path factory_conf --flags failsafe --overwrite
    - slimagecreator 项目 add_file --name ProductionTool_Test --file "path\to\file\cert.cer"--fs_path factory_cert --flags failsafe --overwrite
    - slimagecreator 项目 add_file --name ProductionTool_Test --file "path\To\file\prive.key"--fs_path factory_priv_key --flags failsafe --overwrite
    - slimagecreator 项目重配置--name ProductionTool_Test --file "path\To\files\reconfig.json"
    - slimagecreator 项目 create_image --name ProductionTool_Test --file dump.sli

    从而导致完全相同的行为。

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

    我做了更多的测试、发现在不执行上述调用的"reconfig"行时、映像工作正常。
    我们需要更改默认 SSID 和器件名称。 以下是上述调用中使用的 json 文件的内容:
    {"SimpleLink":{"apSsid":"XYZ-249"、"deviceName":"XYZ_C8"}

    有什么想法、为什么这个调用(slimagecreator project reconfig --name ProductionTool_Test --file "path\To\file\config.json")会导致镜像无法启动 NWP?

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

    只需确认一下、当您使用 Uniflash 创建映像并且映像正常工作时、是否使用了同一个 json 文件? 您是否曾尝试使用不同的测试 json 文件调用 reconfig 来查看它是否起作用?

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

    Kristen、您好!

    我刚刚通过以下步骤执行了该测试:
    1.使用 UNITFlash 创建了一个项目,添加了所有文件,并在没有"RECONFIG"调用的情况下测试了映像的功能-->工作正常
    2.关闭 UNITFlash 并运行以下两个调用:

    • slimagecreator 项目重配置--name ProductionTool_Test --file "path\To\reconfig.json"
    • slimagecreator 项目 create_image --name ProductionTool_Test --file dump.sli

    新映像无法启动 NWP -->重新配置调用会使映像无效,从而无法启动 NWP。

    因此、我的问题是:运行重新配置需要哪些内容? 我们需要更改默认 SSID。

    谢谢、此致、
    Christian