读回十六进制以验证编程

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
10个帖子/ 0新
最后一篇
休斯克
离线
最后一次露面:2年6个月前
加入:2014-04-26 02:56
读回十六进制以验证编程

你好,
I would like to use the SmartSnippets.exe CLI tool to read the contents of flash after programming the DA14580, and automatically compare the result byte-wise with the original hex file.
请将我指向一个工具,以将keil-output hex文件转换为smartsnippets格式化的十六进制数据,反之亦然?

Currently, the Keil output looks like this (is this Intel hex format?):
:020000042000DA
:1000000000980020B9040020C1040020D904002079
:1000100000000000000000000000000000000000E0

智能代码段CLI输出一个看起来的文件:
地址十六进制文本
0x00000 70 50 00 00 00 00 00 4A D0 PP J?
0x00008 00 98 00 20 B9 04 00 20??

可以通过以编程方式将英特尔HEX转换为智能片段文件中所示的ASCII HEX,并将其剪断该文件的十六进制部分,但如果有更简单的方法来执行此验证,那将非常感谢!

谢谢,
凯文

Device:
mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨Hughesk,

嗨Hughesk,

Keil的输出是一个.hex英特尔格式文件,并且在闪存中刻录的是实际的二进制文件,因为CLI通过Hex2bin.exe通过.hex文件以生成.bin文件。如果这是您正在寻找的内容,CLI命令工具嵌入了验证标志。请检查智能片段的帮助文档(打开Smart Spetpets Toolbox并检查帮助选项,您还会发现帮助文件)它还可以解释58x和68x系列的CLI命令。

谢谢mt_dialog.

休斯克
离线
最后一次露面:2年6个月前
加入:2014-04-26 02:56
你好,

你好,
I am coming back to this issue after some time. I have two followup questions:
1. I do not see a CLI option for a verify flag related to flash memory. If Smartsnippets and the DA14580 binary file used during flashing already do a verification of the flash memory, I just need some way to demonstrate that before releasing to production. So, do you have either a verify flag that I missed, or any way to one-time demonstrate or test Smartsnippets/DA14580 flash memory verification?

2.如果没有验证标志或无法演示验证过程,那么我可以将闪存内容读回磁盘。这是简单的,然后我可以将该十六进制文件转换为二进制文件。然后我想比较两个二进制文件:
一种。从闪存中生成的二进制文件读回来
b. The binary generated from the Keil-compiled hex file
However, I find that the two have some slight differences. Ignoring the first 8 bytes (added to make it bootable), it seems that there are a few strings of 0x00's in the readback from flash that are 0xFF's in the Keil-hex binary. Are these locations predictable? I cannot do a straight verification unless I can account for these (admittedly minor) differences, and I would not necessarily want to hard code them as exceptions.

在此先感谢您的帮助!

mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨Hughesk,

嗨Hughesk,

  1. 我不确定问题,CLI逗号nd that burns a file to the flash includes a verify option, if set the [-verify] flag tool will verify the burned binary on the flash. What exactly do you mean "one-time demo from flash verification" ? The tool if instructed to verify it will promt that verification has succeeded. Please check on the help options of the SSToolbox the help document of the tool.
  2. Regarding the second question what you download into the ARM in a binary file .bin file and not a the .hex file as generated from keil, you cannot directly compare those two files. Those areas in the binary with the FF's are the holes that keil produces due to the fact that the scatter file and the memory organization that the 580 has. The .hex file doesn't have those kind of holes since it includes addresses that are converted from the hex2bin utility. But the text file that will be generated from the read is directly comparable with the .bin file that you ve used to burn the fw (in different formats offcourse).

谢谢mt_dialog.

休斯克
离线
最后一次露面:2年6个月前
加入:2014-04-26 02:56
你好,

你好,
Thank you for the prompt reply.

关于CLI选项,'smartsnippets.exe -help'不会在smartsnippets v3.8中打印出任何-merify选项。这是一个新功能吗?

休斯克
离线
最后一次露面:2年6个月前
加入:2014-04-26 02:56
关于二进制

关于二进制比较,我采取以下具体步骤:
1. Compile to hex in Keil. Call this KeilOutput.hex
2. Run 'hex2bin.exe -l 8000' on the hex file to produce a 32KB KeilOutput.bin
3. Program KeilOutput.hex to the DA14580 SPI-connected Flash using SmartSnippets v3.8 via a JTAG probe, selecting "Yes" to make it bootable.
4.读取闪存目录并保存为FlashContents.HEX。
5. Run 'hex2bin.exe -l 8000' on FlashContents.hex to create FlashContents.bin
6.将KeilOutput.bin与FlashContents进行比较。

忽略前8个字节的flashContents.bin(由于可引导选项),除了三个部分内存之外,文件几乎完全匹配,其中在FlashContents.bin是'00'和Keiloutput.bin的集合是'FF'。该特定文件集中的三个部分位于内存的开头附近,并且长度为192,28和92字节。如果您觉得有帮助,我会乐意通过电子邮件分享代码段。

谢谢,
凯文

mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨Hughesk,

嗨Hughesk,

Well, the Smart Snippets version that you are using is quite old, the Smart Snippets Toolbox Suite has replaced the Smart Snippets, but i think that even this version has the verify option, the -help command wont show this option, but if you try to use the write command mistakenly the tool will prompt you with the proper options. You can also check the Smart Snippets help option and the pdf that is available in that option.

Regarding the comparison between the burned and the read file, i ve done the same but the read back was done in .bin file instead of hex, the files were identical (except the bootable header and that the original file had an FF padding).

谢谢mt_dialog.

休斯克
离线
最后一次露面:2年6个月前
加入:2014-04-26 02:56
你好,

你好,
感谢SmartSnippets版本建议 - 我没有意识到SmartSnippets本身在工具箱中更新(我认为只是一个IDE ......)。无论如何,较新版本确实在Write Flash CLI选项中具有验证。现在我的问题只是验证之一:

1.您是否有任何建议的方式证明“验证”选项实际执行验证?一些方法可以中断并改变回读,以便它失败一次或沿这些线路的SPI闪存验证?在释放到生产之前,需要对编程脚本进行验证。

2.或者,如果没有一种简单的方法来演示验证过程,那么返回到.bin,我确实看到指定以“.bin”结尾的读取文件名会导致写入二进制文件(它是尚不清楚文件扩展名实际用于确定SmartSnippets的输出)。但是,当我读回并使用Hex2bin转换时,我仍然存在完全相同的问题。也就是说,内存开头有三个字符串,返回和keiloutput.bin中的redback和ff中的00串(从keiloutput.hex使用hex2bin转换)。任何想法如何不同?

谢谢,
凯文

休斯克
离线
最后一次露面:2年6个月前
加入:2014-04-26 02:56
Following up on the binary

Following up on the binary comparison:

如果我使用新的SmartSnippet从十六进制文件刻录,我注意到(在我的特定十六进制文件)地址A8是SmartSnippets窗口中出现的部分的开头,我假设意味着未指定。如果我燃烧到SPI闪光灯然后读回来,A8开始的区域充满了'00'。
Opening a .bin file created with hex2bin, I see that the '--' area is instead replaced with FF. Therefore, the read-back flash binary does not match the hex2bin created binary.

EDIT:
看起来可以通过指定填充字节来解决:
hex2bin.exe -p 0 [file.hex]
导致“file.bin”匹配回读闪存的内容。

I'm still interested to know if there is a method to test or demonstrate the SmartSnippets '-verify' option, but if there is not, I am satisfied with the read-back comparison against a correctly-created binary file.

mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨Hughesk,

嗨Hughesk,

关于CLI和验证选项,将命令粘贴为智能代码箱工具箱手册:可执行文件-type spi -chip inch_version [-clk clk] [-cs cs] [-moso miso] [-jtagjtag_serialnumber|-com_port portnumber] [-baudrate率] [-gpio pinit] [--uart txid] [固件firmware_file] -cmd write -file文件名[-offset] [-max size][-核实][-bootable] [-y] [-nomessages messageFilter]. What the command does is to write to the flash and then perform a read back in order to verify, but this behaviour is transparent to the user, the tool will just prompt you that its reading the flash in order to verify and then it will either promt you that the verification has succeded or not. In case you are looking for a seperate command on this that will show the entire procedure, no such thing is not available. Please find attached the screenshot from the procedure described above.

谢谢mt_dialog.