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.

CC2540 Btool - REVISITED

Other Parts Discussed in Thread: CC2540

My question is very similar to the thread of the same name started on 10-03-2011 by Sarmad Abedin but my problem was not solved by the solution presented in that (now closed) thread.

I'm trying to use the BTool software to communicate with a SmartRF05 evaluation board running HostTestApp (after loading C:\ Texas Instruments\ BLE-CC2540-1.1\ Accessories\ Hex_Files \ cc2540_ble1.1_SmartRF_HostTestRelease_Master.hex).  The difference in my situation is that I'm using a PC with a serial port and cable. 

When I start the BTool using the default communications parameters, the software fails to connect and I see the error message:

GAP Device Initialization Timeout.

Device May Not Function Properly.

I can see the serial port data from the PC come through to the CC2540 side of the RS-232 driver IC.  However, there is no response data coming back through the port. The RS-232 enable/disable switch is enabled. 

I am able to flash the SmartRF05 board with no problems and USB does enumerate on the PC. 

Thanks.

 

 

 

 

  • Have you checked the serial CTS/RTS? The stack library enables the h/w flow control when initializing the serial port.

    David

     

  • Thanks for that suggestion. 

    In looking at the flow control handshaking I realized that I left something out of my earlier post.  When I said could see data coming out of the serial port this is when using a terminal emulator program (realterm).  I can also see that RTS is asserted.  However, I don't see any data and RTS is not asserted when using BTool.  BTool is set to COM1 with the default settings and the terminal emulator is closed.  So it seems RealTerm can drive COM1 but BTool cannot.  Any ideas?

    Thank you, Valerie

     

  • When BTools pop up the com port selection box, make sure Flow: CTS/RTS is selected. BTW no parity, 1 stop, 8 data bits.

     

    Dvid

     

  • 57600 baud, CTS/RTS, no parity, 1 stop, 8 data bits are selected in BTool.  I don't see any data bits coming across from the PC when I use these settings.  This is true both for BTool and when using a terminal emulator. 

    If I shut off hardware flow control (CTS/RTS) then I can see data bits.  This is true for both BTool and the terminal emulator. 

    CTS is asserted by the dev kit board in both cases.  RTS is not asserted by the PC for either case.

    Could there be a problem with the Windows XP implementation of the serial port with hardware flow control?  Any other ideas?

  • Try this!

    With Windows XP, your serial port parameters might not be properly set for hardware flow control. To fix this, right-click on My Computer and select Properties. Go to the Hardware tab and click on Device Manager. Open up the section that says Ports (COM & LPT). Right-click on the serial port you have the device hooked to and select Properties. Go to the Port Settings tab and set the options to 19200, 8, None, 1, Hardware.

  • Thanks for that idea. 

    The device manager settings for the port were already set to: 57600, 8, none (no parity), 1 stop and hardware flow control.  I tried changing the baud rate to 19200 but got the same result (didn't work, unfortunately). 

    This is what I see in the BTool log window:

    Port opened at 12/15/2011 6:43:38 AM

    [1]: <Tx> - 6:43:38:619

    -Type                    :0x01 (Command)

    -Opcode              :0xFE00 (GAP_DeviceInit)

    -Data Length      :0x ....details omitted   

    ProfileRole          :0x ....details omitted   

    MaxScanRsPs    :0x ....details omitted   

    IRK                         :0x ....details omitted   

    CSRK                      :0x ....details omitted   

    SignCounter       :0x ....details omitted   

    Dump(Tx):

    01 00 FE 26 08 05  00 00 00 00 00 00 00 00 00 00

    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    00 00 00 00 00 00 01 00 00 00

    -------------------------------------------------------------------------

    Error writing to COM1

    The write timed out.

    This seems to indicate that BTool is not getting the response it expects from Windows when using the port.  

    A few seconds later I get the pop up window about the GAP Device initialization timeout.

    These errors appear when connecting a "new device" from BTool with nothing assigned to COM1.  If there is already a device window open and assigned to COM1, then if I attempt to connect another device to COM1 I get a different error "Failed Connecting to COM1" which appears immediately.  At least that shows that Windows is reporting the COM1 is in use.  I get a similar result if the terminal emulator is connected to COM1 and I attempt to connect another device to COM1 through BTool.

  • Well, I kept thinking that it seems like the PC does not see the CTS from the evaluation board.  So I looked for CTS on the PC side of the serial cable and ... NO CTS! 

    The problem was an incompletely populated serial cable.  I replaced the serial cable with a different one and now it works.

    Everyone who contributed ideas helped me zero in on the problem.  Thank you!

  • The CC2540 is not sending back the response to the init command because CTS is not asserted. From all your previous descriptions and experiments, this appears to be an issues with your PC hardware or cable. Have you tried another PC? Verify the cable?

    One quick work around is to disable BTool CTS/RTS and jumper CTS/RTS together on the CC2540 side. For what I have seen, it doesn't really need the hardware flow control, You can't drive it fast enough with BTool.

    David

  • David, yes, I had just discovered it was the cable right before your post. 

    Thanks for the other information.  I had been wondering if I could disable the RTS/CTS and how to go about doing that. 

    Thank you for your help!

  • Thanks for this post it helped me

     

  • I had the same problem using my CC2540 eval board plugged into a SmartRF05EB, 

    "GAP Device Initialization Timeout"

    and solved it with the following:

    1) Set the RS232 Enable switch on the SmartRF05EB board to enable.

    2) Modified the source code of the Host Test App to disable flow control in file npi.h by setting NPI_UART_FC to FALSE.  (Be sure to select the CC2540EM project in the IAR IDE.)

    #if !defined( NPI_UART_FC )
    #define NPI_UART_FC FALSE
    #endif // !NPI_UART_FC

     

    3) Set the flow control to None in BTtool.

    4)  Set the baud rate to 115200 in BTtool noting in the source code that the UART baud was set to 115200.

    #define NPI_UART_BR                    HAL_UART_BR_115200