Automate OTP Programming over UART

13个帖子/ 0新
Last post
MikeY
Offline
Last seen:4 years 3 months ago
Joined:2015-07-23 16:51
Automate OTP Programming over UART

Hello Dialog,

我试图完全自动化我的OTP编程过程。对于硬件,我有一个自定义接口板,使用FTDI 230x芯片。对于固件,我有一个我闪烁的十六进制文件和OTP头文件。

I am currently able to use the CLI to program OTP. However, I would like to avoid using the RESET pin or having any sort of user intervention for my script. One of the features of the FTDI chip I am using is that it has GPIOs that can be programmed for bit banging. One of these GPIOs can be toggled for RESET. Is there any way that I can create my own bare programming script that eliminates the need for the Reset button press, and just invokes the FTDI chip to do it? I know the command for the FTDI chip. I just don't know how to invoke it on the Dialog side.

Thank you and regards,

Michael

设备:
MT_dialog
Offline
Last seen:20小时37分钟前
Staff
Joined:2015-06-08 11:34
嗨Mikey,

嗨Mikey,

I am not sure i understand your question, i suppose that you can reset the 580 through the reset pin by using the extra gpio on the FTDI chip, just like hitting the reset button.

谢谢MT_dialog

MikeY
Offline
Last seen:4 years 3 months ago
Joined:2015-07-23 16:51
嗨mt_dialog,

嗨mt_dialog,

Yes, that is what I'm trying to do, but how can I do that using either the SmartSnippets CLI or some other way? I can't seem to figure out where to write that code in the SDK5 utilities (if that is where it goes).

此致,

MikeY

MikeY
Offline
Last seen:4 years 3 months ago
Joined:2015-07-23 16:51
I believe that the change

我认为,在/smartsnippets/resources/programmer_es5.bin中需要发生变化,这是我目前在我的CLI脚本中使用的程序员文件。你有洞察力吗?

MT_dialog
Offline
Last seen:20小时37分钟前
Staff
Joined:2015-06-08 11:34
嗨Mikey,

嗨Mikey,

我们没有尝试过类似于您想要做的事情,但我不认为您需要更改对话框提供的任何工具。ES5.BIN是OTP的程序员,并且在580中下载ES5代码之前需要重置电路板。我想您需要一些将触发FTDI的自动化工具,以便在获得后重置电路板重置后重置电路板并继续在重置后继续批处理文件的指示。

谢谢MT_dialog

MikeY
Offline
Last seen:4 years 3 months ago
Joined:2015-07-23 16:51
Hi,

Hi,

对,那是正确的。您是否知道任何此类工具,或者也许是如何创建一个?

根据我的理解,SmartSnippets要求将重置按钮按下电路板并等待。按下重置按钮后,UART会有一些通信,以告诉PC已按下重置按钮。我想做的就是告诉FTDI芯片在SmartSnippets发送Reset按请求后脉冲其GPIO之一。

问候,

迈克y.

MT_dialog
Offline
Last seen:20小时37分钟前
Staff
Joined:2015-06-08 11:34
嗨Mikey,

嗨Mikey,

抱歉,如前所述,我们从未尝试过这种方案,我无法建议任何特定的工具或为您提供创建这种操作的脚本的指导。

谢谢MT_dialog

Lovejoey
Offline
Last seen:3年11个月前
Joined:2016-07-12 22:51
嗨mt_dialog,

嗨mt_dialog,

I have the same question as Mike, I have 2 questions

1, Can we get rid of the reset signal while we are programming the chip.

2,如果问题1答案是否,那么我们可以使用脚本来模拟编程过程。因为在固件下载处于过程中,我未能访问USB芯片。也许摆脱信号的唯一方法是模拟整个下载过程。

谢谢

MT_dialog
Offline
Last seen:20小时37分钟前
Staff
Joined:2015-06-08 11:34
嗨lovejoey,

嗨lovejoey,

1)如何通过JTAG或通过UART编程芯片?在这两种情况下,它建议拥有重置,如果580被编程和睡眠,则无法安装调试器,如果由于编程过程,如果由于编程过程而出现问题,则建议使用重置引脚。

2)我不完全得到第二个问题,你是什么意思“脚本来模拟编程过程”,你能说更具描述性吗?

谢谢MT_dialog

Lovejoey
Offline
Last seen:3年11个月前
Joined:2016-07-12 22:51
HI MT

HI MT

1)我们在UART上编程DA14580 ..让我们一起越过这个过程:
You open an CLI and call Smartsnippets.exe to load Programming_ES5.bin into the DA14580 chip
After you execute the command the CLI will print a message to ask you to press the reset button on board.
Above reflects the problem I have now. I want to send out the hardware reset signal by Computer not by human. So as you said neither of JTAG and UART method could not get rid of sending reset signals. I've tried to use a python script to monitor the CLI output and sent out a reset signal using the same usb chip which is connected with DA14580. But the USB chip is occupied by COM communication. So I'm not able to send out the reset signal.

2) Simulate the Smartsnippets process is not accurate. It should be rewrite all the chip programming process using a python script. In this way, i need to know what the Smartsnippets do while it is programming the Da14580 chip.

谢谢
杨凯

MT_dialog
Offline
Last seen:20小时37分钟前
Staff
Joined:2015-06-08 11:34
嗨lovejoey,

嗨lovejoey,

You can't emulate the reset signal without the reset pin, the reason Smart Snippets asks for the reset pin when download via UART is in order for the bootloader to run and then Smart Snippest pushes the binary into the UART as soon as it tracks the STX = 0x02 (as soon as smart snippets detects the STX character from the bootloader it indicates "Reset signal detected" at the console) that indicates the begining of the UART booting procedure. So after the reset signal hits (that the user has to push and not Smart Snippets) the UART booting sequence begins and Smart Snippets follows the procedure described in the AN-B-001 document regarding the UART booting procedure. The JTAG doesn't need a reset to occur since it has direct access to the 580 as long as the debugger module in the 580 is enabled. In case the debbuger module is disabled (the 580 runs a fw with sleep) you will again need the reset button in order run the primary bootloader and the primary bootloader to reenable the debugger module.

I understand that you would like to a signal to toggle the reset pin but as far as i can tell there is not something on Smart snippets or the CLI programmer that can provide you that option.

谢谢MT_dialog

MikeY
Offline
Last seen:4 years 3 months ago
Joined:2015-07-23 16:51
嗨mt_dialog,

嗨mt_dialog,

我们正在尝试做的是仿真SmartSnippets所做的,但添加了FTDI 230x的软件重置。如果我们能够理解CLI进程,那么我认为我们可以在Python中创建一个脚本,该脚本将完成相同的过程,也使用230x GPIO功能向DA14580发送复位脉冲。

我们使用的CLI命令是:
command1 = 'SmartSnippets.exe -type booter -chip DA14580-01 -com_port comnum -gpio P0_4 -uart P0_0 -file %USERPROFILE%/SmartSnippets/resources/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/OTPFirmwareFile/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/totheaderfile/file.hex'

第一个命令的目的是什么?是否设置FTDI芯片以了解如何与DA14580通信并在收到STX字节后发送SOH字节?或者是DA14580的指令?二元究竟在做什么?在此命令之后,有必要按硬件重置按钮,我假设我们需要重新启动引导过程,以便引导加载程序。App标志仍为0x0000,因此芯片靴进入DEV模式。

我假设第二命令是我们开始UART引导协议的地方。该芯片发送STX和PC(?)响应固件的SOH,LEN_LSB和LEN_MSB,DA14580发送ACK字节。然后,它从PC等待我们的十六进制文件,并在地址0x20000000开始加载它。完成此操作后,DA14580发送CRC,主机必须使用ACK字节响应。在此之后,Sys_CTRL_REG寄存器被编程为重新映射到SYSRAM并应用软复位。

We can now send our OTP header, which is done in the 3rd command. Is there anything that needs to be received from the DA14580 before we can start issuing this hex file? Is there any boot sequence we need to follow? What is the process here?

OTP标题已编程后,我们现在可以硬重置DA14580并期望我们的固件加载,这是正确的吗?

MT_dialog
Offline
Last seen:20小时37分钟前
Staff
Joined:2015-06-08 11:34
嗨Mikey,

嗨Mikey,

第一个命令通过-file选项下载fw设置(在您的情况下,580应该有待编程OTP的ES5_Programmer),580 EMMITS是在启动加载程序运行时的字节,并且580为FW等待将下载。STX由580发送,并且检测0x02被检测到的智能代码段假定已按下复位并启动指示的序列。您无需调用您指示的命令(提及的前2个),您可以直接应用第二个命令,程序员将被下载,然后写入WRITE_CUSTOM_CODE中所示的-file作为您的形象或作为头部。

要汇总-Firmware Firfware_file您指示命令的命令将在执行指定命令之前下载如果您不在命令中使用此参数,则应使用已指示的第一个命令,以便580成为使用ES5_Programmer编程,然后您可以发出下一个命令。因此,需要重置才能为引导加载程序运行,以便检测到STX,使程序员_ES5.bin被下载到580中。

您可以在命令行实现部分找到所有CLI命令和解释SmartSnippetshelp.pdf中的所有COMAN,帮助文件位于Smart Scompets目录中。您可以打开SS并单击“帮助”选项,然后选择UserGuide.pdf

在OTP标题中刻录OTP和应用程序标志后,当您按RESET按钮时,OTP应用程序应加载到SYSRAM。

谢谢MT_dialog