Hi Dialog,
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)".
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; // 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_IDENTIFY_OK | PASS |COM port identified 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 | 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 | 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 | STARTED |Device pdll COM port open initialized.
|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 | 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 | STARTED |XTAL trim operation initialized.
|11:31:33.226 |DUT_PDLL_XTAL_TRIM_START | STARTED |XTAL trim operation started.
|11:31:35.718 |DUT_PDLL_XTAL_TRIM_OK | PASS |XTAL trim operation ended OK.
|11:31:35.837 |DUT_PDLL_UART_RESYNC_INIT | STARTED |UART resync process initialized.
|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 | FAIL |UART resync process FAILED. Current device status=[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.
The PLT run now looks like this:
| | | |
##########################################################################################################################
|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 | 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 | 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 | 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 | 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 | PASS |Device pdll COM port opened 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 | 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 | STARTED |XTAL trim operation initialized.
|11:22:15.923 |DUT_PDLL_XTAL_TRIM_START | STARTED |XTAL trim operation started.
|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 | STARTED |Custom test action initialized. Data to send is=[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 | 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:
In general, how is "void hci_custom_action_cmd(uint8_t *ptr_data)" intended to be used?
In which testcases are "void hci_custom_action_cmd(uint8_t *ptr_data)" used?
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
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.
Thanks MT_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
这就是我们需要一些支持明星ted.
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?
Best Regards,
Ciano Frost
Denmark
Hi 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 -> The tag for the custom command opcode
0x01 -> the length of the payload
0x34 -> the tag for executing the proper custom test
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.
Thanks MT_dialog