Hi, I am using the HostTestRelease Project with the TI CC2540 USB dongle and want to run it in Peripheral mode. Testing with BTool, after calling DeviceInit with Peripheral Mode which is successful, I am sending a GAP Make Discoverable request, but the device is answering "Not Ready To Perform Task" (see log). I know that it's possible to set initial advertising enable in the application code, but I want to set advertising manually, can someone help out? Here is the log of BTool:
[12] : <Tx> - 11:24:06.430 -Type : 0x01 (Command) -Opcode : 0xFE00 (GAP_DeviceInit) -Data Length : 0x26 (38) byte(s) ProfileRole : 0x04 (Peripheral) MaxScanRsps : 0x05 (5) IRK : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 CSRK : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 SignCounter : 0x00000001 (1) Dump(Tx): 01 00 FE 26 04 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 ------------------------------------------------------------------------------------------------------------------------ [13] : <Rx> - 11:24:06.497 -Type : 0x04 (Event) -EventCode : 0xFF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (Success) OpCode : 0xFE00 (GAP_DeviceInit) DataLength : 0x00 (0) Dump(Rx): 04 FF 06 7F 06 00 00 FE 00 ------------------------------------------------------------------------------------------------------------------------ [14] : <Rx> - 11:24:06.562 -Type : 0x04 (Event) -EventCode : 0xFF (HCI_LE_ExtEvent) -Data Length : 0x2C (44) bytes(s) Event : 0x0600 (GAP_DeviceInitDone) Status : 0x00 (Success) DevAddr : C0:FF:EE:C0:FF:EE DataPktLen : 0x001B (27) NumDataPkts : 0x04 (4) IRK : 67:76:7D:A8:78:A1:A8:61:71:BD:58:24:92:39:0E:EC CSRK : 4E:EA:B7:B5:14:34:66:8C:2D:6B:29:9D:C9:1E:4F:16 Dump(Rx): 04 FF 2C 00 06 00 EE FF C0 EE FF C0 1B 00 04 67 76 7D A8 78 A1 A8 61 71 BD 58 24 92 39 0E EC 4E EA B7 B5 14 34 66 8C 2D 6B 29 9D C9 1E 4F 16 ------------------------------------------------------------------------------------------------------------------------ [15] : <Tx> - 11:24:13.314 -Type : 0x01 (Command) -Opcode : 0xFE06 (GAP_MakeDiscoverable) -Data Length : 0x0F (15) byte(s) EventType : 0x00 (Connectable Undirect Advertisement) InitAddrType : 0x00 (Public) InitAddrs : 00:00:00:00:00:00 ChannelMap : 0x07 (Channel 37 Channel 38 Channel 39) FilterPolicy : 0x00 (Allow Scan Requests From Any, Allow Connect Request From Any.) Dump(Tx): 01 06 FE 0F 00 00 00 00 00 00 00 00 07 00 00 00 00 00 00 ------------------------------------------------------------------------------------------------------------------------ [16] : <Rx> - 11:24:13.379 -Type : 0x04 (Event) -EventCode : 0xFF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (GAP_HCI_ExtentionCommandStatus) Status : 0x10 (Not Ready To Perform Task) OpCode : 0xFE06 (GAP_MakeDiscoverable) DataLength : 0x00 (0) Dump(Rx): 04 FF 06 7F 06 10 06 FE 00 ------------------------------------------------------------------------------------------------------------------------
I still didn't figure out a solution yet, but I might have found a reason: According to the Vendor Specific HCI guide, the GAP_DeviceInit command should be called only once per reboot - as BTool is initializing the device as Central per default when starting, I am executing the command for a second time with Peripheral option. Rebooting the device after BTool startup won't work because the COM connection would get lost. Is there some way I can prevent BTool from automatically initializing the device as Central at startup?
Hi Till,
Have a look at this post: http://e2e.ti.com/support/low_power_rf/f/538/p/187762/732079.aspx#732079.
Best Regards