prod_test.bin Customer Test Command ID

9 posts / 0 new
Last post
Dave.Renzo
Offline
Last seen:2 years 5 months ago
Joined:2015-10-08 13:21
prod_test.bin Customer Test Command ID

Hello Support,

I've been working to get familiar with the Production Line Tool board and associated software. I am able to successfully perform the RF tests and do all the required programming of my DA14580 design (using Murata type ZY Module). I need to incorporate a unit self test while the circuit is on the production line, reading through UM-B-041 I came across the Customer Test Command ID description on page 29. The description states : "In the firmware there is a function that the customers can add their own code to handle the data as they like."

I've looked through the code for the prod_test project but haven't been able to determine where I might add my own test code. What I'd like to do is toggle 3 gpio pins in sequence and execute an i2c transaction. Is this the right place in the testing/programming process to do this and where should I start looking to be able to implement this functionality?

A related question is should I be using the prod_test code from SDK3 or SDK 5? My design uses SDK5, but I saw a post recommending the use of the SDK3 version. Any advice you could provide related to these issues would be greatly appreciated, Thanks.

Device:
Gongyu_Dialog
Offline
Last seen:4 days 11 hours ago
Joined:2016-04-27 07:07
Hi,Dave.Renzo

Hi,Dave.Renzo
Answer for question 1:
>Check the function "hci_custom_action" in file "host_hci.c" from PLT source code.
//if used for DA1458X chip, the corresponding hci cmd is "01 D0 40 01 01 (param_data).Opcode is 0x40D0
>check the function "hci_custom_action_cmd" in file "customer_prod.c" from SDK
//add customer code insided. Now the default code only returns back the event.

Answer for question 2:
Regarding as prod_test code, recommend for SDK3 if you do not intend to make any change.
But for SDK5, as far as I know, abnoraml results may obtained when in RF receiving test. Ex. the error rate may exceeds 100%. Of cource, it is the error related with the caculation part of the code.

the fix is as follows:
in file \5.0.3\projects\target_apps\prod_test\prod_test\src\custom_gtl_hci.c

struct hci_ccevt* gtl_hci_tx_evt_func(uint8_t* length)
{
......
case LLM_LE_TEST_END_CMP_EVT:
opcode = HCI_LE_TEST_END_CMD_OPCODE;
param_len += HCI_CCEVT_LETSTEND_RETPAR_LEN;
//add begin *******************
struct llm_test_end_cmd_complete * s = (struct llm_test_end_cmd_complete * )(gtl_env.p_msg_tx->param);
co_write16p(&(p_evt->param[1]), co_htobs(s->nb_packet_received));
//add end *************************
break;

Dave.Renzo
Offline
Last seen:2 years 5 months ago
Joined:2015-10-08 13:21
I got some custom code

I got some custom code running but now the production line tool gui is reporting that the custom test is failing. I am setting a gpio high, looping nop's for approximately 2 seconds then setting the gpio low. The remainder of the function is untouched so I am confused as to why it is now reporting failure.

I'd like to be able to sequentially toggle 3 GPIO pins in half second intervals. What is the best way to do this? Can I use the easy timer api? Thanks again for your help, it is very appreciated.

Dave.Renzo
Offline
Last seen:2 years 5 months ago
Joined:2015-10-08 13:21
I am now using the pwm timer

I am now using the pwm timer instead of the easy timer api but am experiencing problems. I am able to turn gpios on but not off it seems. Any thought s on what might be causing this?

Gongyu_Dialog
Offline
Last seen:4 days 11 hours ago
Joined:2016-04-27 07:07
Hi, Dave.

Hi, Dave.
You mentioned that PWM does not work ?
And besides, any time- consuming code may not recommend to add in the function "hci_custom_action_cmd", due to the timeout check in the software of the PC tool , who is waiting for the return event.
You can set a flag, then do the workload in the main function, or use the timer callback function.

Dave.Renzo
Offline
Last seen:2 years 5 months ago
Joined:2015-10-08 13:21
The PWM timer does seem to be

The PWM timer does seem to be working but if I try to do some thing as follows:

1) turn on GPIO
2) wait 1 sec
3) turn off GPIO
4) wait 1 sec

The gpio will go high and then 2 seconds later the software will report failure. For the actual test sequence I want to toggle the GPIO's for something on the order of 20ms -30ms of on time. As far as setting a flag and doing the test code in the main function, where in the main function should I do this?

Gongyu_Dialog
Offline
Last seen:4 days 11 hours ago
Joined:2016-04-27 07:07
Hi, Dave

Hi, Dave

You can add here only for test.

int main_func(void)
{
...............
/*
************************************************************************************
* Main loop
************************************************************************************
*/
while(1)
{
#if HAS_TOGGLE_GPIO
cust_gpio_fsm();
#endif
......

thomasburton
Offline
Last seen:3 years 2 months ago
Joined:2016-01-13 14:46
Hi Dialog,

Hi Dialog,

I tried to add in the code below to use XTAL trimming with my custom test in SDK5 but I still get the XTAL trim fail message on boards that I know pass it on the standard unmodified prod_test.bin

//add begin *******************
struct llm_test_end_cmd_complete * s = (struct llm_test_end_cmd_complete * )(gtl_env.p_msg_tx->param);
co_write16p(&(p_evt->param[1]), co_htobs(s->nb_packet_received));
//add end *************************

From the log:

|17:07:06.476 |DUT_PDLL_XTAL_TRIM_INIT | STARTED |XTAL trim operation initialized.
|17:07:06.477 |DUT_PDLL_XTAL_TRIM_START | STARTED |XTAL trim operation started.
设备| | 17:07:36.478 | DUT_PDLL_RX_TIMEOUT |错误did not reply on a pdll message request. Current device status=[12].
|17:07:36.479 |DUT_PDLL_XTAL_TRIM_FAILED | FAIL |XTAL trim FAILED. Current device status=[12].

Is there anything else I need to change in SDK5?

Best wishes,

Thomas

MT_dialog
Offline
Last seen:1 week 6 days ago
Staff
Joined:2015-06-08 11:34
Hi thomasburton,

Hi thomasburton,

The code that you added is for a fix that was applied for a bug that was introduced on the 5.0.3 and was related to the tests with the CBT tester, there is no use for the fix that you are implementing on the prod_test project of the 5.0.4 and also there is no use for it in order to apply a custom test.

Thanks MT_dialog