This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to add the PTM mode in to keyfobdemo project using by CC2541 Mini kit

Other Parts Discussed in Thread: CC2541

How to add the PTM mode in to keyfobdemo project using by CC2541 Mini kit.

I connect the CC2541 keyfob board to my PC by UART board.

when I use HostTestAPP, it can type the HCI command by using BTool and X-CTU.

And I want to use Keyfobdemo project.

The goal what I want is when I press the button(P0_1) in initialize, it will entering the PTM mode.

And than, I can  type the HCI command by using BTool or X-CTU.

So I reference the page of PTM Wiki :http://processors.wiki.ti.com/index.php/PTM#How_to_use_Production_Test_Mode_.28PTM.29_on_the_CC254x

1. In Defined Symbols, I add the :

    HAL_UART

    DMA_PM=0

2. I add the CC254x_BLE_HCI_TL_PTM.lib.

3.The parameter 

#define PTM         4
#define RDY         5  
#define PDUP0     5
#define P0ICON   0
#define TESTER_CONNECTED() (P0_1==0)?TRUE:FALSE      //

3. The code of the following is setting the RTS/CTS.
    So I don't need to modify the code, I just "copy" and "paste" , right???

void llSetupPTMTestPort( void )
{
P0SEL &= (~BV(PTM) & ~BV(RDY));
P0DIR &= ~BV(PTM);
P0DIR |= BV(RDY);
P0 |= BV(RDY);
P0INP &= ~BV(PTM);
P2INP &= ~BV(PDUP0);
return;
}


4. add the code of entering PTM mode when P0_1 button is press in KeyFobApp_Init.

void KeyFobApp_Init( uint8 task_id )
{
        llSetupPTMTestPort();
        if(TESTER_CONNECTED() )
        {
                 HCI_EXT_EnablePTMCmd();
        }

//the original init content
keyfobapp_TaskID = task_id;
 
// Setup the GAP
VOID GAP_SetParamValue( TGAP_CONN_PAUSE_PERIPHERAL, DEFAULT_CONN_PAUSE_PERIPHERAL );
...
}


But when I use BTool and connect to the CC2541 keyfob board, it show the error message:

[3] : <Warning> - 09:13:56.970

GAP Device Initialization Timeout.

Device May Not Function Properly.


And when I use the X-CTU to transmit the HCI command such as "01 1E 20 03 11 11 03" or "01 31 FE 01 1A", it doesn't response any message.

The keyfobdemo doesn't enable the TX/RX, do I need to enable the TX/RX , let the HCI command can transmit via TX/RX ???

What should I do ?     something wrong ?