prod_test "void hci_custom_action_cmd(uint8_t *ptr_data)"

4个帖子/ 0新
最后一篇
ciano
离线
最后一次露面:2周4天前
加入:2014-10-03 08:13
prod_test "void hci_custom_action_cmd(uint8_t *ptr_data)"

嗨对话框,

We are building our own prod_test.bin, and we want to add some tests in "void hci_custom_action_cmd(uint8_t *ptr_data)".

我们尝试修改测试行为的功能......所以我们这样做了
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; // MODIFIED by +10
UART_WRITE((uint8_t *)&s,sizeof(s),null);
}

this resulted in the following PLT error:
| | | |
##########################################################################################################################
|11:31:26.824 |DUT_COM_PORT_IDENTIFY_STARTED | STARTED |COM port identification started. DUT=[1].
| 11:31:28.528 | DUT_COM_PORT_IDERDIFY_OK |通过| COM端口识别OK。dut = [1] < - > com_port = [10]。
|11:31:28.574 |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:31:28.600 | dut_udll_fw_download_start |启动| UDLL固件下载已启动OK。固件是= [C:\ Users \ cfr \ documents \ dogoval \ sw \ plt \ da1458x_da1468x_plt_v_3.1 \ executable \ binaries \ prod_test.bin]]。
| 11:31:32.816 | 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.832 |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.960 | DUT_PDLL_COM_PORT_INIT |启动|设备PDLL COM端口打开初始化。
|11:31:32.999 |DUT_PDLL_COM_PORT_START | STARTED |Device pdll COM port open started.
| 11:31:33.039 | DUT_PDLL_COM_PORT_OK |通过|设备PDLL COM端口打开OK。
| 11:31:33.105 | dut_pdll_fw_version_get_tart |启动|设备PDLL固件版本开始。
| 11:31:33.148 | dut_pdll_fw_vers_get_ok |通过|设备PDLL固件版本得到确定。pdll版本= [v_3.170.6.90],ble fw版本= [v_5.0.4],app fw version = [v_5.0.4]。
|11:31:33.186 |DUT_PDLL_XTAL_TRIM_INIT | STARTED |XTAL trim operation initialized.
| 11:31:33.226 | DUT_PDLL_XTAL_TRIM_START |开始| XTAL Trim操作开始。
|11:31:35.718 |DUT_PDLL_XTAL_TRIM_OK | PASS |XTAL trim operation ended OK.
| 11:31:35.837 | dut_pdll_uart_resync_init |启动| UART RENYNC进程初始化。
|11:31:35.870 |DUT_PDLL_UART_RESYNC_START | STARTED |UART resync process started.
|11:31:36.162 |DUT_PDLL_UART_RESYNC_FAILED | FAIL |UART resync process FAILED. Current device status=[37].
| 11:31:36.179 | DUT_PDLL_UART_RESYNC_FAILED |失败| UART RENYNC进程失败。当前设备状态= [37]。

So it looks like "void hci_custom_action_cmd(uint8_t *ptr_data)" is used for more than custom actions.
We then changed the code to only modify the output if input is 0x34, so that the output will be 0x40.
PLT现在看起来像这样:
| | | |
##########################################################################################################################
|11:22:09.486 |DUT_COM_PORT_IDENTIFY_STARTED | STARTED |COM port identification started. DUT=[1].
| 11:22:11.234 | dut_com_port_identify_ok |通过| COM端口识别OK。dut = [1] < - > com_port = [10]。
| 11:22:11.305 | 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:22:11.337 | DUT_UDLL_FW_DOWNLOAD_START |启动| UDLL固件下载已启动OK。固件是= [C:\ Users \ cfr \ documents \ dogoval \ sw \ plt \ da1458x_da1468x_plt_v_3.1 \ executable \ binaries \ prod_test.bin]]。
|11:22:15.574 |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.592 | 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.716 |DUT_PDLL_COM_PORT_INIT | STARTED |Device pdll COM port open initialized.
|11:22:15.744 |DUT_PDLL_COM_PORT_START | STARTED |Device pdll COM port open started.
| 11:22:15.765 | DUT_PDLL_COM_PORT_OK |通过|设备PDLL COM端口打开OK。
|11:22:15.822 |DUT_PDLL_FW_VERSION_GET_START | STARTED |Device pdll Firmware version get started.
| 11:22:15.858 | DUT_PDLL_FW_VERSION_GET_OK |通过|设备PDLL固件版本得到确定。pdll版本= [v_3.170.6.90],ble fw版本= [v_5.0.4],app fw version = [v_5.0.4]。
|11:22:15.893 |DUT_PDLL_XTAL_TRIM_INIT | STARTED |XTAL trim operation initialized.
| 11:22:15.923 | dut_pdll_xtal_trim_start |开始| XTAL Trim操作开始。
|11:22:18.300 |DUT_PDLL_XTAL_TRIM_OK | PASS |XTAL trim operation ended OK.
|11:22:18.418 |DUT_PDLL_UART_RESYNC_INIT | STARTED |UART resync process initialized.
|11:22:18.428 |DUT_PDLL_UART_RESYNC_START | STARTED |UART resync process started.
|11:22:18.436 |DUT_PDLL_UART_RESYNC_OK | PASS |UART resync process OK.
|11:22:18.446 |DUT_PDLL_XTAL_TRIM_READ_INIT | STARTED |XTAL trim value read initialized.
|11:22:18.456 |DUT_PDLL_XTAL_TRIM_READ_START | STARTED |XTAL trim value read started.
|11:22:18.485 |DUT_PDLL_XTAL_TRIM_READ_OK | PASS |XTAL trim value read OK. Value is=[1324].
| 11:22:18.525 | dut_pdll_custom_action_init |启动|自定义测试操作初始化。发送数据= [34]
|11:22:18.539 |DUT_PDLL_CUSTOM_ACTION_START | STARTED |Custom test action start.
|11:22:18.565 |DUT_PDLL_CUSTOM_ACTION_OK | PASS |Custom test action ended OK. Data send is=[34]
| 11:22:18.593 | dut_pdll_custom_action_data_match_failed |故障|自定义测试操作数据匹配失败。数据发送= [0x34]。收到的数据= [0x40]。

所以它通过了输入= 0x34的自定义命令。
如果我们将输出等于“void hci_custom_action_cmd(uint8_t * ptr_data)”中的输入,那么它都通过了。

现在有关我们的问题:
In general, how is "void hci_custom_action_cmd(uint8_t *ptr_data)" intended to be used?
其中测试包括“void hci_custom_action_cmd(UInt8_t * ptr_data)”?
and which input values are reserved and used by other test cases?
Which input values may we use for our custom test without interfering with other testcases?

Best Regards,
Ciano Frost.
Denmark

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

Hi ciano,

I dont quite understand what is the reason for the +10 to the ptr_data[0], the custom function is triggered when the command operation code is 0x40D0, that is the op code that a command should have in order for the 580 to execute a custom function. If you want to execute more than one custom function you will have to tag the custom functions and place the custom tag in the payload of the command.

谢谢mt_dialog.

ciano
离线
最后一次露面:2周4天前
加入:2014-10-03 08:13
嗨对话框

嗨对话框

是的,我想我们需要退回这里,澄清我们的问题。

我们正在使用PLT,并希望在Prod_test.bin中添加一个自最终功能。根据PLT参数文件,可以使用params.ini文件中的以下行启动。
custom_data_enable = true
custom_data_value = 01

到目前为止,一切都很好。
用于在prod_test.bin中捕获此命令,使用值参数= 0x01,我们必须在customer_prod.c中修改“void hci_custom_action_cmd(uint8_t * ptr_data)”函数
这就是我们需要一些支持明星ted.
现在输入参数是“uint8_t * ptr_data”。
问题:在ptr_data上存储多少数据......在ptr_data [0],ptr_data [1],ptr_data [2],ptr_data [3]中是多少?
我们该如何解释此数据?

Best Regards,
Ciano Frost.
Denmark

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

Hi ciano,

由于这是自定义命令在FW侧没有实现,因此从PLT工具中没有使用此命令进行其他命令,如果您检查FW,则会看到这是一个空命令,所以您必须添加根据您在params.ini文件中输入的标签,根据您输入的标签。因此,为了访问此命令,您将必须在0x01前面添加标记0x40d0(如果要通过带有简单终端的UART测试它)。例如,假设我们希望实现一个自定义命令,该命令将有一个0x34的标签,所以在prod_test fw中实现代码进行解析,当我们从UART端口0x01 d0 40 01 34发送时,代码应该看到标记并相应地执行函数。

0x40D0 -> The tag for the custom command opcode

0x01 -> the length of the payload

0x34 - >用于执行适当的自定义测试的标签

The ptr_data its just a uint8_t pointer that points to the start of the data send by UART. The ptr_data[0] will have the first byte of the payload of the command that you ve just sent, in the previous example it will contain the 0x34.

At the PLT tool case, in the param.ini file the value that you ve set at the custom_data_value will tag the custom command that you would like execute, in your case you ve set 0x01 as a custom command tag.

谢谢mt_dialog.