如何使用U_DLL.dll API进行固件下载和内存编程

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
7 posts / 0 new
最后一篇
路易斯王2.
离线
最后一次露面:2 years 10 months ago
加入:2018-01-18 06:49
如何使用U_DLL.dll API进行固件下载和内存编程

嗨对话框

您是否具有示出如何使用U_DLL.dll API(DA1458X_DA1468X_PLT_V_4.2.0.160)的样本代码,以用于固件下载和内存编程

我们正在尝试使用U_DLL.dll API下载FW和擦除SPI Flash,

udll_set_prog_params,udll_set_device_params和udll_start_prog所有返回成功,但它不起作用。

*********

我们已经运行udll_init()并添加回调函数。但它仍然不起作用。

最良好的问候,
路易斯王

设备:
PM_DIALOG.
离线
最后一次露面:2天4小时前
职员
加入:2018-02-08 11:03
嗨louis wang2,

嗨louis wang2,

It is recommended to call the udll_init() function before any other operation with the u_dll.dll library, because it sets to zero some internal structures.The fact that the udll_start_prog() returns UDLL_SUCCESS messages doesn’t mean that the process of the programming is already finished. In order to find where the process is, you should check the callback function that you call in the udll_start_prog(). Then, the u_dll.dll will execute your callback in order to inform you in which point your code is.

谢谢,PM_DIALOG.

路易斯王2.
离线
最后一次露面:2 years 10 months ago
加入:2018-01-18 06:49
嗨对话框

嗨对话框

Thanks for your reply.

Would you help to review my sample code ? l have add the callback but not work.

// Test.cpp : Defines the entry point for the console application.
//

#include“stdafx.h”
#include“u_dll.h”
#包括
#include“string.h”

using namespace std;

void my_callback(uint32_t com_port_number,int status,void * data,uint32_t data_len);

int main(int argc,char * argv [])
{
结果= 1;
_udll_params udll_params_t;
_udll_device_params device_params_t;
// ********************************************************
cout <<“测试000开始:”<< endl;
结果= udll_init();
cout <<结果<< endl;
// ********************************************************
结果= 1;
Udll_params_t.dut_ic = u_dut_ic_da14585;
udll_params_t.params_580.dut_ic = u_dut_ic_da14585;
udll_params_t.params_580.baud_rate = 57600;
udll_params_t.params_580.mem.action = FW_LOAD;
udll_params_t.params_580.mem.fw_load.action = fw_load;
udll_params_t.params_580.mem.fw_load.en = false;

字符串fw_path(“e:\\ da1458x_da1468x_plt_v_4.2.0.160 \\可执行文件\\ binaries \\ flash_programmer_580.bin”);
strcpy_s(udll_params_t.params_580.mem.fw_load.fw_path,fw_path.c_str());

udll_params_t.params_580.mem.fw_load.uart_change_pins = false;
udll_params_t.params_580.mem.fw_load.uart_boot_pins = p04_p05;
udll_params_t.params_580.mem.fw_load.uart_pins.uart_port_tx = 0;
udll_params_t.params_580.mem.fw_load.uart_pins.uart_pin_tx = 4;
udll_params_t.params_580.mem.fw_load.uart_pins.uart_port_rx = 0;
udll_params_t.params_580.mem.fw_load.uart_pins.uart_pin_rx = 5;

结果= udll_set_prog_params(&udll_params_t);
cout <<结果<< endl;
// ********************************************************
结果= 1;
device_params_t.is_active = true;
device_params_t.dut_num = u_dut_1;
device_params_t.com_port_boot = 5;
device_params_t.com_port_prog = 5;
device_params_t.bd_addr [bd_addr_size] = uint8_t(0);
device_params_t.OTP_customer_field.data[OTP_585_CUSTOMER_FIELD_SIZE] = uint8_t(0);
device_params_t.otp_customer_field.size = 100;
device_params_t.xtal_trim_val[XTAL_TRIM_SIZE] = uint8_t(0);
device_params_t.adc_calib_val = 0;
device_params_t.mem_data [max_mem_data_size] = uint8_t(0);
device_params_t.user_callback_udll = my_callback;

结果= udll_set_device_params(&device_params_t);
cout <<结果<< endl;

result = udll_start_prog();
cout <<结果<< endl;
// ********************************************************
result = udll_close();
cout <<结果<< endl;
返回0;
}

void My_CallBack(uint32_t com_port_number, int status, void *data, uint32_t data_len)
{
cout <<“测试”<< endl;
}

PM_DIALOG.
离线
最后一次露面:2天4小时前
职员
加入:2018-02-08 11:03
嗨louis wang2,

嗨louis wang2,

附加的代码只是一个示例,以检查如何刻录/擦除SPI闪存和下载固件,但未测试。您可以看到PLT-DLL如何使用UDLL获取更多详细信息。更改测试时,应始终使用UDLL_SET_PROG_PARAMS函数,但如果没有设备特定更改,则可以跳过UDLL_SET_DEVICE_PARAMS。

如果使用多个设备,则每个设备必须完成上述步骤。UDLL可以同时处理最多16个设备,但您必须设置每个设备的不同回调和不同的检查。附加的代码仅适用于每个运行的单个设备。如果在不同的GPIO引脚中具有SPI Flash,则必须在每个SPI测试中设置配置,即使您已在上一个SPI测试中设置。建议使用每个状态回调更改的定时器。一些有用的点,以了解它是如何工作的。

  • 在调用UDLL_Start_Prog之后,所有操作_start(例如,UDLL_SPI_ERASE_START)回调将立即到期。

  • All the action _SUCCESS (e.g. UDLL_SPI_ERASE_SUCCESS) callbacks will come after the tests are done. This means that the (e.g.) erase test will take some seconds to finish, and it depends on your flash memory.

  • FW_LOAD时间完成约5-​​6秒。

谢谢,PM_DIALOG.

路易斯王2.
离线
最后一次露面:2 years 10 months ago
加入:2018-01-18 06:49
嗨对话框

嗨对话框

Thank you so much.

遵循您的详细指导,我的代码现在可以工作(擦除,刻录文件到SPI Flash)。

但是,有时,一些特殊的DUT,需要在FW到DUT之前的复位信号,如果使用SmartSnippet工具盒,它将提示“按Hardware Reset按钮”。

通过使用U_DLL API,如何知道DUT是否需要复位信号?

PM_DIALOG.
离线
最后一次露面:2天4小时前
职员
加入:2018-02-08 11:03
嗨louis wang2,

嗨louis wang2,

We have a PLT board that controls all the devices for all the procedures and it resets the connected devices when it is needed. Although, if you don’t have the PLT hardware, you could press the reset button when your procedures is started and hold it until the UDLL_FW_DOWNLOAD_START callback function hits. I suggest you to add the following messages in the previous attached code, in order to know when you should press and release the reset button.

第25行:COUT <<“按下并按住RESET按钮”<< ENDL;

第111-112行:COUT <<“释放重置按钮。”<< ENDL;

谢谢,PM_DIALOG.

路易斯王2.
离线
最后一次露面:2 years 10 months ago
加入:2018-01-18 06:49
嗨对话框

嗨对话框

谢谢,L会将其添加到我的代码中。