主题中讨论的其他器件:CC3235SF、 UNIFLASH
你好!
我正在尝试在 CC3235SF (在开发模式下)上安装证书、但当我尝试对 OTP 进行编程时、它会失败。 我已按照您在 swru469h、 swru547a 和 swpu332a 中的文档进行操作。 “供应商证书”保留了其“.der”扩展名,而“根 CA”的扩展名(DER 格式)已被删除。 所有密钥都是使用 OpenSSL 通过 RSA 2048生成的。
我们可以在此处看到用于生成证书的方法:
# ROOT OF TRUST CERTIFICATE (Signs/verifies the catalog) #=============================================================================== # Generate Private Key openssl genrsa -out "$RootOfTrustKey.pem" 2048 #Create Certificate openssl req -x509 -sha256 -new -nodes -key "$RootOfTrustKey.pem" -days "$ValidNumDays" \ -subj "$ROTSpecs" -out "$RootOfTrustCert.pem" # Convert Cert to DER Format openssl x509 -in "$RootOfTrustCert.pem" -out "$RootOfTrustCert" -outform "DER" # SS ROOT CA CERTIFICATE (SoftwareSigning Root CA) #=============================================================================== # Generate Root Private Key openssl genrsa -out "$SSRootCAKey.pem" 2048 # Create and Self-Sign Root CA Certificate openssl req -x509 -sha256 -new -nodes -key "$SSRootCAKey.pem" \ -days "$ValidNumDays" -subj "$SSCASpecs" \ -addext 'keyUsage=keyCertSign' -set_serial 0 -out "$SSRootCACert.pem" # Convert Cert to DER Format openssl x509 -in "$SSRootCACert.pem" -out "$SSRootCA" -outform "DER" #Copy to Cert Catalog cp "$SSRootCA" "$CADir/" # SS CERTIFICATE (Vendor cert, for softwareSigning) #=============================================================================== # Generate Private Key openssl genrsa -out "$SSKey.pem" 2048 # Generate the CSR openssl req -config "$SS.cnf" -batch -new -nodes \ -key "$SSKey.pem" -out "$SSCSR.pem" # Sign with the Root-CA openssl ca -config "$SS.cnf" -batch -in "$SSCSR.pem" \ -out "$SSCert.pem" # Convert to DER openssl x509 -in "$SSCert.pem" -outform "DER" -out "$SS.der"
(根 CA 被添加到将成为证书目录的文件夹中)
我已经知道需要将"供应商证书"添加到 CCS 项目中、Uniflash 项目需要使用它及其密钥对 MCU 进行签名/验证。 使用"信任根私钥"创建并签名目录(以 PEM 格式、由于具有 CC3235SF、因此使用 SHA2)。 OTP 元数据使用"信任根私钥"创建和签名(使用 SHA2与以前一样)。 使用"algo 2"创建"inf-file"(再次表示 SHA2)。
# SETUP PROJECT IN UNIFLASH AND CCS #=============================================================================== # Add "$SSRootCA" and "$SS.der" to both the UniFlash and the CCS project # Build the CCS project # Add the MCU to the Uniflash Project (FAILSAFE, SECURE, PUBLICWRITE) # Sign the MCU with "$SSKey.pem" and verify with "$SS.der" # (Done automatically based on chapter 7 in swru469h, but same result as when done manually) # CERTIFICATE CATALOG #=============================================================================== # Create the Cert Catalogue "$ImageCreatorPath/SLImageCreator.exe" \ tools make_cert_catalog --cert_folder "$CADir/" --out_file "$Catalog.lst" # Sign the Cert Catalogue "$ImageCreatorPath/SLImageCreator.exe" \ tools sign --file "$Catalog.lst" --priv "$RootOfTrustKey.pem" --out_file "$Catalog.lst.signed.bin" --fmt BINARY_SHA2 # Set the Cert Catalog "$ImageCreatorPath/SLImageCreator.exe" \ project set_certstore --name "$ProjName" --file "$Catalog.lst" --sign "$Catalog.lst.signed.bin" # One-Time-Programming #=============================================================================== #Create OTP Metadata "$ImageCreatorPath/SLImageCreator.exe" \ tools meta --cert "$RD/$RootOfTrustCert.pem" --out_file "$OTP.meta #Sign the OTP Metadata "$ImageCreatorPath/SLImageCreator.exe" \ tools sign --file "$OTP.meta" --priv "$RD/$RootOfTrustKey.pem" --out_file "$OTP.meta.sig" --fmt BINARY_SHA2 #Create the OTP Info "$ImageCreatorPath/SLImageCreator.exe" \ tools inf --algo 2 --sign1 "$OTP.meta.sig" --meta "$OTP.meta" --out_file "$OTP.inf" # Set OTP (<---- Crashes here!!!) "$ImageCreatorPath/SLImageCreator.exe" \ project program --name "$ProjName" --vendor_cert --otp_file "$OTP.inf" --dev
崩溃发生在前一代码的最后一步。 以下是输出: (长路径已被[...]取代)
================================================================================
CCS headless build complete! 0 out of 1 projects have errors.
INFO:root:FTDI not detected, trying XDS
INFO:slbootloader.slbootloader:Connecting to device
INFO:slbootloader.slbootloader:Power off
INFO:slbootloader.slbootloader:Set break signal
INFO:slbootloader.slbootloader:Power on
INFO:slbootloader.slbootloader:Clear break signal
INFO:slbootloader.slbootloader:Connection succeeded
INFO:slbootloader.slbootloader:Received storage list
partitionBitMap 0 00000000
partitionBitMap24 0 00000000
checkSum 0 00000000
------------------------
Copyright 2014 TI.com. All rights reserved, SimpleLink programming image builder
Builder = 5.0.0.2
Interface version = 1.0.2.16
Recommended command line window resolution W124 X H67
The output directory is :[[...]\sl_image]
The XML file is :[[...]\sl_image\ImageConfig.xml]
Validate the XML against the schema.
The XML validation passed.
------------------------
Commands Set Number = 0
CommandNum = 0
CommandFormatStorage:
CommandNum = 1
CommandWriteCertificateStore:
FileLocation = [...]\sl_cs\certificate_catalog.lst
FileSystemName = /sys/certstore.lst
File max size is 7000 bytes, actual size 472 bytes
After running the extracting the file will require 4 blocks on the device
CommandNum = 2
CommandWriteServicePack:
Service pack versions, NWP = (4, 17, 0, 0) MAC = (3, 1, 0, 5) PHY = (3, 1, 0, 25)
Max Service Pack file size = 131072
FileLocation = [...]\sl_sp\sp_4.13.0.2_3.7.0.1_3.1.0.26.bin
FileSystemName = /sys/servicepack.ucf
File max size is 131072 bytes, actual size 81916 bytes
After running the extracting the file will require 66 blocks on the device
CommandNum = 3
CommandWriteSystemFile:
FileLocation = [...]\sl_fs\sys\ipcfg.bin
FileSystemName = 17
File max size is 240 bytes, actual size 240 bytes
After running the extracting the file will require 2 blocks on the device
CommandNum = 4
CommandWriteSystemFile:
FileLocation = [...]\sl_fs\sys\mode.cfg.bin
FileSystemName = 0
File max size is 132 bytes, actual size 132 bytes
After running the extracting the file will require 2 blocks on the device
CommandNum = 5
CommandWriteSystemFile:
FileLocation = [...]\sl_fs\sys\device.name.bin
FileSystemName = 5
File max size is 98 bytes, actual size 98 bytes
After running the extracting the file will require 2 blocks on the device
CommandNum = 6
CommandWriteSystemFile:
FileLocation = [...]\sl_fs\sys\ap.cfg.bin
FileSystemName = 1
File max size is 158 bytes, actual size 158 bytes
After running the extracting the file will require 2 blocks on the device
CommandNum = 7
CommandWriteSystemFile:
FileLocation = [...]\sl_fs\sys\httpsrv.cfg.bin
FileSystemName = 4
File max size is 387 bytes, actual size 387 bytes
After running the extracting the file will require 2 blocks on the device
CommandNum = 8
CommandWriteSystemFile:
FileLocation = [...]\sl_fs\sys\sta.cfg.bin
FileSystemName = 12
File max size is 136 bytes, actual size 136 bytes
After running the extracting the file will require 2 blocks on the device
CommandNum = 9
CommandWriteSystemFile:
FileLocation = [...]\sl_fs\sys\dhcpsrv.cfg.bin
FileSystemName = 3
File max size is 12 bytes, actual size 12 bytes
After running the extracting the file will require 2 blocks on the device
CommandNum = 10
CommandWriteFile:
FileLocation = [...]\sl_fs\sys\phypwr.cal.bin
FileSystemName = /sys/phypwr.cal
File max size is 312 bytes, actual size 312 bytes
After running the extracting the file will require 1 blocks on the device
CommandNum = 11
CommandWriteFile:
FileLocation = [...]\sl_temp\tmp0ouhge
FileSystemName = "$SS.der"
File max size is 976 bytes, actual size 976 bytes
After running the extracting the file will require 1 blocks on the device
CommandNum = 12
CommandWriteFile:
FileLocation = [...]\sl_temp\tmpegv3gk
FileSystemName = "$SSRootCA"
File max size is 969 bytes, actual size 969 bytes
After running the extracting the file will require 1 blocks on the device
CommandNum = 13
CommandWriteFile:
FileLocation = [...]\sl_temp\tmpgphs_l
FileSystemName = /sys/mcuflashimg.bin
File max size is 1048576 bytes, actual size 79200 bytes
After running the extracting the file will require 514 blocks on the device
CommandNum = 14
CommandWriteFile:
FileLocation = ../files\CrashMiniDump.bin
FileSystemName = /tmp/CrashMiniDump.bin
File max size is 24576 bytes, actual size 1 bytes
After running the extracting the file will require 7 blocks on the device
For Set Number = 0 ,
Set Files will require 608 blocks on the device after running the extraction ( Programming image is not included )
------------------------
The actual size of the image data is 172032 bytes
=> The image data requires minimum of 44 blocks on the device.
Block size is 4096 bytes.
Configured Storage size is 1024 blocks.
Total size of image( 44 blocks )
Total size of user files after extraction( 10 blocks )
Total size of FileSystem( 4 blocks )
Total System files after extraction(includes reserved space for system files)( 620 blocks )
Total reserved for system files ( 620 blocks )
Service pack after extraction size ( 66 blocks )
Application code after extraction size ( 514 blocks )
Kept for system files ( 32 blocks )
System files after extraction size (includes the service-pack) ( 598 blocks )
Reserved size for the Image (includes image protecting) ( 64 blocks )
==> After the extraction the set will require total size of 698 blocks.<==
==> During the extraction process the set will require total size of 698 blocks.<==
Non-encrypted files generated successfully !!!
Finished successfully !!!!
The products are available in : [c:\ti\uniflash_8.0.0\simplelink\imagecreator\bin\[...]\sl_image\Output ]
------------------------
INFO:root:Patching Secondary RAM...
Preparing...: 100% (94708/94708)OTP already locked !!!!!
Preparing...: 100% (1008/1008)OTP already locked !!!!!
Modified capacity = 2!!!
Image Programming: 99% (172032/173296)INFO:slbootloader.slbootloader:Received error : error number = -10289 , extended error = 2694
Traceback (most recent call last):
File "<string>", line 5266, in <module>
File "<string>", line 5262, in main
File "<string>", line 5232, in cmdline
File "<string>", line 4077, in command_project_program
File "<string>", line 2741, in program_image_from_project
File "<string>", line 2946, in program_image
File "W:\slbootloader\slbootloader.py", line 793, in fs_programming
slbootloader.slbootloader.BootLoaderError:
Error: SLImageCreator.exe: fs_programming error: ret: -10289, ex_err: 2694 - FS_WRONG_SIGNATURE
SLImageCreator returned -1
如您所见、错误消息为:"FS_ERROR_signatic"。
如果仅使用虚拟证书和虚拟目录、映像会成功构建、这就是我对所有这些都有点困惑的原因。 希望获得一些关于我所做的错误的反馈。 提前感谢!