prod_test“void hci_custom_action_cmd(uint8_t * ptr_data)”

4 posts / 0 new
Last post
ciano
Offline
Last seen:2周3天前
加入:2014-10-03 08:13
prod_test“void hci_custom_action_cmd(uint8_t * ptr_data)”

嗨对话框,

我们正在构建自己的prod_test.bin,我们希望在“void hci_custom_action_cmd(Uint8_t * ptr_data)中添加一些测试。

We have tried to modify the function for testing the behavior... so we did like this
void hci_custom_action_cmd(uint8_t *ptr_data)
{
struct msg_custom_action_cfm s;
s.packet_type = hci_evt_msg_type;
s.event_code = hci_cmd_cmpl_evt_code;
S.Length = 5;
s.param0 = 0x01;
s.param_opcode = HCI_CUSTOM_ACTION_CMD_OPCODE;
s.data = ptr_data [0] +10;//由+10修改
uart_write((uint8_t*) &s, sizeof(s), NULL);
}

这导致以下PLT错误:
||||
#####################################################################################################
| 11:31:26.824 | dut_com_port_identify_started |开始| COM端口识别启动。dut = [1]。
|11:31:28.528 |DUT_COM_PORT_IDENTIFY_OK | PASS |COM port identified OK. DUT=[1] <--> COM_PORT=[10].
| 11:31:28.574 | dut_udll_fw_download_init |启动| UDLL固件下载初始化。固件是= [C:\ Users \ cfr \ documents \ dogoval \ sw \ plt \ da1458x_da1468x_plt_v_3.1 \ executable \ binaries \ prod_test.bin]]。
|11:31:28.600 |DUT_UDLL_FW_DOWNLOAD_START | STARTED |UDLL firmware download started OK. Firmware is=[c:\Users\cfr\Documents\Dialog\sw\PLT\DA1458x_DA1468x_PLT_v_3.1\executables\binaries\prod_test.bin].
|11:31:32.816 |DUT_UDLL_FW_DOWNLOAD_OK | PASS |UDLL firmware downloaded OK. Firmware is=[c:\Users\cfr\Documents\Dialog\sw\PLT\DA1458x_DA1468x_PLT_v_3.1\executables\binaries\prod_test.bin].
| 11:31:32.832 | dut_udll_fw_download_ok |通行证| UDLL固件下载OK。固件是= [C:\ Users \ cfr \ documents \ dogoval \ sw \ plt \ da1458x_da1468x_plt_v_3.1 \ executable \ binaries \ prod_test.bin]]。
|11:31:32.960 |DUT_PDLL_COM_PORT_INIT | STARTED |Device pdll COM port open initialized.
| 11:31:32.999 | DUT_PDLL_COM_PORT_START |启动|设备PDLL COM端口打开开始。
|11:31:33.039 |DUT_PDLL_COM_PORT_OK | PASS |Device pdll COM port opened OK.
|11:31:33.105 |DUT_PDLL_FW_VERSION_GET_START | STARTED |Device pdll Firmware version get started.
|11:31:33.148 |DUT_PDLL_FW_VERSION_GET_OK | PASS |Device pdll Firmware version get OK. PDLL version=[v_3.170.6.90], BLE FW version=[v_5.0.4], APP FW version=[v_5.0.4].
| 11:31:33.186 | DUT_PDLL_XTAL_TRIM_INIT |启动| XTAL Trim操作初始化。
|11:31:33.226 |DUT_PDLL_XTAL_TRIM_START | STARTED |XTAL trim operation started.
| 11:31:35.718 | DUT_PDLL_XTAL_TRIM_OK |通过| XTAL Trim操作结束了。
|11:31:35.837 |DUT_PDLL_UART_RESYNC_INIT | STARTED |UART resync process initialized.
| 11:31:35.870 | DUT_PDLL_UART_RESYNC_START |启动| UART RENYNC进程已启动。
| 11:31:36.162 | DUT_PDLL_UART_RESYNC_FAILED |失败| UART RENYNC进程失败。当前设备状态= [37]。
|11:31:36.179 |DUT_PDLL_UART_RESYNC_FAILED | FAIL |UART resync process FAILED. Current device status=[37].

所以它看起来像“void hci_custom_action_cmd(uint8_t * ptr_data)”用于多于自定义操作。
然后,如果输入为0x34,则更改代码以仅修改输出,因此输出将是0x40。
The PLT run now looks like this:
||||
#####################################################################################################
| 11:22:09.486 | dut_com_port_identify_started |开始| COM端口识别启动。dut = [1]。
|11:22:11.234 |DUT_COM_PORT_IDENTIFY_OK | PASS |COM port identified OK. DUT=[1] <--> COM_PORT=[10].
|11:22:11.305 |DUT_UDLL_FW_DOWNLOAD_INIT | STARTED |UDLL firmware download initialized. Firmware is=[c:\Users\cfr\Documents\Dialog\sw\PLT\DA1458x_DA1468x_PLT_v_3.1\executables\binaries\prod_test.bin].
|11:22:11.337 |DUT_UDLL_FW_DOWNLOAD_START | STARTED |UDLL firmware download started OK. Firmware is=[c:\Users\cfr\Documents\Dialog\sw\PLT\DA1458x_DA1468x_PLT_v_3.1\executables\binaries\prod_test.bin].
| 11:22:15.574 | DUT_UDLL_FW_DOWNLOAD_OK |通行证| UDLL固件下载OK。固件是= [C:\ Users \ cfr \ documents \ dogoval \ sw \ plt \ da1458x_da1468x_plt_v_3.1 \ executable \ binaries \ prod_test.bin]]。
|11:22:15.592 |DUT_UDLL_FW_DOWNLOAD_OK | PASS |UDLL firmware downloaded OK. Firmware is=[c:\Users\cfr\Documents\Dialog\sw\PLT\DA1458x_DA1468x_PLT_v_3.1\executables\binaries\prod_test.bin].
| 11:22:15.716 | dut_pdll_com_port_init |启动|设备PDLL COM端口打开初始化。
| 11:22:15.744 | DUT_PDLL_COM_PORT_START |启动|设备PDLL COM端口打开开始。
|11:22:15.765 |DUT_PDLL_COM_PORT_OK | PASS |Device pdll COM port opened OK.
| 11:22:15.822 | dut_pdll_fw_version_get_tart |启动|设备PDLL固件版本开始。
|11:22:15.858 |DUT_PDLL_FW_VERSION_GET_OK | PASS |Device pdll Firmware version get OK. PDLL version=[v_3.170.6.90], BLE FW version=[v_5.0.4], APP FW version=[v_5.0.4].
| 11:22:15.893 | dut_pdll_xtal_trim_init |启动| XTAL Trim操作初始化。
|11:22:15.923 |DUT_PDLL_XTAL_TRIM_START | STARTED |XTAL trim operation started.
| 11:22:18.300 | DUT_PDLL_XTAL_TRIM_OK |通过| XTAL Trim操作结束了。
| 11:22:18.418 | dut_pdll_uart_resync_init |启动| UART RENYNC进程初始化。
| 11:22:18.428 | dut_pdll_uart_resync_start |启动| UART RENYNC进程已启动。
| 11:22:18.436 | dut_pdll_uart_resync_ok |通过| UART RENYNC PROCESS OK。
| 11:22:18.446 | DUT_PDLL_XTAL_TRIM_READ_INIT |启动| XTAL Trim值读取初始化。
| 11:22:18.456 | dut_pdll_xtal_trim_read_start |启动| XTAL Trim Value读取开始。
| 11:22:18.485 | DUT_PDLL_XTAL_TRIM_READ_OK |通过| XTAL TRIM值读取确定。值是= [1324]。
|11:22:18.525 |DUT_PDLL_CUSTOM_ACTION_INIT | STARTED |Custom test action initialized. Data to send is=[34]
| 11:22:18.539 | dut_pdll_custom_action_start |启动|自定义测试操作开始。
| 11:22:18.565 | dut_pdll_custom_action_ok |通过|自定义测试操作结束了。数据发送是= [34]
| 11:22:18.593 | DUT_PDLL_CUSTOM_ACTION_DATA_MATCH_FAILED | FAIL |Custom test action data match FAILED. Data send=[0x34]. Data received=[0x40].

so it passes until our custom command with input = 0x34.
If we leave the output equal the input in "void hci_custom_action_cmd(uint8_t *ptr_data)", then it all passes.

Now for our question:
一般来说,如何使用旨在使用的“void hci_custom_action_cmd(uint8_t * ptr_data)”?
In which testcases are "void hci_custom_action_cmd(uint8_t *ptr_data)" used?
还有哪些输入值被其他测试用例保留和使用?
哪个输入值可以在不干扰其他测试序列的情况下使用我们的自定义测试?

此致,
Ciano Frost
丹麦

设备:
MT_dialog
Offline
Last seen:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Ciano,

嗨Ciano,

我不太明白+10到ptr_data的原因是什么,当命令操作代码为0x40d0时触发自定义函数,这是命令应该为580执行a的操作代码自定义功能。如果要执行多个自定义功能,则必须标记自定义函数并将自定义标记放在命令的有效载荷中。

Thanks MT_dialog

ciano
Offline
Last seen:2周3天前
加入:2014-10-03 08:13
Hi Dialog

Hi Dialog

yes, I guess we need to step back here, to clarify our question.

We are using the PLT and want to add a selftest function in prod_test.bin. According to PLT parameter file this can be initiated with the following lines in the params.ini file
custom_data_enable = true
custom_data_value = 01

so far so good.
For catching this command in prod_test.bin with value argument = 0x01 we have to modify the function "void hci_custom_action_cmd(uint8_t *ptr_data)" in customer_prod.c
这是我们需要一些支持的地方。
Now the input argument is "uint8_t *ptr_data".
Question: how much data is stored at ptr_data ... what is at ptr_data[0] , ptr_data[1], ptr_data[2], ptr_data[3]?
and how should we interprete this data?

此致,
Ciano Frost
丹麦

MT_dialog
Offline
Last seen:2个月2周前
Staff
加入:2015-06-08 11:34
嗨Ciano,

嗨Ciano,

Since this is custom command there is no implementation in the fw side, there is no use for this command from the PLT tool for other commands, if you check the fw you will see that this is an empty command, so you will have to add additional implementation according to the tag that you ve entered in the params.ini file. So in order to access this command you will have to add the tag 0x40D0 in front of the 0x01 (if you want to test it via UART with a simple terminal). For example lets say that we want to implement a custom command that will have a tag of 0x34 so after implementing code in the prod_test fw for parsing the command, when we send from the UART port 0x01 D0 40 01 34, the code should see the tag and execute the function accordingly.

0x40d0 - >自定义命令操作码的标签

0x01 - >有效载荷的长度

0x34 -> the tag for executing the proper custom test

ptr_data它只是一个uint8_t指针,指向UART发送数据的开始。ptr_data [0]将具有刚刚发送的命令的有效载荷的第一个字节,在上一个示例中,它将包含0x34。

在PARP.INI文件中,您在Custom_data_value上设置的值将标记您希望执行的自定义命令,以便您将0x01设置为自定义命令标记。

Thanks MT_dialog