Read back hex to verify programming

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
10 posts / 0 new
Last post
hughesk
Offline
Last seen:2年6个月前
Joined:2014-04-26 02:56
Read back hex to verify programming

Hello,
我想使用SmartSnippets.exe CLI工具在编程DA14580后读取闪光灯的内容,并自动将结果字节与原始六角文件文件进行比较。
请将我指向一个工具,以将keil-output hex文件转换为smartsnippets格式化的十六进制数据,反之亦然?

目前,Keil输出看起来像这样(这是英特尔十六进制格式吗?):
:020000042000DA
:100000000000980020b9040020c1040020d90c1040020d904002079
:10000000000000000/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

And the Smart Snippets CLI outputs a file that looks like:
地址十六进制文本
0x00000 70 50 00 00 00 00 4A D0 pP J?
0x00008 00 98 00 20 B9 04 00 20 ? ?

One could programmatically convert the intel hex into the ASCII hex shown in the Smart Snippets file and cut out just the hex portion of that file, but if there is a simpler way to do this validation, that would be much appreciated!

谢谢,
Kevin

设备:
MT_dialog
Offline
Last seen:2个月3周前
Staff
Joined:2015-06-08 11:34
Hi hughesk,

Hi hughesk,

The output of keil is a .hex intel format file and what is burned in the flash is the actual binary file, since the cli passes the .hex file through a hex2bin.exe in order to generate the .bin file. The cli command tool embedds a verify flag if that is what you are looking for. Please check the help document of the Smart Snippets (open the Smart Snippets Toolbox and check the help option, there you will find the Help document) it explains also the cli commands available for the 58x and the 68x families.

Thanks MT_dialog

hughesk
Offline
Last seen:2年6个月前
Joined:2014-04-26 02:56
Hello,

Hello,
一段时间后我会回到这个问题。我有两个后续问题:
1.我没有看到与闪存相关的验证标志的CLI选项。如果闪存期间使用的SmartSnippet和DA14580二进制文件已经进行了验证闪存,我只需要某种方式来证明在释放到生产之前。那么,你有一个验证标志,我错过了,或者以一次性演示或测试smartsnippet / da14580闪存验证?

2. If there is either not a verification flag or the verification process is not able to be demonstrated, then I can read the flash memory contents back onto disk. This is straightforward, and I can then convert that hex file to a binary file. I then want to compare two binary files:
a. The binary generated from the flash read back
湾从keil编译的hex文件生成的二进制文件
但是,我发现这两个有一些轻微的差异。忽略前8个字节(添加以使其启动),似乎有几个0x00在rescl中的0x00中的0x0在Keil-hex二进制中。这些地点是否可预测?除非我可以解释这些(允许的次要)差异,否则我无法进行直接验证,并且我不一定希望将它们硬编码为例外。

Thanks in advance for your help!

MT_dialog
Offline
Last seen:2个月3周前
Staff
Joined:2015-06-08 11:34
Hi hughesk,

Hi hughesk,

  1. 我不确定搞定问题,将文件刻录到Flash的CLI命令包括验证选项,如果设置[-verify]标志工具将验证闪存上的刻录二进制文件。你到底是什么意思“来自Flash验证的一次性演示”?该工具如果指示验证它将推出验证是否已成功。请检查SSToolbox的帮助选项工具的帮助文档。
  2. 关于第二个问题在二进制文件中将其下载到ARM中.bin文件,而不是从keil生成的.hex文件,您无法直接比较这两个文件。二进制文件中的那些区域是keil由于580具有的散点文件和内存组织而产生的孔。.ehex文件没有那种漏洞,因为它包括从hex2bin实用程序转换的地址。但是从读取生成的文本文件直接与您用于刻录FW的.bin文件(以不同的格式抵消)。

Thanks MT_dialog

hughesk
Offline
Last seen:2年6个月前
Joined:2014-04-26 02:56
Hello,

Hello,
谢谢你的提示回复。

Regarding the CLI options, 'SmartSnippets.exe -help' does not print out any -verify option in SmartSnippets v3.8. Is this a new feature?

hughesk
Offline
Last seen:2年6个月前
Joined:2014-04-26 02:56
And regarding the binary

And regarding the binary comparison, I took the following specific steps:
1.编译在Keil中的十六进制。致电这个keiloutput.hex.
2.在十六进制文件上运行'hex2bin.exe -l 8000'以生成32kb keiloutput.bin
3.通过JTAG探测将keiloutput.hex进行DA14580 SPI连接的闪光灯,选择“是”以使其启动。
4. Read back Flash contents and save as FlashContents.hex.
5.在FlashContents上运行'hex2bin.exe -l 8000'.hex创建FlashContents.bin
6. Compare KeilOutput.bin to FlashContents.bin.

Ignoring the first 8 bytes of FlashContents.bin (due to the bootable option), the files almost entirely match, except for three sections of memory, which in FlashContents.bin are sets of '00' and in KeilOutput.bin are sets of 'FF'. The three sections in this particular set of files are near the beginning of memory and are 192, 28, and 92 bytes long. I'd be happy to share a snippet by email if you feel that would help.

谢谢,
Kevin

MT_dialog
Offline
Last seen:2个月3周前
Staff
Joined:2015-06-08 11:34
Hi hughesk,

Hi hughesk,

嗯,你使用的智能代码段版本是非常旧的,智能代码段工具箱套件已经替换了智能片段,但我认为即使这个版本有验证选项,-help命令不会显示此选项,但如果您尝试要使用Write命令错误,该工具将提示您使用正确的选项。您还可以查看该选项中可用的智能代码段帮助选项和PDF。

关于刻录和读取文件之间的比较,我完成了相同但在.b文件文件而不是十六进制的读回来,文件是相同的(可引导标题和原始文件具有FF填充除外)。

Thanks MT_dialog

hughesk
Offline
Last seen:2年6个月前
Joined:2014-04-26 02:56
Hello,

Hello,
Thanks for the SmartSnippets version suggestion - I did not realize that SmartSnippets itself was updated in the Toolbox (I thought just an IDE...). Regardless, the newer version DOES have a -verify in the write flash CLI options. Now my question is just one of verification:

1.你有任何建议的方式展示吗that the 'verify' option actually performs a verification? Some means of either interrupting it and altering the readback so that it fails SPI flash verification once or something along those lines? This is needed for validation of the programming script before release into production.

2. OR, if there is not an easy way to demonstrate the verification process, then going back to the .bin, I do see that specifying a read back filename ending in '.bin' causes a binary file to be written (it was not clear that the file extension is actually used in determining the output from Smartsnippets). However, I still have exactly the same problem as when I read back and converted using hex2bin. That is, there are three strings at the beginning of memory that are 00's in the readback and FF's in the KeilOutput.bin (converted from KeilOutput.hex using hex2bin). Any idea why these are different?

谢谢,
Kevin

hughesk
Offline
Last seen:2年6个月前
Joined:2014-04-26 02:56
跟进二元

跟进二元比较:

如果我使用新的SmartSnippet从十六进制文件刻录,我注意到(在我的特定十六进制文件)地址A8是SmartSnippets窗口中出现的部分的开头,我假设意味着未指定。如果我燃烧到SPI闪光灯然后读回来,A8开始的区域充满了'00'。
使用hex2bin创建的,打开.bin文件,我看到' - '区域是用ff替换的。因此,回读闪存二进制文件与创建二进制的Hex2bin不匹配。

编辑:
Looks like this can be resolved by specifying the padding byte:
hex2bin.exe -p 0 [file.hex]
Results in 'file.bin' that matches the contents of read-back Flash memory.

我仍然有兴趣了解是否有一个方法来测试或演示Smartsnippets'-verify'选项,但如果没有,我对针对正确创建的二进制文件的回读比较感到满意。

MT_dialog
Offline
Last seen:2个月3周前
Staff
Joined:2015-06-08 11:34
Hi hughesk,

Hi hughesk,

Regarding the CLI, and the verify option, pasting the command as from the Smart Snippets Toolbox manual : Executable -type spi -chip chip_version [-clk clk] [-cs cs] [-miso miso] [-mosi mosi] [-jtagjtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId][firmware firmware_file] -cmd write -file filename [-offset ofst] [-max size][-verify][-bootable] [-y] [-N -NOMESSAGES MESSIONFILTER]。命令所做的是写入闪存,然后执行读取以验证,但此行为对用户是透明的,但该工具将提示您读取闪存以验证,然后它会验证推出您的验证已成功。如果您正在寻找一个将显示整个过程的单独命令,则不提供此类事物。请从上述步骤中查找附加屏幕截图。

Thanks MT_dialog