自动化OTP编程在UART上

13 posts / 0 new
最后一篇文章
迈克
离线
最后一次露面:4 years 8 months ago
加入:2015-07-23 16:51
自动化OTP编程在UART上

你好对话框,

我试图完全自动化OTP编程process. For hardware, I have a custom interface board that uses an FTDI 230X chip. For firmware, I have a HEX file and OTP Header file that I am flashing.

我目前能够使用CLI来编程OTP。但是,我想避免使用重置引脚或对我的脚本具有任何类型的用户干预。我使用的FTDI芯片的一个功能是它具有可以编程的GPIO,以便撞击。可以切换其中一个GPIO以进行重置。有没有方法可以创建自己的裸露编程脚本,以消除重置按钮的需要,刚刚调用FTDI芯片来执行它?我知道FTDI芯片的命令。我只是不知道如何在对话框中调用它。

谢谢你,问候,

迈克尔

Device:
mt_dialog.
离线
最后一次露面:5个月2周前
职员
加入:2015-06-08 11:34
Hi MikeY,

Hi MikeY,

我不确定我理解你的问题,我想你可以通过在FTDI芯片上使用额外的GPIO来重置580,就像击中重置按钮一样。

谢谢mt_dialog.

迈克
离线
最后一次露面:4 years 8 months ago
加入:2015-07-23 16:51
Hi MT_dialog,

Hi MT_dialog,

是的,这就是我想要做的,但我如何使用SmartSnippetCLI或其他方式来这样做?我似乎无法弄清楚在SDK5实用程序中编写该代码的位置(如果是它在哪里)。

Best regards,

迈克

迈克
离线
最后一次露面:4 years 8 months ago
加入:2015-07-23 16:51
我相信改变

我相信改变needs to happen in the source of /SmartSnippets/resources/programmer_ES5.bin, which is the programmer file I am currently using in my CLI script. Do you have any insight into this?

mt_dialog.
离线
最后一次露面:5个月2周前
职员
加入:2015-06-08 11:34
Hi MikeY,

Hi MikeY,

We haven't tried anything similar to what you are trying to do, but i dont think that you need to change any of the tools provided by dialog. The ES5.bin is the programmer for the OTP and the board needs to be reset before downloading the ES5 code in the 580. I suppose that you need somekind of automation tool that will be triggering the FTDI in order to reset the board after you get the indication for reseting the board and continues with the rest of the batch file after the reset.

谢谢mt_dialog.

迈克
离线
最后一次露面:4 years 8 months ago
加入:2015-07-23 16:51
你好,

你好,

Yes that is correct. Are you aware of any such tool, or perhaps how I can create one?

From my understanding, SmartSnippets requests for the reset button to be pressed on the board and waits for that. After the reset button has been pressed, there is some communication over UART to tell the PC that the reset button has been pressed. All I would like to do is tell the FTDI chip to pulse one of its GPIOs after Smartsnippets sends a request for reset press.

Regards,

Mike Y

mt_dialog.
离线
最后一次露面:5个月2周前
职员
加入:2015-06-08 11:34
Hi MikeY,

Hi MikeY,

Sorry but as previously mentioned we never tried this kind of scheme, i am not able to suggest any specific tool or give you guidance in creating a script for this kind of operation.

谢谢mt_dialog.

lovejoey
离线
最后一次露面:4 years 4 months ago
加入:2016-07-12 22:51
嗨Mt._Dialog,

嗨Mt._Dialog,

我有同样的问题是迈克,我有2个问题

1,我们可以在编程芯片时摆脱重置信号。

2, If Question 1 answer is no, then can we use a scripts to simulate the programming process. Because I have failed to accessing the USB chip while the firmware download is in process. Maybe the only way to get rid of the signal is to simulate the whole download process.

Thanks

mt_dialog.
离线
最后一次露面:5个月2周前
职员
加入:2015-06-08 11:34
Hi lovejoey,

Hi lovejoey,

1) How do you program the chip, via JTAG or via UART ? in both cases its recommended to have the reset, if the 580 is programmed and sleeping you wont be able to attach a debugger, in any case its recommended to have the reset pin if something goes wrong due to the programming process.

2) I dont exactly get the second question, what do you mean "scripts to simulate the programming process", can you please be more descriptive ?

谢谢mt_dialog.

lovejoey
离线
最后一次露面:4 years 4 months ago
加入:2016-07-12 22:51
嗨Mt.

嗨Mt.

1) We are programming the DA14580 over UART.. Let's go over the process together.:
您打开CLI并调用SmartSnippets.exe将编程_ES5.Bin加载到DA14580芯片中
执行命令后,CLI将打印一条消息以便要求您按住船上的重置按钮。
以上反映了我现在的问题。我想通过人类的计算机发送硬件重置信号。因此,当您说JTAG和UART方法都无法摆脱发送重置信号。我试图使用Python脚本来监视CLI输出并使用与DA14580连接的相同USB芯片发送复位信号。但USB芯片由COM通信占用。所以我无法发送重置信号。

2)模拟SmartSnippets过程不准确。应该使用Python脚本重写所有芯片编程过程。通过这种方式,我需要知道Smartsnippets在编程DA14580芯片时做了什么。

Thanks
Yangkai

mt_dialog.
离线
最后一次露面:5个月2周前
职员
加入:2015-06-08 11:34
Hi lovejoey,

Hi lovejoey,

您无法在没有重置引脚的情况下模拟重置信号,原因智能片段在通过UART下载时询问RESET引脚是为了使引导加载程序运行,然后智能SNIPPEST在跟踪时立即将二进制文件推入UART。STX = 0x02(一旦智能代码段检测到来自引导加载程序的STX字符,它表示在控制台上的“重置信号”),指示UART引导过程的开始。因此,在重置信号命中(用户必须推动而不是智能片段)之后,UART引导序列开始且智能代码段遵循关于UART引导过程的AN-B-001文档中描述的过程。只要启用580中的调试器模块,JTAG不需要发生重置,因为它可以直接访问580。如果禁用DebaGuger模块(使用睡眠580运行FW),您将再次需要重置按钮,以命令将主引导加载程序和主引导加载程序运行到可重新启用调试器模块。

我明白你想要一个信号来切换重置引脚,但据我所知,智能片段或CLI编程器上没有东西可以为您提供该选项。

谢谢mt_dialog.

迈克
离线
最后一次露面:4 years 8 months ago
加入:2015-07-23 16:51
Hi MT_dialog,

Hi MT_dialog,

What we are trying to do is emulate what SmartSnippets does but add a software reset from the FTDI 230X. If we can understand the CLI process, then I think we can create a script in Python that would accomplish the same process, and also use the 230X GPIO function to send a RESET pulse to the DA14580.

The CLI commands that we use are:
command1 ='smartsnippets.exe -type booter -chip da14580-01 -com_port comnum-gpio p0_4 -uart p0_0 -file%userprofile%/ smartsnippets / compresence / programmer_es5.bin

command2 ='smartsnippets.exe -Type OTP -Chip DA14580-01 -Com_Port Comnum -BaudRate 57600-GPIO P0_4 -UART P0_0-Firmware%userProfile%/ smartsnippets / resources / programmer_es5.bin -cmd write_custom_code -file / path / to / otpfirmware / path / to / otpfirmware / path / to / otpfirmware/file.hex -offset 0x0'

command3 = 'SmartSnippets.exe -type otp -chip DA14580-01 -com_port comnum -baudrate 57600 -gpio P0_4 -uart P0_0 -firmware programmer_ES5.bin -cmd write_header -file /path/to/OTPHeaderFIle/file.hex'

What is the purpose of the first command? Is it to set up the FTDI chip to understand how to talk to the DA14580 and send the SOH byte after it receives the STX byte? Or is it an instruction set for the DA14580? What exactly is the binary doing? After this command, it is necessary to press the hardware reset button, which I assume means that we need to restart the boot process so that the bootloader. The App Flag is still 0x0000, so the chip boots into Dev Mode.

I assume the 2nd command is where we begin the UART boot protocol. The chip sends STX and the PC(?) responds with SOH, the LEN_LSB, and LEN_MSB of the firmware, and the DA14580 send the ACK byte. It then waits for our hex file from the PC and loads it starting at Address 0x20000000. Once this is done, the DA14580 sends the CRC and the host must respond with an ACK byte as well. After this, the SYS_CTRL_REG register is programmed to remap to SysRAM and apply a soft reset.

我们现在可以发送我们的OTP标题,该标题是在第3命令完成的。在我们开始发出此十六进制文件之前,是否需要从DA14580接收任何内容?我们需要遵循任何启动序列吗?这里的过程是什么?

After the OTP header has been programmed, we can now hard reset the DA14580 and expect our firmware to load, is that correct?

mt_dialog.
离线
最后一次露面:5个月2周前
职员
加入:2015-06-08 11:34
Hi MikeY,

Hi MikeY,

第一个命令下载设定的弗兰克-威廉姆斯费尔e option (in your case the ES5_programmer that the 580 should have in order to program the OTP), the bytes that the 580 emmits is when the bootloader is running and the 580 awaits for the fw that will be downloaded. The STX is transmitted by the 580 and when that 0x02 is detected Smart Snippets assumes that the reset has been pressed and starts the indicated sequence. You dont need to invoke both of the commands that you are indicating (the first 2 that you mention), you can apply directly the second command and the programmer will be downloaded and then the -file that you have indicated in the write_custom_code will be written as your image or as your header.

To sum up the -firmware firmware_file that you are indicating to the command will be downloaded before the execution of the specified command if you dont use this parameter in your commands you should use the first command that you have indicated, so that the 580 to be programmed with the ES5_programmer and then you can issue the next commands. So the reset is needed in order for the bootloader to run so that the STX is detected and so that the programmer_ES5.bin to be downloaded into the 580.

You can find all the CLI commands and explanation of what each comman does in the SmartSnippetsHelp.pdf at the command line implementation section, the help file is located in the Smart Snippets directory. You can open the SS and click on help option and choose the UserGuide.pdf

After you have burned the OTP and the application flags in the OTP header, when you hit the reset button the OTP application should be loaded to the sysram.

谢谢mt_dialog.