BTstack on STM32 F4 Discovery with USB Dongle

244 views
Skip to first unread message

Matthias Ringwald

unread,
Feb 15, 2021, 9:26:28 AM2/15/21
to btsta...@googlegroups.com
Hi There

Over the years, there has been occasional requests and even ports by community members for an MCU USB Port. We decided to try ourselves and document it for others to follow.

Blog post:https://bluekitchen-gmbh.com/btstack-stm32-usb-port/

Best regards
Matthias

Toshiharu Ohno

unread,
Mar 2, 2021, 3:22:40 AM3/2/21
to btstack-dev
It works like a charm and I can't stop myself try to port it onto my STM32F769i-Discovery board.
With simple straight forward porting work and suggested USB host stack bug fix, A2DP sink demo
is working!!

Great thanks for your effort. Looking forward to see current dev code became part of official
release.

BR

Toshiharu

2021年2月15日月曜日 23:26:28 UTC+9 matthias:

Matthias Ringwald

unread,
Mar 3, 2021, 8:50:43 AM3/3/21
to btsta...@googlegroups.com
Hello Toshiharu

Thanks! I'm glad you've liked the post and have been able to adapt the port for your F769 Discovery board!

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/a6c117b1-3524-4ee3-a1ae-6685ad6b5886n%40googlegroups.com.

Maheshwari R

unread,
Jul 27, 2021, 5:05:58 PM7/27/21
to btstack-dev
Hi Team 

I have downloaded the code from this link https://github.com/bluekitchen/btstack and follow the steps from this Blog and generate the code with USB configuration in stm32 controller (stm32f769IBITX) and port the downloaded code with the generated code and verified the USB configuration and HCI Commands and I am able to pair the Bluetooth Dongle (CSR8510 A10) with Laptop(Windows OS and Linux), but I couldn't pair it with android. While trying to pair with the android it showing couldn't pair because of an incorrect pin or passkey. 

Please give your suggestions to solve this issue.

Matthias Ringwald

unread,
Jul 27, 2021, 5:08:17 PM7/27/21
to btsta...@googlegroups.com
Hi Toshiharu

Please post a HCI packet log.

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/a73f1f86-41ee-4bb5-b973-273a99f2f340n%40googlegroups.com.

Maheshwari R

unread,
Jul 28, 2021, 9:02:48 AM7/28/21
to btstack-dev
Hi Team,

Please find the log which is in below 

Hi Team,

Please find the log 

Mobile to BT Dongle (CSR8510 A10)
=========================================
USB Device Connected
USB Device Reset Completed
PID: 1h
VID: a12h
Address (#1) assigned.
Manufacturer : N/A
Product : CSR8510 A10
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.

Interface 0, endpoint #0: address 0x83, attributes 0x03, packet size 16, poll 1

-> HCI Event
Interface 0, endpoint #1: address 0x01, attributes 0x02, packet size 64, poll 1

-> HCI ACL OUT
Interface 0, endpoint #2: address 0x81, attributes 0x02, packet size 64, poll 1

-> HCI ACL INBluetooth class started.
[port.c ][port main()]BTstack on STM32 F4 Discovery with USB support starting...

[port.c ] btstack_memory_init done
[port.c ] btstack_run_loop_init done
[port.c ] hci_init done
[00:00:01.647] LOG -- btstack_tlv_flash_bank.c.443: found bank -1

test erased: bank 0, offset 0
test erased 0 - 10
[00:00:01.659] LOG -- btstack_tlv_flash_bank.c.235: bank 0 not empty, erase bank

write offset 8
[00:00:01.670] LOG -- btstack_tlv.c.48: TLV Instance 0x8027564

[00:00:01.702] LOG -- le_device_db_tlv.c.159: num valid le device entries 0

[port.c] Entering btstack_main()
L2CAP_REGISTER_SERVICE psm 0x1 mtu 65535
SDP service record size: 58

[00:00:01.720] LOG -- att_db.c.209: att_set_db 0x8027879
Num LE Peripheral roles: 0 of 1
[hci.c ][hci_power_control()] hci_power_control: 1, current mode 0
[hci_transport_h2_stm32.c] [hci_transport_h2_stm32_init()] hci_transport_h2_stm32_init

[hci.c][hci_emit_state()]BTSTACK_EVENT_STATE 1
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 0, can send 1
[00:00:01.758] CMD => 03 0C 00 
2.[btstack_run_loop.c][btstack_run_loop_execute]()
[00:00:01.767] EVT <= 6E 00 

[00:00:01.772] EVT <= 0E 04 01 03 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c03 at substate 1
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 2, can send 1
[00:00:01.798] CMD => 01 10 00 

[00:00:01.802] EVT <= 6E 00 

[00:00:01.807] EVT <= 0E 0C 01 01 10 00 06 20 31 06 0A 00 BB 22 

Manufacturer: 0x000a
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1001 at substate 3
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 4, can send 1
[00:00:01.838] CMD => 14 0C 00 

[00:00:01.842] EVT <= 6E 00 

[00:00:01.861] EVT <= 0E FC 01 14 0C 00 43 53 52 38 35 31 30 20 41 31 30 0A 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 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 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 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 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 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 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 00 00 00 00 00 00 00 00 00 00 00 00 

[hci.c ][handle_command_complete_event()] local name: CSR8510 A10

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c14 at substate 5
Received local name, need baud change 0
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 8, can send 1
[00:00:01.993] CMD => 02 10 00 

[00:00:01.998] EVT <= 6E 00 

[00:00:02.007] EVT <= 0E 44 01 02 10 00 FF FF FF 03 80 FF FF FF 3F FF FF 1F F2 0F E8 FE 3F F7 8D FF 1C 00 00 00 7D F7 FF FF 7F 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 00 00 00 

Local supported commands summary 8f - 01
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1002 at substate 15
[00:00:02.052] LOG -- btstack_crypto.c.1110: controller supports ECDH operation: 0

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 22, can send 1
[00:00:02.070] CMD => 09 10 00 

[00:00:02.075] EVT <= 6E 00 

[00:00:02.078] EVT <= 0E 0A 01 09 10 00 10 71 DA 7D 1A 00 

Local Address, Status: 0x00: Addr: 00:1A:7D:DA:71:10
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1009 at substate 23
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 24, can send 1
[00:00:02.112] CMD => 05 10 00 

[00:00:02.116] EVT <= 6E 00 

[00:00:02.120] EVT <= 0E 0B 01 05 10 00 80 02 40 04 00 08 00 

[hci.c ][handle_command_complete_event()] hci_read_buffer_size: ACL size module 640 -> used 640, count 4 / SCO size 64, count 8
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1005 at substate 25
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 26, can send 1
[00:00:02.161] CMD => 03 10 00 

[00:00:02.166] EVT <= 6E 00 

[00:00:02.169] EVT <= 0E 0C 01 03 10 00 FF FF 8F FA 9B FF 59 87 

[hci.c ][hci_acl_packet_types_for_buffer_size_and_local_features() ] Features bit 26 is not set, removing packet types 0x2204
Packet types ee1c, eSCO 1
BR/EDR support 1, LE support 0
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1003 at substate 27
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 28, can send 1
[00:00:02.215] CMD => 01 0C 08 FF FF FF FF FF FF FF 1F 

[00:00:02.223] EVT <= 6E 00 

[00:00:02.228] EVT <= 0E 04 01 01 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c01 at substate 29
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 30, can send 1
[00:00:02.254] CMD => 56 0C 01 01 

[00:00:02.259] EVT <= 0E 04 01 56 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c56 at substate 31
[00:00:02.275] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 32, can send 1
[00:00:02.289] CMD => 18 0C 02 00 60 

[00:00:02.294] EVT <= 6E 00 

[00:00:02.299] EVT <= 0E 04 01 18 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c18 at substate 33
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 34, can send 1
[00:00:02.325] CMD => 0F 08 02 00 00 

[00:00:02.330] EVT <= 6E 00 

[00:00:02.335] EVT <= 0E 04 01 0F 08 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 080f at substate 35
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 36, can send 1
[00:00:02.361] CMD => 24 0C 03 0C 02 7A 

[00:00:02.367] EVT <= 0E 04 01 24 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c24 at substate 37
[00:00:02.383] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 38, can send 1
[00:00:02.397] CMD => 13 0C 1E 50 48 4D 49 20 42 54 20 44 6F 6E 67 6C 65 20 30 30 3A 30 30 3A 30 30 3A 30 30 3A 30 30 3A 

[00:00:02.413] EVT <= 6E 00 

[00:00:02.418] EVT <= 0E 04 01 13 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c13 at substate 39
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 40, can send 1
[00:00:02.444] CMD => 52 0C 1F 00 1D 09 50 48 4D 49 20 42 54 20 44 6F 6E 67 6C 65 20 30 30 3A 30 30 3A 30 30 3A 30 30 3A 30 

[00:00:02.461] EVT <= 6E 00 

[00:00:02.464] EVT <= 0E 04 01 52 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c52 at substate 41
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 42, can send 1
[00:00:02.490] CMD => 45 0C 01 00 

[00:00:02.496] EVT <= 6E 00 

[00:00:02.499] EVT <= 0E 04 01 45 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c45 at substate 43
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 46, can send 1
[00:00:02.525] CMD => 1A 0C 01 03 

[00:00:02.531] EVT <= 6E 00 

[00:00:02.535] EVT <= 0E 04 01 1A 0C 00 

[hci.c] [hci_emit_discoverable_enabled()] BTSTACK_EVENT_DISCOVERABLE_ENABLED 1
[hci.c] [hci_emit_discoverable_enabled()] calling hci_emit_event() ...... 
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c1a at substate 47
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 48, can send 1
[00:00:02.575] CMD => 2F 0C 01 01 

[00:00:02.580] EVT <= 0E 04 01 2F 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c2f at substate 49
[00:00:02.596] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 50, can send 1
[00:00:02.610] CMD => 5B 0C 01 01 

[00:00:02.615] EVT <= 6E 00 

[00:00:02.619] EVT <= 0E 04 01 5B 0C 01 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c5b at substate 51
[hci.c][hci_init_done()] hci_init_done -> HCI_STATE_WORKING
[hci.c][hci_init_done()] calling hci_emit_state()..... 
[hci.c][hci_emit_state()]BTSTACK_EVENT_STATE 2
HCI Working!
[00:00:02.652] CMD => 18 20 00 

hci_le_set_own_address_type: old 0, new 0
[hci.c][hci_init_done()] calling hci_run()..... 
[00:00:02.665] EVT <= 6E 00 

[00:00:02.670] EVT <= 0E 04 01 18 20 01 

[00:00:02.675] CMD => 18 20 00 

[00:00:02.680] EVT <= 0E 04 01 18 20 01 

write '534d4552', len 16 at 8
Generated ER key. Store in TLV status: 0
[00:00:02.692] LOG -- btstack_util.c.290: ER     56F18FFA9BFF598756F18FFA9BFF5987

[00:00:02.702] EVT <= 6E 00 

[00:00:02.706] CMD => 18 20 00 

[00:00:02.711] EVT <= 6E 00 

[00:00:02.714] EVT <= 0E 04 01 18 20 01 

[00:00:02.720] CMD => 18 20 00 

[00:00:02.725] EVT <= 6E 00 

[00:00:02.729] EVT <= 0E 04 01 18 20 01 

write '534d4952', len 16 at 32
Generated IR key. Store in TLV status: 0
[00:00:02.742] LOG -- btstack_util.c.290: IR     56F18FFA9BFF598756F18FFA9BFF5987

[00:00:02.750] CMD => 06 20 0F 30 00 30 00 00 00 00 00 00 00 00 00 00 07 00 

[00:00:02.761] EVT <= 6E 00 

[00:00:02.765] EVT <= 0E 04 01 06 20 01 

DKG_CALC_IRK started
[00:00:02.772] CMD => 17 20 20 87 59 FF 9B FA 8F F1 56 87 59 FF 9B FA 8F F1 56 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.789] EVT <= 6E 00 

[00:00:02.794] EVT <= 0E 04 01 17 20 01 

[00:00:02.799] LOG -- btstack_util.c.290: irk    FEE80FF21FFFE85B8759FF9BFA8FF266

[00:00:02.807] CMD => 08 20 20 13 02 01 06 0B 09 4C 45 20 43 6F 75 6E 74 65 72 03 02 10 FF 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.825] EVT <= 6E 00 

[00:00:02.828] EVT <= 0E 04 01 08 20 01 

DKG_CALC_DHK started
[00:00:02.836] CMD => 17 20 20 87 59 FF 9B FA 8F F1 56 87 59 FF 9B FA 8F F1 56 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.853] EVT <= 0E 04 01 17 20 01 

[00:00:02.858] LOG -- btstack_util.c.290: dhk    FEE80FF21FFFE85B8759FF9BFA8FF266

[00:00:02.867] EVT <= 6E 00 

[00:00:02.871] CMD => 0A 20 01 01 

[00:00:02.876] EVT <= 0E 04 01 0A 20 01 

[00:00:02.881] EVT <= 6E 00 

[00:00:25.641] EVT <= 05 04 00 00 00 16 

[00:00:25.647] EVT <= 03 0B 13 00 00 66 51 82 72 6B 9C 01 00 

Connection_complete (status=19) 9C:6B:72:82:51:66
[00:00:26.944] EVT <= 04 0A 66 51 82 72 6B 9C 0C 02 5A 01 

Connection_incoming: 9C:6B:72:82:51:66, type 1
create connection
create_connection_for_addr 9C:6B:72:82:51:66, type fd
sending hci_accept_connection_request
[00:00:26.966] CMD => 09 04 07 66 51 82 72 6B 9C 01 

[00:00:26.974] EVT <= 6E 00 

[00:00:26.978] EVT <= 0F 04 00 01 09 04 

[00:00:26.984] EVT <= 03 0B 00 30 00 66 51 82 72 6B 9C 01 00 

Connection_complete (status=0) 9C:6B:72:82:51:66
New connection: handle 48, 9C:6B:72:82:51:66
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:00:27.005] CMD => 1B 04 02 30 00 

[00:00:27.010] EVT <= 20 07 66 51 82 72 6B 9C 01 

[00:00:27.017] EVT <= 6E 00 

[00:00:27.021] EVT <= 0F 04 00 01 1B 04 

[00:00:27.027] EVT <= 0B 0B 00 30 00 FF FE 8F FE D8 3F 5B 87 

[00:00:27.035] CMD => 1C 04 03 30 00 01 

[00:00:27.047] EVT <= 38 04 30 00 40 1F 

[00:00:29.054] EVT <= 6E 00 

[00:00:29.058] EVT <= 0F 04 00 01 1C 04 

[00:00:29.064] EVT <= 23 0D 00 30 00 01 01 0B 00 00 00 00 00 00 00 

Remote features 03, bonding flags f8
[00:00:29.155] EVT <= 32 09 66 51 82 72 6B 9C 01 00 03 

[00:00:29.163] EVT <= 31 06 66 51 82 72 6B 9C 

IO Capability Request received, stack bondable 1, io cap 1
Sending Cap reply
gap_mitm_protection_required_for_security_level 0
[00:00:29.181] CMD => 2B 04 09 66 51 82 72 6B 9C 01 00 04 

[00:00:29.189] EVT <= 6E 00 

[00:00:29.647] EVT <= 0E 0A 01 2B 04 00 66 51 82 72 6B 9C 

[00:00:30.192] EVT <= 33 0A 66 51 82 72 6B 9C 09 F0 06 00 

[00:00:30.200] CMD => 2C 04 06 66 51 82 72 6B 9C 

[00:00:30.207] EVT <= 6E 00 

[00:00:30.211] EVT <= 0E 0A 01 2C 04 00 66 51 82 72 6B 9C 

[00:00:32.103] EVT <= 36 07 00 66 51 82 72 6B 9C 

[00:00:32.116] EVT <= 06 03 00 30 00 

Laptop(Linux) to BT Dongle(CSR8510 A10)
===================================
USB Device Connected
USB Device Reset Completed
PID: 1h
VID: a12h
Address (#1) assigned.
Manufacturer : N/A
Product : CSR8510 A10
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.

Interface 0, endpoint #0: address 0x83, attributes 0x03, packet size 16, poll 1

-> HCI Event
Interface 0, endpoint #1: address 0x01, attributes 0x02, packet size 64, poll 1

-> HCI ACL OUT
Interface 0, endpoint #2: address 0x81, attributes 0x02, packet size 64, poll 1

-> HCI ACL INBluetooth class started.
[port.c ][port main()]BTstack on STM32 F4 Discovery with USB support starting...

[port.c ] btstack_memory_init done
[port.c ] btstack_run_loop_init done
[port.c ] hci_init done
[00:00:01.646] LOG -- btstack_tlv_flash_bank.c.443: found bank -1

test erased: bank 0, offset 0
test erased 0 - 10
[00:00:01.658] LOG -- btstack_tlv_flash_bank.c.235: bank 0 not empty, erase bank

write offset 8
[00:00:01.669] LOG -- btstack_tlv.c.48: TLV Instance 0x8027550

[00:00:01.701] LOG -- le_device_db_tlv.c.159: num valid le device entries 0

[port.c] Entering btstack_main()
L2CAP_REGISTER_SERVICE psm 0x1 mtu 65535
SDP service record size: 58

[00:00:01.719] LOG -- att_db.c.209: att_set_db 0x8027865
Num LE Peripheral roles: 0 of 1
[hci.c ][hci_power_control()] hci_power_control: 1, current mode 0
[hci_transport_h2_stm32.c] [hci_transport_h2_stm32_init()] hci_transport_h2_stm32_init

[hci.c][hci_emit_state()]BTSTACK_EVENT_STATE 1
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 0, can send 1
[00:00:01.757] CMD => 03 0C 00 
2.[btstack_run_loop.c][btstack_run_loop_execute]()
[00:00:01.766] EVT <= 6E 00 

[00:00:01.771] EVT <= 0E 04 01 03 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c03 at substate 1
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 2, can send 1
[00:00:01.797] CMD => 01 10 00 

[00:00:01.801] EVT <= 6E 00 

[00:00:01.806] EVT <= 0E 0C 01 01 10 00 06 20 31 06 0A 00 BB 22 

Manufacturer: 0x000a
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1001 at substate 3
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 4, can send 1
[00:00:01.837] CMD => 14 0C 00 

[00:00:01.841] EVT <= 6E 00 

[00:00:01.860] EVT <= 0E FC 01 14 0C 00 43 53 52 38 35 31 30 20 41 31 30 0A 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 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 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 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 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 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 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 00 00 00 00 00 00 00 00 00 00 00 00 

[hci.c ][handle_command_complete_event()] local name: CSR8510 A10

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c14 at substate 5
Received local name, need baud change 0
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 8, can send 1
[00:00:01.992] CMD => 02 10 00 

[00:00:01.997] EVT <= 6E 00 

[00:00:02.005] EVT <= 0E 44 01 02 10 00 FF FF FF 03 80 FF FF FF 3F FF FF 1F F2 0F E8 FE 3F F7 8D FF 1C 00 00 00 7D F7 FF FF 7F 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 00 00 00 

Local supported commands summary 8f - 01
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1002 at substate 15
[00:00:02.050] LOG -- btstack_crypto.c.1110: controller supports ECDH operation: 0

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 22, can send 1
[00:00:02.068] CMD => 09 10 00 

[00:00:02.073] EVT <= 6E 00 

[00:00:02.076] EVT <= 0E 0A 01 09 10 00 10 71 DA 7D 1A 00 

Local Address, Status: 0x00: Addr: 00:1A:7D:DA:71:10
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1009 at substate 23
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 24, can send 1
[00:00:02.110] CMD => 05 10 00 

[00:00:02.114] EVT <= 6E 00 

[00:00:02.118] EVT <= 0E 0B 01 05 10 00 80 02 40 04 00 08 00 

[hci.c ][handle_command_complete_event()] hci_read_buffer_size: ACL size module 640 -> used 640, count 4 / SCO size 64, count 8
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1005 at substate 25
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 26, can send 1
[00:00:02.159] CMD => 03 10 00 

[00:00:02.164] EVT <= 6E 00 

[00:00:02.167] EVT <= 0E 0C 01 03 10 00 FF FF 8F FA 9B FF 59 87 

[hci.c ][hci_acl_packet_types_for_buffer_size_and_local_features() ] Features bit 26 is not set, removing packet types 0x2204
Packet types ee1c, eSCO 1
BR/EDR support 1, LE support 0
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1003 at substate 27
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 28, can send 1
[00:00:02.213] CMD => 01 0C 08 FF FF FF FF FF FF FF 1F 

[00:00:02.221] EVT <= 6E 00 

[00:00:02.226] EVT <= 0E 04 01 01 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c01 at substate 29
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 30, can send 1
[00:00:02.252] CMD => 56 0C 01 01 

[00:00:02.257] EVT <= 0E 04 01 56 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c56 at substate 31
[00:00:02.273] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 32, can send 1
[00:00:02.287] CMD => 18 0C 02 00 60 

[00:00:02.292] EVT <= 6E 00 

[00:00:02.297] EVT <= 0E 04 01 18 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c18 at substate 33
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 34, can send 1
[00:00:02.323] CMD => 0F 08 02 00 00 

[00:00:02.328] EVT <= 6E 00 

[00:00:02.333] EVT <= 0E 04 01 0F 08 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 080f at substate 35
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 36, can send 1
[00:00:02.359] CMD => 24 0C 03 0C 02 7A 

[00:00:02.365] EVT <= 0E 04 01 24 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c24 at substate 37
[00:00:02.381] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 38, can send 1
[00:00:02.395] CMD => 13 0C 1E 50 48 4D 49 20 42 54 20 44 6F 6E 67 6C 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.411] EVT <= 6E 00 

[00:00:02.416] EVT <= 0E 04 01 13 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c13 at substate 39
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 40, can send 1
[00:00:02.442] CMD => 52 0C 1F 00 0F 09 50 48 4D 49 20 42 54 20 44 6F 6E 67 6C 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.459] EVT <= 6E 00 

[00:00:02.462] EVT <= 0E 04 01 52 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c52 at substate 41
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 42, can send 1
[00:00:02.488] CMD => 45 0C 01 00 

[00:00:02.493] EVT <= 6E 00 

[00:00:02.497] EVT <= 0E 04 01 45 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c45 at substate 43
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 46, can send 1
[00:00:02.523] CMD => 1A 0C 01 03 

[00:00:02.528] EVT <= 6E 00 

[00:00:02.533] EVT <= 0E 04 01 1A 0C 00 

[hci.c] [hci_emit_discoverable_enabled()] BTSTACK_EVENT_DISCOVERABLE_ENABLED 1
[hci.c] [hci_emit_discoverable_enabled()] calling hci_emit_event() ...... 
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c1a at substate 47
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 48, can send 1
[00:00:02.573] CMD => 2F 0C 01 01 

[00:00:02.578] EVT <= 0E 04 01 2F 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c2f at substate 49
[00:00:02.594] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 50, can send 1
[00:00:02.608] CMD => 5B 0C 01 01 

[00:00:02.613] EVT <= 6E 00 

[00:00:02.617] EVT <= 0E 04 01 5B 0C 01 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c5b at substate 51
[hci.c][hci_init_done()] hci_init_done -> HCI_STATE_WORKING
[hci.c][hci_init_done()] calling hci_emit_state()..... 
[hci.c][hci_emit_state()]BTSTACK_EVENT_STATE 2
HCI Working!
[00:00:02.650] CMD => 18 20 00 

hci_le_set_own_address_type: old 0, new 0
[hci.c][hci_init_done()] calling hci_run()..... 
[00:00:02.663] EVT <= 6E 00 

[00:00:02.668] EVT <= 0E 04 01 18 20 01 

[00:00:02.673] CMD => 18 20 00 

[00:00:02.678] EVT <= 6E 00 

[00:00:02.682] EVT <= 0E 04 01 18 20 01 

write '534d4552', len 16 at 8
Generated ER key. Store in TLV status: 0
[00:00:02.694] LOG -- btstack_util.c.290: ER     56F18FFA9BFF598756F18FFA9BFF5987

[00:00:02.704] CMD => 18 20 00 

[00:00:02.709] EVT <= 0E 04 01 18 20 01 

[00:00:02.714] EVT <= 6E 00 

[00:00:02.718] CMD => 18 20 00 

[00:00:02.723] EVT <= 6E 00 

[00:00:02.726] EVT <= 0E 04 01 18 20 01 

write '534d4952', len 16 at 32
Generated IR key. Store in TLV status: 0
[00:00:02.739] LOG -- btstack_util.c.290: IR     56F18FFA9BFF598756F18FFA9BFF5987

[00:00:02.747] CMD => 06 20 0F 30 00 30 00 00 00 00 00 00 00 00 00 00 07 00 

[00:00:02.758] EVT <= 0E 04 01 06 20 01 

[00:00:02.763] EVT <= 6E 00 

DKG_CALC_IRK started
[00:00:02.769] CMD => 17 20 20 87 59 FF 9B FA 8F F1 56 87 59 FF 9B FA 8F F1 56 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.787] EVT <= 6E 00 

[00:00:02.791] EVT <= 0E 04 01 17 20 01 

[00:00:02.796] LOG -- btstack_util.c.290: irk    FEE80FF21FFFE85B8759FF9BFA8FF266

[00:00:02.804] CMD => 08 20 20 13 02 01 06 0B 09 4C 45 20 43 6F 75 6E 74 65 72 03 02 10 FF 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.822] EVT <= 6E 00 

[00:00:02.825] EVT <= 0E 04 01 08 20 01 

DKG_CALC_DHK started
[00:00:02.833] CMD => 17 20 20 87 59 FF 9B FA 8F F1 56 87 59 FF 9B FA 8F F1 56 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.850] EVT <= 0E 04 01 17 20 01 

[00:00:02.855] LOG -- btstack_util.c.290: dhk    FEE80FF21FFFE85B8759FF9BFA8FF266

[00:00:02.863] EVT <= 6E 00 

[00:00:02.867] CMD => 0A 20 01 01 

[00:00:02.873] EVT <= 6E 00 

[00:00:02.877] EVT <= 0E 04 01 0A 20 01 

[00:01:12.973] EVT <= 04 0A A5 E1 72 7D B2 7C 0C 01 0C 01 

Connection_incoming: 7C:B2:7D:72:E1:A5, type 1
create connection
create_connection_for_addr 7C:B2:7D:72:E1:A5, type fd
sending hci_accept_connection_request
[00:01:12.995] CMD => 09 04 07 A5 E1 72 7D B2 7C 01 

[00:01:13.003] EVT <= 6E 00 

[00:01:13.007] EVT <= 0F 04 00 01 09 04 

[00:01:13.013] EVT <= 03 0B 00 30 00 A5 E1 72 7D B2 7C 01 00 

Connection_complete (status=0) 7C:B2:7D:72:E1:A5
New connection: handle 48, 7C:B2:7D:72:E1:A5
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:01:13.034] CMD => 1B 04 02 30 00 

[00:01:13.040] EVT <= 6E 00 

[00:01:13.044] EVT <= 0F 04 00 01 1B 04 

[00:01:13.050] EVT <= 0B 0B 00 30 00 BF FE 0F FE DB FF 7B 87 

[00:01:13.058] CMD => 1C 04 03 30 00 01 

[00:01:13.064] EVT <= 0F 04 00 01 1C 04 

[00:01:13.070] EVT <= 6E 00 

[00:01:13.074] EVT <= 23 0D 00 30 00 01 01 0B 00 00 00 00 00 00 00 

Remote features 03, bonding flags f8
[00:01:13.204] EVT <= 20 07 A5 E1 72 7D B2 7C 01 

[00:01:13.238] EVT <= 32 09 A5 E1 72 7D B2 7C 01 00 03 

[00:01:13.246] EVT <= 31 06 A5 E1 72 7D B2 7C 

IO Capability Request received, stack bondable 1, io cap 1
Sending Cap reply
gap_mitm_protection_required_for_security_level 0
[00:01:13.264] CMD => 2B 04 09 A5 E1 72 7D B2 7C 01 00 04 

[00:01:13.272] EVT <= 6E 00 

[00:01:13.733] EVT <= 0E 0A 01 2B 04 00 A5 E1 72 7D B2 7C 

[00:01:14.428] EVT <= 33 0A A5 E1 72 7D B2 7C D6 B1 07 00 

[00:01:14.436] CMD => 2C 04 06 A5 E1 72 7D B2 7C 

[00:01:14.443] EVT <= 6E 00 

[00:01:14.447] EVT <= 0E 0A 01 2C 04 00 A5 E1 72 7D B2 7C 

[00:01:16.405] EVT <= 36 07 00 A5 E1 72 7D B2 7C 

[00:01:16.421] EVT <= 06 03 00 30 00 

[00:01:16.442] EVT <= 08 04 00 30 00 01 

Encryption state change: 1, key size 0
event handler, state 0
[00:01:16.453] CMD => 08 14 02 30 00 

[00:01:18.452] EVT <= 6E 00 

[00:01:18.456] EVT <= 0E 07 01 08 14 00 30 00 10 

Handle 0030 key Size: 16
[00:01:18.465] CMD => 11 04 02 30 00 

[00:01:18.471] EVT <= 6E 00 

[00:01:18.475] EVT <= 0F 04 00 01 11 04 

[00:01:18.481] EVT <= 17 06 A5 E1 72 7D B2 7C 

HCI_EVENT_LINK_KEY_REQUEST
responding to link key request, have link key db: 1
[00:01:18.521] CMD => 0C 04 06 A5 E1 72 7D B2 7C 

[00:01:18.528] EVT <= 6E 00 

[00:01:18.532] EVT <= 0E 0A 01 0C 04 00 A5 E1 72 7D B2 7C 

[00:01:18.540] EVT <= 31 06 A5 E1 72 7D B2 7C 

IO Capability Request received, stack bondable 1, io cap 1
Sending Cap reply
gap_mitm_protection_required_for_security_level 0
[00:01:18.558] CMD => 2B 04 09 A5 E1 72 7D B2 7C 01 00 04 

[00:01:18.566] EVT <= 6E 00 

[00:01:19.021] EVT <= 0E 0A 01 2B 04 00 A5 E1 72 7D B2 7C 

[00:01:19.029] EVT <= 32 09 A5 E1 72 7D B2 7C 01 00 05 

[00:01:19.694] EVT <= 33 0A A5 E1 72 7D B2 7C 1A 89 0B 00 

[00:01:19.702] CMD => 2C 04 06 A5 E1 72 7D B2 7C 

[00:01:19.710] EVT <= 33 0A A5 E1 72 7D B2 7C D9 CD 02 00 

[00:01:19.717] EVT <= 6E 00 

[00:01:19.721] EVT <= 0E 0A 01 2C 04 00 A5 E1 72 7D B2 7C 

[00:01:19.729] CMD => 2C 04 06 A5 E1 72 7D B2 7C 

[00:01:19.736] EVT <= 6E 00 

[00:01:19.740] EVT <= 0E 0A 01 2C 04 00 A5 E1 72 7D B2 7C 

Laptop(Windows) to BT dongle (CSR8510 A10)
=======================================
USB Device Connected
USB Device Reset Completed
PID: 1h
VID: a12h
Address (#1) assigned.
Manufacturer : N/A
Product : CSR8510 A10
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.

Interface 0, endpoint #0: address 0x83, attributes 0x03, packet size 16, poll 1

-> HCI Event
Interface 0, endpoint #1: address 0x01, attributes 0x02, packet size 64, poll 1

-> HCI ACL OUT
Interface 0, endpoint #2: address 0x81, attributes 0x02, packet size 64, poll 1

-> HCI ACL INBluetooth class started.
[port.c ][port main()]BTstack on STM32 F4 Discovery with USB support starting...

[port.c ] btstack_memory_init done
[port.c ] btstack_run_loop_init done
[port.c ] hci_init done
[00:00:01.647] LOG -- btstack_tlv_flash_bank.c.443: found bank -1

test erased: bank 0, offset 0
test erased 0 - 10
[00:00:01.659] LOG -- btstack_tlv_flash_bank.c.235: bank 0 not empty, erase bank

write offset 8
[00:00:01.669] LOG -- btstack_tlv.c.48: TLV Instance 0x8027564

[00:00:01.702] LOG -- le_device_db_tlv.c.159: num valid le device entries 0

[port.c] Entering btstack_main()
L2CAP_REGISTER_SERVICE psm 0x1 mtu 65535
SDP service record size: 58

[00:00:01.720] LOG -- att_db.c.209: att_set_db 0x8027879
Num LE Peripheral roles: 0 of 1
[hci.c ][hci_power_control()] hci_power_control: 1, current mode 0
[hci_transport_h2_stm32.c] [hci_transport_h2_stm32_init()] hci_transport_h2_stm32_init

[hci.c][hci_emit_state()]BTSTACK_EVENT_STATE 1
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 0, can send 1
[00:00:01.758] CMD => 03 0C 00 
2.[btstack_run_loop.c][btstack_run_loop_execute]()
[00:00:01.767] EVT <= 6E 00 

[00:00:01.772] EVT <= 0E 04 01 03 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c03 at substate 1
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 2, can send 1
[00:00:01.798] CMD => 01 10 00 

[00:00:01.803] EVT <= 6E 00 

[00:00:01.807] EVT <= 0E 0C 01 01 10 00 06 20 31 06 0A 00 BB 22 

Manufacturer: 0x000a
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1001 at substate 3
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 4, can send 1
[00:00:01.838] CMD => 14 0C 00 

[00:00:01.842] EVT <= 6E 00 

[00:00:01.861] EVT <= 0E FC 01 14 0C 00 43 53 52 38 35 31 30 20 41 31 30 0A 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 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 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 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 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 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 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 00 00 00 00 00 00 00 00 00 00 00 00 

[hci.c ][handle_command_complete_event()] local name: CSR8510 A10

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c14 at substate 5
Received local name, need baud change 0
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 8, can send 1
[00:00:01.993] CMD => 02 10 00 

[00:00:01.998] EVT <= 6E 00 

[00:00:02.007] EVT <= 0E 44 01 02 10 00 FF FF FF 03 80 FF FF FF 3F FF FF 1F F2 0F E8 FE 3F F7 8D FF 1C 00 00 00 7D F7 FF FF 7F 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 00 00 00 

Local supported commands summary 8f - 01
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1002 at substate 15
[00:00:02.052] LOG -- btstack_crypto.c.1110: controller supports ECDH operation: 0

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 22, can send 1
[00:00:02.070] CMD => 09 10 00 

[00:00:02.075] EVT <= 6E 00 

[00:00:02.078] EVT <= 0E 0A 01 09 10 00 10 71 DA 7D 1A 00 

Local Address, Status: 0x00: Addr: 00:1A:7D:DA:71:10
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1009 at substate 23
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 24, can send 1
[00:00:02.112] CMD => 05 10 00 

[00:00:02.116] EVT <= 6E 00 

[00:00:02.120] EVT <= 0E 0B 01 05 10 00 80 02 40 04 00 08 00 

[hci.c ][handle_command_complete_event()] hci_read_buffer_size: ACL size module 640 -> used 640, count 4 / SCO size 64, count 8
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1005 at substate 25
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 26, can send 1
[00:00:02.161] CMD => 03 10 00 

[00:00:02.166] EVT <= 6E 00 

[00:00:02.169] EVT <= 0E 0C 01 03 10 00 FF FF 8F FA 9B FF 59 87 

[hci.c ][hci_acl_packet_types_for_buffer_size_and_local_features() ] Features bit 26 is not set, removing packet types 0x2204
Packet types ee1c, eSCO 1
BR/EDR support 1, LE support 0
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 1003 at substate 27
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 28, can send 1
[00:00:02.215] CMD => 01 0C 08 FF FF FF FF FF FF FF 1F 

[00:00:02.223] EVT <= 6E 00 

[00:00:02.228] EVT <= 0E 04 01 01 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c01 at substate 29
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 30, can send 1
[00:00:02.254] CMD => 56 0C 01 01 

[00:00:02.259] EVT <= 0E 04 01 56 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c56 at substate 31
[00:00:02.275] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 32, can send 1
[00:00:02.289] CMD => 18 0C 02 00 60 

[00:00:02.294] EVT <= 6E 00 

[00:00:02.299] EVT <= 0E 04 01 18 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c18 at substate 33
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 34, can send 1
[00:00:02.325] CMD => 0F 08 02 00 00 

[00:00:02.330] EVT <= 6E 00 

[00:00:02.335] EVT <= 0E 04 01 0F 08 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 080f at substate 35
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 36, can send 1
[00:00:02.361] CMD => 24 0C 03 0C 02 7A 

[00:00:02.367] EVT <= 0E 04 01 24 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c24 at substate 37
[00:00:02.383] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 38, can send 1
[00:00:02.397] CMD => 13 0C 1E 50 48 4D 49 20 42 54 20 44 6F 6E 67 6C 65 20 30 30 3A 30 30 3A 30 30 3A 30 30 3A 30 30 3A 

[00:00:02.413] EVT <= 6E 00 

[00:00:02.418] EVT <= 0E 04 01 13 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c13 at substate 39
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 40, can send 1
[00:00:02.444] CMD => 52 0C 1F 00 1D 09 50 48 4D 49 20 42 54 20 44 6F 6E 67 6C 65 20 30 30 3A 30 30 3A 30 30 3A 30 30 3A 30 

[00:00:02.461] EVT <= 6E 00 

[00:00:02.464] EVT <= 0E 04 01 52 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c52 at substate 41
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 42, can send 1
[00:00:02.491] CMD => 45 0C 01 00 

[00:00:02.496] EVT <= 0E 04 01 45 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c45 at substate 43
[00:00:02.512] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 46, can send 1
[00:00:02.526] CMD => 1A 0C 01 03 

[00:00:02.531] EVT <= 6E 00 

[00:00:02.535] EVT <= 0E 04 01 1A 0C 00 

[hci.c] [hci_emit_discoverable_enabled()] BTSTACK_EVENT_DISCOVERABLE_ENABLED 1
[hci.c] [hci_emit_discoverable_enabled()] calling hci_emit_event() ...... 
[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c1a at substate 47
[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 48, can send 1
[00:00:02.575] CMD => 2F 0C 01 01 

[00:00:02.580] EVT <= 0E 04 01 2F 0C 00 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c2f at substate 49
[00:00:02.596] EVT <= 6E 00 

[hci.c] [hci_initializing_run()]
[hci.c] [hci_initializing_run()] hci_initializing_run: substate 50, can send 1
[00:00:02.610] CMD => 5B 0C 01 01 

[00:00:02.615] EVT <= 6E 00 

[00:00:02.619] EVT <= 0E 04 01 5B 0C 01 

[hci.c ][hci_initializing_event_handler_command_completed()]Command complete for expected opcode 0c5b at substate 51
[hci.c][hci_init_done()] hci_init_done -> HCI_STATE_WORKING
[hci.c][hci_init_done()] calling hci_emit_state()..... 
[hci.c][hci_emit_state()]BTSTACK_EVENT_STATE 2
HCI Working!
[00:00:02.652] CMD => 18 20 00 

hci_le_set_own_address_type: old 0, new 0
[hci.c][hci_init_done()] calling hci_run()..... 
[00:00:02.665] EVT <= 6E 00 

[00:00:02.670] EVT <= 0E 04 01 18 20 01 

[00:00:02.675] CMD => 18 20 00 

[00:00:02.680] EVT <= 0E 04 01 18 20 01 

write '534d4552', len 16 at 8
Generated ER key. Store in TLV status: 0
[00:00:02.692] LOG -- btstack_util.c.290: ER     56F18FFA9BFF598756F18FFA9BFF5987

[00:00:02.702] EVT <= 6E 00 

[00:00:02.706] CMD => 18 20 00 

[00:00:02.711] EVT <= 6E 00 

[00:00:02.714] EVT <= 0E 04 01 18 20 01 

[00:00:02.720] CMD => 18 20 00 

[00:00:02.725] EVT <= 6E 00 

[00:00:02.729] EVT <= 0E 04 01 18 20 01 

write '534d4952', len 16 at 32
Generated IR key. Store in TLV status: 0
[00:00:02.742] LOG -- btstack_util.c.290: IR     56F18FFA9BFF598756F18FFA9BFF5987

[00:00:02.750] CMD => 06 20 0F 30 00 30 00 00 00 00 00 00 00 00 00 00 07 00 

[00:00:02.761] EVT <= 6E 00 

[00:00:02.765] EVT <= 0E 04 01 06 20 01 

DKG_CALC_IRK started
[00:00:02.772] CMD => 17 20 20 87 59 FF 9B FA 8F F1 56 87 59 FF 9B FA 8F F1 56 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.789] EVT <= 6E 00 

[00:00:02.794] EVT <= 0E 04 01 17 20 01 

[00:00:02.799] LOG -- btstack_util.c.290: irk    FEE80FF21FFFE85B8759FF9BFA8FF266

[00:00:02.807] CMD => 08 20 20 13 02 01 06 0B 09 4C 45 20 43 6F 75 6E 74 65 72 03 02 10 FF 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.825] EVT <= 6E 00 

[00:00:02.828] EVT <= 0E 04 01 08 20 01 

DKG_CALC_DHK started
[00:00:02.836] CMD => 17 20 20 87 59 FF 9B FA 8F F1 56 87 59 FF 9B FA 8F F1 56 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

[00:00:02.853] EVT <= 0E 04 01 17 20 01 

[00:00:02.858] LOG -- btstack_util.c.290: dhk    FEE80FF21FFFE85B8759FF9BFA8FF266

[00:00:02.867] EVT <= 6E 00 

[00:00:02.871] CMD => 0A 20 01 01 

[00:00:02.876] EVT <= 0E 04 01 0A 20 01 

[00:00:02.881] EVT <= 6E 00 

[00:00:29.466] EVT <= 04 0A 7C DC A6 67 9C D8 0C 01 2A 01 

Connection_incoming: D8:9C:67:A6:DC:7C, type 1
create connection
create_connection_for_addr D8:9C:67:A6:DC:7C, type fd
sending hci_accept_connection_request
[00:00:29.488] CMD => 09 04 07 7C DC A6 67 9C D8 01 

[00:00:29.496] EVT <= 6E 00 

[00:00:29.500] EVT <= 0F 04 00 01 09 04 

[00:00:29.506] EVT <= 03 0B 00 30 00 7C DC A6 67 9C D8 01 00 

Connection_complete (status=0) D8:9C:67:A6:DC:7C
New connection: handle 48, D8:9C:67:A6:DC:7C
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:00:29.527] CMD => 1B 04 02 30 00 

[00:00:29.532] EVT <= 20 07 7C DC A6 67 9C D8 01 

[00:00:29.539] EVT <= 6E 00 

[00:00:29.543] EVT <= 0F 04 00 01 1B 04 

[00:00:29.549] EVT <= 0B 0B 00 30 00 FF FE 8F FE D8 3F 5B 87 

[00:00:29.557] CMD => 1C 04 03 30 00 01 

[00:00:29.563] EVT <= 0F 04 00 01 1C 04 

[00:00:29.569] EVT <= 6E 00 

[00:00:29.573] EVT <= 23 0D 00 30 00 01 01 0F 00 00 00 00 00 00 00 

Remote features 03, bonding flags f8
L2CAP_EVENT_TIMEOUT_CHECK
[00:00:39.522] CMD => 06 04 03 30 00 13 

[00:00:39.528] EVT <= 6E 00 

[00:00:39.532] EVT <= 0F 04 00 01 06 04 

[00:00:39.544] EVT <= 05 04 00 00 00 16 

[00:00:39.550] EVT <= 05 04 00 30 00 13 

Connection closed: handle 0x30, D8:9C:67:A6:DC:7C
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0
[00:00:39.565] EVT <= 05 04 00 00 00 16 

[00:00:40.861] EVT <= 04 0A 7C DC A6 67 9C D8 0C 01 2A 01 

Connection_incoming: D8:9C:67:A6:DC:7C, type 1
create connection
create_connection_for_addr D8:9C:67:A6:DC:7C, type fd
sending hci_accept_connection_request
[00:00:40.883] CMD => 09 04 07 7C DC A6 67 9C D8 01 

[00:00:40.890] EVT <= 6E 00 

[00:00:40.895] EVT <= 0F 04 00 01 09 04 

[00:00:40.901] EVT <= 03 0B 00 30 00 7C DC A6 67 9C D8 01 00 

Connection_complete (status=0) D8:9C:67:A6:DC:7C
New connection: handle 48, D8:9C:67:A6:DC:7C
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:00:40.921] CMD => 1B 04 02 30 00 

[00:00:40.927] EVT <= 20 07 7C DC A6 67 9C D8 01 

[00:00:40.933] EVT <= 6E 00 

[00:00:40.937] EVT <= 0F 04 00 01 1B 04 

[00:00:40.943] EVT <= 0B 0B 00 30 00 FF FE 8F FE D8 3F 5B 87 

[00:00:40.951] CMD => 1C 04 03 30 00 01 

[00:00:40.957] EVT <= 0F 04 00 01 1C 04 

[00:00:40.962] EVT <= 6E 00 

[00:00:40.967] EVT <= 23 0D 00 30 00 01 01 0F 00 00 00 00 00 00 00 

Remote features 03, bonding flags f8
[00:00:40.980] EVT <= 32 09 7C DC A6 67 9C D8 01 00 05 

[00:00:40.988] EVT <= 31 06 7C DC A6 67 9C D8 

IO Capability Request received, stack bondable 1, io cap 1
Sending Cap reply
gap_mitm_protection_required_for_security_level 0
[00:00:41.005] CMD => 2B 04 09 7C DC A6 67 9C D8 01 00 04 

[00:00:41.014] EVT <= 6E 00 

[00:00:41.457] EVT <= 0E 0A 01 2B 04 00 7C DC A6 67 9C D8 

[00:00:42.017] EVT <= 33 0A 7C DC A6 67 9C D8 39 04 0E 00 

[00:00:42.024] CMD => 2C 04 06 7C DC A6 67 9C D8 

[00:00:42.031] EVT <= 6E 00 

[00:00:42.035] EVT <= 0E 0A 01 2C 04 00 7C DC A6 67 9C D8 

[00:00:45.266] EVT <= 36 07 00 7C DC A6 67 9C D8 

[00:00:45.318] EVT <= 06 03 00 30 00 

[00:00:45.360] EVT <= 08 04 00 30 00 01 

Encryption state change: 1, key size 0
event handler, state 0
[00:00:45.371] CMD => 08 14 02 30 00 

[00:00:47.373] EVT <= 6E 00 

[00:00:47.376] EVT <= 0E 07 01 08 14 00 30 00 10 

Handle 0030 key Size: 16
[00:00:47.385] CMD => 11 04 02 30 00 

[00:00:47.391] EVT <= 6E 00 

[00:00:47.396] EVT <= 0F 04 00 01 11 04 

[00:00:47.402] EVT <= 17 06 7C DC A6 67 9C D8 

HCI_EVENT_LINK_KEY_REQUEST
responding to link key request, have link key db: 1
[00:00:47.442] CMD => 0C 04 06 7C DC A6 67 9C D8 

[00:00:47.449] EVT <= 0E 0A 01 0C 04 00 7C DC A6 67 9C D8 

[00:00:47.456] EVT <= 6E 00 

[00:00:47.461] EVT <= 31 06 7C DC A6 67 9C D8 

IO Capability Request received, stack bondable 1, io cap 1
Sending Cap reply
gap_mitm_protection_required_for_security_level 0
[00:00:47.478] CMD => 2B 04 09 7C DC A6 67 9C D8 01 00 04 

[00:00:47.487] EVT <= 6E 00 

[00:00:47.936] EVT <= 0E 0A 01 2B 04 00 7C DC A6 67 9C D8 

[00:00:47.944] EVT <= 32 09 7C DC A6 67 9C D8 01 00 05 

[00:00:48.747] EVT <= 33 0A 7C DC A6 67 9C D8 49 5F 02 00 

[00:00:48.754] CMD => 2C 04 06 7C DC A6 67 9C D8 

[00:00:48.762] EVT <= 33 0A 7C DC A6 67 9C D8 B2 19 0F 00 

[00:00:48.770] EVT <= 6E 00 

[00:00:48.774] EVT <= 0E 0A 01 2C 04 00 7C DC A6 67 9C D8 

[00:00:48.781] CMD => 2C 04 06 7C DC A6 67 9C D8 

[00:00:48.789] EVT <= 6E 00 

[00:00:48.792] EVT <= 0E 0A 01 2C 04 00 7C DC A6 67 9C D8 

[00:01:00.414] EVT <= 38 04 30 00 FF FF 

Matthias Ringwald

unread,
Jul 29, 2021, 7:06:14 AM7/29/21
to btsta...@googlegroups.com
Hi Toshiharu

In the log, it looks like the pairing was in all cases successful.

Interestingly, you get an error for all LE related commands, which is weird. I don't get them with my CSR8510 modules (they just work).

Anyway, it looks like you are on an older version of the stack. Please update your code at least to the current master version and repeat your tests and let us know.

Best
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/e293ea11-83f7-4c10-b8dc-0cc1d987e3b1n%40googlegroups.com.

Maheshwari R

unread,
Aug 1, 2021, 2:05:29 AM8/1/21
to btstack-dev
Hi Mathias,

I have updated the code with the latest code in the git and tried the example (sm_pairing_central.c) code and am able to pair with the android but it took 2 mins to list the paired devices in the android. Please find the log in the below 

Log 
============

USB Device Connected                                                                                     
USB Device Reset Completed                                                                               
PID: 1h                                                                                                  
VID: a12h                                                                                                
Address (#1) assigned.                                                                                   
Manufacturer : N/A                                                                                       
Product : CSR8510 A10                                                                                    
Serial Number : N/A                                                                                      
Enumeration done.                                                                                        
This device has only 1 configuration.                                                                    
Default configuration set.                                                                               
Bluetooth class started.

RFCOMM_REGISTER_SERVICE channel #1 mtu 65535 flow_control 0 credits 10
SDP service record size: 95

hci_power_control: 1, current mode 0
BTSTACK_EVENT_STATE 1
[00:00:01.626] 
EVT <= 60 01 01 

hci_initializing_run: substate 0, can send 1
[00:00:01.634] 
CMD => 03 0C 00 

[00:00:01.639] 
EVT <= 6E 00 

[00:00:01.644] 
EVT <= 0E 04 01 03 0C 00 

Command complete for expected opcode 0c03 at substate 1
hci_initializing_run: substate 2, can send 1
[00:00:01.658] 
CMD => 01 10 00 

[00:00:01.663] 
EVT <= 6E 00 

[00:00:01.668] 
EVT <= 0E 0C 01 01 10 00 06 20 31 06 0A 00 BB 22 

Manufacturer: 0x000a
Command complete for expected opcode 1001 at substate 3
hci_initializing_run: substate 4, can send 1
[00:00:01.687] 
CMD => 14 0C 00 

[00:00:01.692] 
EVT <= 6E 00 

[00:00:01.712] 
EVT <= 0E FC 01 14 0C 00 43 53 52 38 35 31 30 20 41 31 30 0A 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 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 00 00 00 00 00 00 00 00 00 00 0
0 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 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 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 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 00 00 00 00 00 00 00 00 00 00 00 00 00 0
0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

local name: CSR8510 A10

Command complete for expected opcode 0c14 at substate 5
Received local name, need baud change 0
hci_initializing_run: substate 8, can send 1
[00:00:01.828] 
CMD => 02 10 00 

[00:00:01.833] 
EVT <= 6E 00 

[00:00:01.840] 
EVT <= 0E 44 01 02 10 00 FF FF FF 03 80 FF FF FF 3F FF FF 1F F2 0F E8 FE 3F F7 8D FF 1C 00 00 00 7D F7 FF FF 7F 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 00 00 00 

Local supported commands summary 8f - 01
Command complete for expected opcode 1002 at substate 15
hci_initializing_run: substate 22, can send 1
[00:00:01.883] 
CMD => 09 10 00 

[00:00:01.888] 
EVT <= 0E 0A 01 09 10 00 10 71 DA 7D 1A 00 

Local Address, Status: 0x00: Addr: 00:1A:7D:DA:71:10
Command complete for expected opcode 1009 at substate 23
[00:00:01.906] 
EVT <= 6E 00 

hci_initializing_run: substate 24, can send 1
[00:00:01.914] 
CMD => 05 10 00 

[00:00:01.919] 
EVT <= 0E 0B 01 05 10 00 80 02 40 04 00 08 00 

hci_read_buffer_size: ACL size module 640 -> used 640, count 4 / SCO size 64, count 8
Command complete for expected opcode 1005 at substate 25
[00:00:01.940] 
EVT <= 6E 00 

hci_initializing_run: substate 26, can send 1
[00:00:01.948] 
CMD => 03 10 00 

[00:00:01.953] 
EVT <= 6E 00 

[00:00:01.958] 
EVT <= 0E 0C 01 03 10 00 FF FF 8F FA 9B FF 59 87 

Features bit 26 is not set, removing packet types 0x2204
Packet types ee1c, eSCO 1
BR/EDR support 1, LE support 0
Command complete for expected opcode 1003 at substate 27
hci_initializing_run: substate 28, can send 1
[00:00:01.986] 
CMD => 01 0C 08 FF FF FF FF FF FF FF 1F 

[00:00:01.994] 
EVT <= 6E 00 

[00:00:01.999] 
EVT <= 0E 04 01 01 0C 00 

Command complete for expected opcode 0c01 at substate 29
hci_initializing_run: substate 30, can send 1
[00:00:02.014] 
CMD => 56 0C 01 01 

[00:00:02.019] 
EVT <= 6E 00 

[00:00:02.023] 
EVT <= 0E 04 01 56 0C 00 

Command complete for expected opcode 0c56 at substate 31
hci_initializing_run: substate 32, can send 1
[00:00:02.037] 
CMD => 18 0C 02 00 60 

[00:00:02.043] 
EVT <= 6E 00 

[00:00:02.048] 
EVT <= 0E 04 01 18 0C 00 

Command complete for expected opcode 0c18 at substate 33
hci_initializing_run: substate 34, can send 1
[00:00:02.063] 
CMD => 0F 08 02 00 00 

[00:00:02.068] 
EVT <= 6E 00 

[00:00:02.073] 
EVT <= 0E 04 01 0F 08 00 

Command complete for expected opcode 080f at substate 35
hci_initializing_run: substate 36, can send 1
[00:00:02.088] 
CMD => 24 0C 03 0C 02 7A 

[00:00:02.094] 
EVT <= 6E 00 

[00:00:02.097] 
EVT <= 0E 04 01 24 0C 00 

Command complete for expected opcode 0c24 at substate 37
hci_initializing_run: substate 38, can send 1
[00:00:02.112] 
CMD => 13 0C 1E 53 50 50 20 43 6F 75 6E 74 65 72 20 30 30 3A 31 41 3A 37 44 3A 44 41 3A 37 31 3A 31 30 00 

[00:00:02.129] 
EVT <= 0E 04 01 13 0C 00 

Command complete for expected opcode 0c13 at substate 39
[00:00:02.139] 
EVT <= 6E 00 

hci_initializing_run: substate 40, can send 1
[00:00:02.147] 
CMD => 52 0C 1F 00 1D 09 53 50 50 20 43 6F 75 6E 74 65 72 20 30 30 3A 30 30 3A 30 30 3A 30 30 3A 30 30 3A 30 

[00:00:02.164] 
EVT <= 6E 00 

[00:00:02.169] 
EVT <= 0E 04 01 52 0C 00 

Command complete for expected opcode 0c52 at substate 41
hci_initializing_run: substate 42, can send 1
[00:00:02.184] 
CMD => 45 0C 01 00 

[00:00:02.189] 
EVT <= 6E 00 

[00:00:02.193] 
EVT <= 0E 04 01 45 0C 00 

Command complete for expected opcode 0c45 at substate 43
hci_initializing_run: substate 46, can send 1
[00:00:02.207] 
CMD => 1A 0C 01 03 

[00:00:02.213] 
EVT <= 6E 00 

[00:00:02.218] 
EVT <= 0E 04 01 1A 0C 00 

BTSTACK_EVENT_DISCOVERABLE_ENABLED 1
[00:00:02.226] 
EVT <= 66 01 01 

Command complete for expected opcode 0c1a at substate 47
hci_initializing_run: substate 48, can send 1
[00:00:02.240] 
CMD => 2F 0C 01 01 

[00:00:02.245] 
EVT <= 6E 00 

[00:00:02.250] 
EVT <= 0E 04 01 2F 0C 00 

Command complete for expected opcode 0c2f at substate 49
hci_initializing_run: substate 50, can send 1
[00:00:02.265] 
CMD => 5B 0C 01 01 

[00:00:02.270] 
EVT <= 6E 00 

[00:00:02.274] 
EVT <= 0E 04 01 5B 0C 01 

Command complete for expected opcode 0c5b at substate 51
hci_init_done -> HCI_STATE_WORKING
BTSTACK_EVENT_STATE 2
[00:00:02.289] 
EVT <= 60 01 02 

BTstack up and running on 00:1A:7D:DA:71:10.

[00:00:15.120] 
EVT <= 05 04 00 00 00 16 

[00:00:15.126] 
EVT <= 03 0B 13 00 00 58 88 53 AB FD 2C 01 00 

Connection_complete (status=19) 2C:FD:AB:53:88:58
[00:00:16.459] 
EVT <= 04 0A 58 88 53 AB FD 2C 0C 02 5A 01 

Connection_incoming: 2C:FD:AB:53:88:58, type 1
create_connection_for_addr 2C:FD:AB:53:88:58, type fd
sending hci_accept_connection_request
[00:00:16.481] 
CMD => 09 04 07 58 88 53 AB FD 2C 01 

[00:00:16.489] 
EVT <= 6E 00 

[00:00:16.493] 
EVT <= 0F 04 00 01 09 04 

[00:00:16.499] 
EVT <= 03 0B 00 30 00 58 88 53 AB FD 2C 01 00 

Connection_complete (status=0) 2C:FD:AB:53:88:58
New connection: handle 48, 2C:FD:AB:53:88:58
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:00:16.519] 
EVT <= 61 01 01 

[00:00:16.523] 
CMD => 1B 04 02 30 00 

[00:00:18.533] 
EVT <= 6E 00 

[00:00:18.537] 
EVT <= 38 04 30 00 40 1F 

[00:00:18.543] 
EVT <= 32 09 58 88 53 AB FD 2C 01 00 03 

pairing started, ssp 1, initiator 0, requested level 2
[00:00:18.555] 
EVT <= DF 0A 58 88 53 AB FD 2C 30 00 01 00 

[00:00:18.563] 
EVT <= 31 06 58 88 53 AB FD 2C 

[00:00:18.570] 
EVT <= 0F 04 00 01 1B 04 

gap_mitm_protection_required_for_security_level 2
[00:00:18.580] 
CMD => 2B 04 09 58 88 53 AB FD 2C 01 00 04 

[00:00:18.588] 
EVT <= 0B 0B 00 30 00 BF 3E 8D FE DB FF 5B 87 

[00:00:18.596] 
EVT <= 6E 00 

[00:00:19.048] 
EVT <= 0E 0A 01 2B 04 00 58 88 53 AB FD 2C 

[00:00:19.056] 
CMD => 1C 04 03 30 00 01 

[00:00:19.062] 
EVT <= 6E 00 

[00:00:19.066] 
EVT <= 0F 04 00 01 1C 04 

[00:00:19.072] 
EVT <= 23 0D 00 30 00 01 01 07 00 00 00 00 00 00 00 

Remote features 03, bonding flags 38
[00:00:19.592] 
EVT <= 33 0A 58 88 53 AB FD 2C C7 FD 01 00 

SSP User Confirmation Request with numeric value '130503'

SSP User Confirmation Auto accept

[00:00:19.608] 
CMD => 2C 04 06 58 88 53 AB FD 2C 

[00:00:19.616] 
EVT <= 6E 00 

[00:00:19.620] 
EVT <= 0E 0A 01 2C 04 00 58 88 53 AB FD 2C 

[00:00:20.900] 
EVT <= 36 07 00 58 88 53 AB FD 2C 

pairing complete, status 00
[00:00:20.909] 
EVT <= E0 09 58 88 53 AB FD 2C 30 00 00 20 

[00:00:20.917] 
EVT <= 06 03 00 30 00 

[00:00:20.922] 
CMD => 13 04 03 30 00 01 

[00:00:20.928] 
EVT <= 6E 00 

[00:00:20.932] 
EVT <= 0F 04 00 01 13 04 

Query 1:

How to resolve the errors in the LE related commands .In the git initiate the CSR chipset via UART , how to initiate the chipset via USB ?

Query 2:

After the successful pairing with the android . I have to connect the android with CSR8510 A10 and share the file from android to  CSR8510 A10 
can you  please guide me for the same 

With Best Regards,

Maheshwari  R

Matthias Ringwald

unread,
Aug 2, 2021, 2:39:47 AM8/2/21
to btsta...@googlegroups.com
Hi Maheshwari

Pairing: looks good. Your log stops at 20 seconds. I don't know what's going on your Android device after that.

LE errors: Please try the dongle with Mac or Linux (port/llibusb) and compare. If the error persists, the dongle is buggy.

Data transfer: on Android, Classic SPP is easy to use, see our 'SPP Counter/Streamer' examples. As SPP is not possible on iOS, you also use GATT. See GATT Counter / Streamer on how to transfer data. You will need an app on Android, btw.
(BTstack does not implement OBEX Push, which could be used to transfer files, but it's a poor user experience anyway) Another option can be to run a web server on your device and then provide a web app, see 'pan lwip http demo'

best
matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/3cd5e297-f6ba-4342-ab82-de6c559563b9n%40googlegroups.com.

Maheshwari R

unread,
Aug 10, 2021, 1:27:06 AM8/10/21
to btstack-dev
Hi Matthias 

Thanks for the reply . As discussed I have port the libusb  in linux and try the both Classic and LE example but in my dongle LE part it's not working and then i have tried with spp_counter and i have successfully paired with my phone and connect using Andriod app(Serial Bluetooth Terminal) in that i can see the data from the Bt dongle and tried to sent the from app to Btdongle it was working fine .After that I have tried the spp couter example in my stm32f769i board with the (CSR8510 A10) USB Dongle,  in that i am able to pair with laptop and mobile first time only once it paired with one device ,code has strucking in a loop,after that i couldn't pair with any device and also after paired with my phone and try to connect using Andriod app(Serial Bluetooth Terminal)in that it showing connection failed,read failed,socket might be closed or timeout read ret -1 .Here i have attached the log .please give your suggestion to resolve the issue .

==================
SPP_Counter.c

Log == Pairing from Mobile phone to Bt dongle

USB Device Connected
USB Device Reset Completed
PID: 1h
VID: a12h
Address (#1) assigned.
Manufacturer : N/A
Product : CSR8510 A10
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Bluetooth class started.
BTstack on STM32 F4 Discovery with USB support starting...

SDP service record size: 91

hci_power_control: 1, current mode 0
BTSTACK_EVENT_STATE 1[00:00:01.624] EVT <= 60 01 01 


spp_counter.c----60
l2cap.c----60[00:00:01.631] CMD => 03 0C 00 

[00:00:01.636] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.644] EVT <= 0E 04 01 03 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:01.652] CMD => 01 10 00 

[00:00:01.657] EVT <= 0E 0C 01 01 10 00 06 20 31 06 0A 00 BB 22 


Manufacturer: 0x000a
spp_counter.c----e
l2cap.c----e[00:00:01.670] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.677] CMD => 14 0C 00 

[00:00:01.682] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.704] EVT <= 0E FC 01 14 0C 00 43 53 52 38 35 31 30 20 41 31 30 0A 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 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 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 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 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 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 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 00 00 00 00 00 00 00 00 00 00 00 00 


local name: CSR8510 A10

Received local name, need baud change 0
spp_counter.c----e
l2cap.c----e[00:00:01.814] CMD => 02 10 00 

[00:00:01.819] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.830] EVT <= 0E 44 01 02 10 00 FF FF FF 03 80 FF FF FF 3F FF FF 1F F2 0F E8 FE 3F F7 8D FF 1C 00 00 00 7D F7 FF FF 7F 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 00 00 00 


Local supported commands summary 8f - 01
spp_counter.c----e
l2cap.c----e[00:00:01.867] CMD => 09 10 00 

[00:00:01.871] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.878] EVT <= 0E 0A 01 09 10 00 10 71 DA 7D 1A 00 


Local Address, Status: 0x00: Addr: 00:1A:7D:DA:71:10
spp_counter.c----e
l2cap.c----e[00:00:01.894] CMD => 05 10 00 

[00:00:01.899] EVT <= 0E 0B 01 05 10 00 80 02 40 04 00 08 00 


hci_read_buffer_size: ACL size module 640 -> used 640, count 4 / SCO size 64, count 8
spp_counter.c----e
l2cap.c----e[00:00:01.918] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.925] CMD => 03 10 00 

[00:00:01.930] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.937] EVT <= 0E 0C 01 03 10 00 FF FF 8F FA 9B FF 59 87 


Features bit 26 is not set, removing packet types 0x2204
Packet types ee1c, eSCO 1
BR/EDR support 1, LE support 0
spp_counter.c----e
l2cap.c----e[00:00:01.959] CMD => 01 0C 08 FF FF FF FF FF FF FF 1F 

[00:00:01.967] EVT <= 0E 04 01 01 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:01.975] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.982] CMD => 56 0C 01 01 

[00:00:01.987] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:01.995] EVT <= 0E 04 01 56 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:02.003] CMD => 18 0C 02 00 60 

[00:00:02.009] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.015] EVT <= 0E 04 01 18 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:02.024] CMD => 0F 08 02 00 00 

[00:00:02.029] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.037] EVT <= 0E 04 01 0F 08 00 


spp_counter.c----e
l2cap.c----e[00:00:02.045] CMD => 24 0C 03 0C 02 7A 

[00:00:02.051] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.059] EVT <= 0E 04 01 24 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:02.067] CMD => 13 0C 1E 42 54 73 74 61 63 6B 20 30 30 3A 31 41 3A 37 44 3A 44 41 3A 37 31 3A 31 30 00 00 00 00 00 

[00:00:02.083] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.090] EVT <= 0E 04 01 13 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:02.099] CMD => 52 0C 1F 00 1A 09 42 54 73 74 61 63 6B 20 30 30 3A 31 41 3A 37 44 3A 44 41 3A 37 31 3A 31 30 00 00 00 

[00:00:02.116] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.123] EVT <= 0E 04 01 52 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:02.131] CMD => 45 0C 01 00 

[00:00:02.136] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.144] EVT <= 0E 04 01 45 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:02.152] CMD => 1A 0C 01 03 

[00:00:02.157] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.165] EVT <= 0E 04 01 1A 0C 00 


BTSTACK_EVENT_DISCOVERABLE_ENABLED 1[00:00:02.173] EVT <= 66 01 01 


spp_counter.c----66
l2cap.c----66
spp_counter.c----e
l2cap.c----e[00:00:02.183] CMD => 2F 0C 01 01 

[00:00:02.189] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.196] EVT <= 0E 04 01 2F 0C 00 


spp_counter.c----e
l2cap.c----e[00:00:02.204] CMD => 5B 0C 01 01 

[00:00:02.209] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:00:02.217] EVT <= 0E 04 01 5B 0C 01 


hci_init_done -> HCI_STATE_WORKING
BTSTACK_EVENT_STATE 2[00:00:02.227] EVT <= 60 01 02 


BTstack up and running on 00:1A:7D:DA:71:10.

spp_counter.c----60
l2cap.c----60
spp_counter.c----e
l2cap.c----e[00:02:34.534] EVT <= 05 04 00 00 00 16 


spp_counter.c----5
l2cap.c----5[00:02:34.543] EVT <= 03 0B 13 00 00 D4 5F C2 67 B1 04 01 00 


Connection_complete (status=19) 04:B1:67:C2:5F:D4
spp_counter.c----3
l2cap.c----3[00:02:35.825] EVT <= 04 0A D4 5F C2 67 B1 04 0C 02 5A 01 


Connection_incoming: 04:B1:67:C2:5F:D4, type 1
create_connection_for_addr 04:B1:67:C2:5F:D4, type fd
sending hci_accept_connection_request[00:02:35.845] CMD => 09 04 07 D4 5F C2 67 B1 04 01 


spp_counter.c----4
l2cap.c----4[00:02:35.856] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:02:35.864] EVT <= 0F 04 00 01 09 04 


spp_counter.c----f
l2cap.c----f[00:02:35.873] EVT <= 03 0B 00 30 00 D4 5F C2 67 B1 04 01 00 


Connection_complete (status=0) 04:B1:67:C2:5F:D4
New connection: handle 48, 04:B1:67:C2:5F:D4
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1[00:02:35.893] EVT <= 61 01 01 


spp_counter.c----61
l2cap.c----61
spp_counter.c----3
l2cap.c----3[00:02:35.903] CMD => 1B 04 02 30 00 

[00:02:35.909] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:02:35.916] EVT <= 20 07 D4 5F C2 67 B1 04 01 


spp_counter.c----20
l2cap.c----20[00:02:35.927] EVT <= 0F 04 00 01 1B 04 


spp_counter.c----f
l2cap.c----f[00:02:35.936] EVT <= 0B 0B 00 30 00 FF FE 8F FE D8 3F 5B 87 


spp_counter.c----b
l2cap.c----b[00:02:35.947] CMD => 1C 04 03 30 00 01 

[00:02:37.940] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:02:37.947] EVT <= 38 04 30 00 40 1F 


spp_counter.c----38
l2cap.c----38[00:02:37.956] EVT <= 0F 04 00 01 1C 04 


spp_counter.c----f
l2cap.c----f[00:02:37.965] EVT <= 23 0D 00 30 00 01 01 0F 00 00 00 00 00 00 00 


Remote features 03, bonding flags f8
spp_counter.c----23
l2cap.c----23[00:02:37.981] EVT <= 32 09 D4 5F C2 67 B1 04 01 00 03 


pairing started, ssp 1, initiator 0, requested level 2[00:02:37.993] EVT <= DF 0A D4 5F C2 67 B1 04 30 00 01 00 


spp_counter.c----df
l2cap.c----df
spp_counter.c----32
l2cap.c----32[00:02:38.008] EVT <= 31 06 D4 5F C2 67 B1 04 


spp_counter.c----31
l2cap.c----31
gap_mitm_protection_required_for_security_level 2[00:02:38.022] CMD => 2B 04 09 D4 5F C2 67 B1 04 03 00 04 

[00:02:38.030] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:02:38.491] EVT <= 0E 0A 01 2B 04 00 D4 5F C2 67 B1 04 


spp_counter.c----e
l2cap.c----e[00:02:39.012] EVT <= 33 0A D4 5F C2 67 B1 04 A2 4D 05 00 


spp_counter.c----33
SSP User Confirmation Request with numeric value '347554'

SSP User Confirmation Auto accept

l2cap.c----33[00:02:39.031] CMD => 2C 04 06 D4 5F C2 67 B1 04 

[00:02:39.039] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:02:39.046] EVT <= 0E 0A 01 2C 04 00 D4 5F C2 67 B1 04 


spp_counter.c----e
l2cap.c----e[00:02:39.090] EVT <= 36 07 00 D4 5F C2 67 B1 04 


pairing complete, status 00[00:02:39.099] EVT <= E0 09 D4 5F C2 67 B1 04 30 00 00 20 


spp_counter.c----e0
l2cap.c----e0
spp_counter.c----36
l2cap.c----36[00:02:39.156] EVT <= 06 03 00 30 00 


spp_counter.c----6
l2cap.c----6[00:02:39.164] CMD => 13 04 03 30 00 01 

[00:02:39.170] EVT <= 6E 00 


spp_counter.c----6e
l2cap.c----6e[00:02:39.177] EVT <= 0F 04 00 01 13 04 


spp_counter.c----f
l2cap.c----f

Matthias Ringwald

unread,
Aug 10, 2021, 4:00:30 AM8/10/21
to btsta...@googlegroups.com
Hi Maheshwari

Did you try another USB Bluetooth dongle? Please do that for comparison.

The log below isn't clean. Please remove unneeded output, the HCI Packets + the log messages from the stack are sufficient, and convert it to .pklg using tool/create_packet_log.py, so we can look at it in Wireshark

Best
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/bc64a47f-0a9c-45df-95c4-b4de7acd007cn%40googlegroups.com.

Maheshwari R

unread,
Aug 10, 2021, 7:36:55 AM8/10/21
to btstack-dev
Hi Mathias,

Thanks for the reply. I have only one USB Dongle (CSR8510 A10) here for the validation.
I have generated the pklg file from the below log, but I am not able to attach the .pklg file.

Mobile Phone to BT Dongle
=========================
USB Device Connected
USB Device Reset Completed
PID: 1h
VID: a12h
Address (#1) assigned.
Manufacturer : N/A
Product : CSR8510 A10
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Bluetooth class started.
BTstack on STM32 F4 Discovery with USB support starting...

SDP service record size: 91

hci_power_control: 1, current mode 0
BTSTACK_EVENT_STATE 1[00:00:01.623] EVT <= 60 01 01 

[00:00:01.627] CMD => 03 0C 00 

[00:00:01.632] EVT <= 6E 00 

[00:00:01.637] EVT <= 0E 04 01 03 0C 00 

[00:00:01.642] CMD => 01 10 00 

[00:00:01.647] EVT <= 6E 00 

[00:00:01.650] EVT <= 0E 0C 01 01 10 00 06 20 31 06 0A 00 BB 22 


Manufacturer: 0x000a[00:00:01.661] CMD => 14 0C 00 

[00:00:01.665] EVT <= 6E 00 

[00:00:01.685] EVT <= 0E FC 01 14 0C 00 43 53 52 38 35 31 30 20 41 31 30 0A 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 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 00 00 00 00 00 0
0 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 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 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 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 00 00 00 00 00 00 00 00 00 00 00 00 00 0
0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 


local name: CSR8510 A10

Received local name, need baud change 0[00:00:01.792] CMD => 02 10 00 

[00:00:01.797] EVT <= 6E 00 

[00:00:01.804] EVT <= 0E 44 01 02 10 00 FF FF FF 03 80 FF FF FF 3F FF FF 1F F2 0F E8 FE 3F F7 8D FF 1C 00 00 00 7D F7 FF FF 7F 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 00 00 00 


Local supported commands summary 8f - 01[00:00:01.838] CMD => 09 10 00 

[00:00:01.842] EVT <= 6E 00 

[00:00:01.847] EVT <= 0E 0A 01 09 10 00 10 71 DA 7D 1A 00 


Local Address, Status: 0x00: Addr: 00:1A:7D:DA:71:10[00:00:01.859] CMD => 05 10 00 

[00:00:01.864] EVT <= 0E 0B 01 05 10 00 80 02 40 04 00 08 00 


hci_read_buffer_size: ACL size module 640 -> used 640, count 4 / SCO size 64, count 8[00:00:01.880] EVT <= 6E 00 

[00:00:01.884] CMD => 03 10 00 

[00:00:01.888] EVT <= 6E 00 

[00:00:01.892] EVT <= 0E 0C 01 03 10 00 FF FF 8F FA 9B FF 59 87 


Features bit 26 is not set, removing packet types 0x2204
Packet types ee1c, eSCO 1
BR/EDR support 1, LE support 0[00:00:01.911] CMD => 01 0C 08 FF FF FF FF FF FF FF 1F 

[00:00:01.919] EVT <= 6E 00 

[00:00:01.924] EVT <= 0E 04 01 01 0C 00 

[00:00:01.929] CMD => 56 0C 01 01 

[00:00:01.934] EVT <= 6E 00 

[00:00:01.939] EVT <= 0E 04 01 56 0C 00 

[00:00:01.944] CMD => 18 0C 02 00 60 

[00:00:01.949] EVT <= 6E 00 

[00:00:01.954] EVT <= 0E 04 01 18 0C 00 

[00:00:01.959] CMD => 0F 08 02 00 00 

[00:00:01.964] EVT <= 6E 00 

[00:00:01.969] EVT <= 0E 04 01 0F 08 00 

[00:00:01.974] CMD => 24 0C 03 0C 02 7A 

[00:00:01.980] EVT <= 6E 00 

[00:00:01.983] EVT <= 0E 04 01 24 0C 00 

[00:00:01.989] CMD => 13 0C 1E 42 54 73 74 61 63 6B 20 30 30 3A 31 41 3A 37 44 3A 44 41 3A 37 31 3A 31 30 00 00 00 00 00 

[00:00:02.005] EVT <= 6E 00 

[00:00:02.010] EVT <= 0E 04 01 13 0C 00 

[00:00:02.015] CMD => 52 0C 1F 00 1A 09 42 54 73 74 61 63 6B 20 30 30 3A 31 41 3A 37 44 3A 44 41 3A 37 31 3A 31 30 00 00 00 

[00:00:02.032] EVT <= 6E 00 

[00:00:02.035] EVT <= 0E 04 01 52 0C 00 

[00:00:02.041] CMD => 45 0C 01 00 

[00:00:02.046] EVT <= 6E 00 

[00:00:02.049] EVT <= 0E 04 01 45 0C 00 

[00:00:02.055] CMD => 1A 0C 01 03 

[00:00:02.060] EVT <= 6E 00 

[00:00:02.064] EVT <= 0E 04 01 1A 0C 00 


BTSTACK_EVENT_DISCOVERABLE_ENABLED 1[00:00:02.072] EVT <= 66 01 01 

[00:00:02.076] CMD => 2F 0C 01 01 

[00:00:02.081] EVT <= 6E 00 

[00:00:02.086] EVT <= 0E 04 01 2F 0C 00 

[00:00:02.091] CMD => 5B 0C 01 01 

[00:00:02.096] EVT <= 6E 00 

[00:00:02.101] EVT <= 0E 04 01 5B 0C 01 


hci_init_done -> HCI_STATE_WORKING
BTSTACK_EVENT_STATE 2[00:00:02.111] EVT <= 60 01 02 


BTstack up and running on 00:1A:7D:DA:71:10.
[00:00:39.267] EVT <= 05 04 00 00 00 16 

[00:00:39.273] EVT <= 03 0B 13 00 00 58 88 53 AB FD 2C 01 00 


Connection_complete (status=19) 2C:FD:AB:53:88:58[00:00:40.585] EVT <= 04 0A 58 88 53 AB FD 2C 0C 02 5A 01 


Connection_incoming: 2C:FD:AB:53:88:58, type 1
create_connection_for_addr 2C:FD:AB:53:88:58, type fd
sending hci_accept_connection_request[00:00:40.605] CMD => 09 04 07 58 88 53 AB FD 2C 01 

[00:00:40.613] EVT <= 6E 00 

[00:00:40.617] EVT <= 0F 04 00 01 09 04 

[00:00:40.623] EVT <= 03 0B 00 30 00 58 88 53 AB FD 2C 01 00 


Connection_complete (status=0) 2C:FD:AB:53:88:58
New connection: handle 48, 2C:FD:AB:53:88:58
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1[00:00:40.643] EVT <= 61 01 01 

[00:00:40.647] CMD => 1B 04 02 30 00 

[00:00:40.652] EVT <= 20 07 58 88 53 AB FD 2C 01 

[00:00:42.655] EVT <= 6E 00 

[00:00:42.659] EVT <= 38 04 30 00 40 1F 

[00:00:42.665] EVT <= 0F 04 00 01 1B 04 

[00:00:42.671] EVT <= 0B 0B 00 30 00 BF 3E 8D FE DB FF 5B 87 

[00:00:42.678] CMD => 1C 04 03 30 00 01 

[00:00:42.685] EVT <= 32 09 58 88 53 AB FD 2C 01 00 03 


pairing started, ssp 1, initiator 0, requested level 2[00:00:42.697] EVT <= DF 0A 58 88 53 AB FD 2C 30 00 01 00 

[00:00:42.705] EVT <= 6E 00 

[00:00:42.709] EVT <= 31 06 58 88 53 AB FD 2C 

[00:00:42.716] EVT <= 0F 04 00 01 1C 04 


gap_mitm_protection_required_for_security_level 2[00:00:42.725] CMD => 2B 04 09 58 88 53 AB FD 2C 01 00 04 

[00:00:42.734] EVT <= 23 0D 00 30 00 01 01 07 00 00 00 00 00 00 00 


Remote features 03, bonding flags 38[00:00:42.746] EVT <= 6E 00 

[00:00:43.198] EVT <= 0E 0A 01 2B 04 00 58 88 53 AB FD 2C 

[00:00:43.740] EVT <= 33 0A 58 88 53 AB FD 2C B1 8B 0A 00 


SSP User Confirmation Request with numeric value '691121'

SSP User Confirmation Auto accept
[00:00:43.756] CMD => 2C 04 06 58 88 53 AB FD 2C 

[00:00:43.763] EVT <= 6E 00 

[00:00:43.766] EVT <= 0E 0A 01 2C 04 00 58 88 53 AB FD 2C 

[00:00:45.779] EVT <= 36 07 00 58 88 53 AB FD 2C 


pairing complete, status 00[00:00:45.787] EVT <= E0 09 58 88 53 AB FD 2C 30 00 00 20 

[00:00:45.796] EVT <= 06 03 00 30 00 

[00:00:45.800] CMD => 13 04 03 30 00 01 

[00:00:45.806] EVT <= 6E 00 

[00:00:45.811] EVT <= 0F 04 00 01 13 04 

Matthias Ringwald

unread,
Aug 10, 2021, 1:25:22 PM8/10/21
to btsta...@googlegroups.com
Hi Maheshwari

In the text output below, the log_info messages miss a newline, which causes the HCI dump packets to not start with
[00:..

I assume you've modified the macro for log_info to use printf of similar but forgot to add a newline. Please remove your changes there and use the original code. The output will then be clean and can be converted to .pklg.
(the script will fail to convert these lines and just keep them as text in the .pklg).

If you have problems posting the .pklg file you can try to zip it first, or you can upload it somewhere and only post a link to it.

Best
Matthias
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/c9f1bacf-f8ef-41d2-a8fb-e606881f04e7n%40googlegroups.com.

Maheshwari R

unread,
Aug 11, 2021, 3:04:13 AM8/11/21
to btstack-dev
Hi Mathias,

Please find the log in the below and also I have attached the .pklg  file in the  link

Mobile Phone to BT Dongle
=========================

USB Device Connected
USB Device Reset Completed
PID: 1h
VID: a12h
Address (#1) assigned.
Manufacturer : N/A
Product : CSR8510 A10
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Bluetooth class started.
BTstack on STM32 F4 Discovery with USB support starting...

[00:00:01.613] 
LOG -- btstack_tlv_flash_bank.c.211: test erased: bank 0, offset 0

[00:00:01.623] 
LOG -- btstack_tlv.c.48: TLV Instance 0x801e37c

[00:00:01.633] 
LOG -- le_device_db_tlv.c.159: num valid le device entries 0

[00:00:01.641] 
LOG -- rfcomm.c.2513: RFCOMM_REGISTER_SERVICE channel #1 mtu 65535 flow_control 0 credits 10

[00:00:01.651] 
LOG -- l2cap.c.8139: L2CAP_REGISTER_SERVICE psm 0x3 mtu 65535

[00:00:01.659] 
LOG -- l2cap.c.8139: L2CAP_REGISTER_SERVICE psm 0x1 mtu 65535

SDP service record size: 91

hci_power_control: 1, current mode 0
[00:00:01.673] 
LOG -- hci_transport_h2_stm32.c.207: hci_transport_h2_stm32_init

BTSTACK_EVENT_STATE 1
[00:00:01.683] 
EVT <= 60 01 01 


[00:00:01.687] 
CMD => 03 0C 00 


[00:00:01.692] 
EVT <= 6E 00 


[00:00:01.697] 
EVT <= 0E 04 01 03 0C 00 


[00:00:01.702] 
CMD => 01 10 00 


[00:00:01.707] 
EVT <= 6E 00 


[00:00:01.712] 
EVT <= 0E 0C 01 01 10 00 06 20 31 06 0A 00 BB 22 


Manufacturer: 0x000a
[00:00:01.722] 
CMD => 14 0C 00 


[00:00:01.727] 
EVT <= 6E 00 


[00:00:01.747] 
EVT <= 0E FC 01 14 0C 00 43 53 52 38 35 31 30 20 41 31 30 0A 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 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 00 00 00 00 00 00 00 00 00 00 0
0 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 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 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 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 00 00 00 00 00 00 00 00 00 00 00 00 00 0
0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 


local name: CSR8510 A10

Received local name, need baud change 0
[00:00:01.853] 
CMD => 02 10 00 


[00:00:01.858] 
EVT <= 6E 00 


[00:00:01.867] 
EVT <= 0E 44 01 02 10 00 FF FF FF 03 80 FF FF FF 3F FF FF 1F F2 0F E8 FE 3F F7 8D FF 1C 00 00 00 7D F7 FF FF 7F 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 00 00 00 


Local supported commands summary 8f - 01
[00:00:01.900] 
CMD => 09 10 00 


[00:00:01.906] 
EVT <= 6E 00 


[00:00:01.910] 
EVT <= 0E 0A 01 09 10 00 10 71 DA 7D 1A 00 


Local Address, Status: 0x00: Addr: 00:1A:7D:DA:71:10
[00:00:01.922] 
CMD => 05 10 00 


[00:00:01.927] 
EVT <= 6E 00 


[00:00:01.932] 
EVT <= 0E 0B 01 05 10 00 80 02 40 04 00 08 00 


hci_read_buffer_size: ACL size module 640 -> used 640, count 4 / SCO size 64, count 8
[00:00:01.948] 
CMD => 03 10 00 


[00:00:01.953] 
EVT <= 0E 0C 01 03 10 00 FF FF 8F FA 9B FF 59 87 


Features bit 26 is not set, removing packet types 0x2204
Packet types ee1c, eSCO 1
BR/EDR support 1, LE support 0
[00:00:01.972] 
EVT <= 6E 00 


[00:00:01.976] 
CMD => 01 0C 08 FF FF FF FF FF FF FF 1F 


[00:00:01.984] 
EVT <= 6E 00 


[00:00:01.987] 
EVT <= 0E 04 01 01 0C 00 


[00:00:01.993] 
CMD => 56 0C 01 01 


[00:00:01.998] 
EVT <= 6E 00 


[00:00:02.003] 
EVT <= 0E 04 01 56 0C 00 


[00:00:02.008] 
CMD => 18 0C 02 00 60 


[00:00:02.014] 
EVT <= 6E 00 


[00:00:02.018] 
EVT <= 0E 04 01 18 0C 00 


[00:00:02.023] 
CMD => 0F 08 02 00 00 


[00:00:02.029] 
EVT <= 0E 04 01 0F 08 00 


[00:00:02.034] 
EVT <= 6E 00 


[00:00:02.038] 
CMD => 24 0C 03 0C 02 7A 


[00:00:02.044] 
EVT <= 0E 04 01 24 0C 00 


[00:00:02.049] 
EVT <= 6E 00 


[00:00:02.053] 
CMD => 13 0C 1E 42 54 73 74 61 63 6B 20 30 30 3A 31 41 3A 37 44 3A 44 41 3A 37 31 3A 31 30 00 00 00 00 00 


[00:00:02.070] 
EVT <= 0E 04 01 13 0C 00 


[00:00:02.075] 
EVT <= 6E 00 


[00:00:02.079] 
CMD => 52 0C 1F 00 1A 09 42 54 73 74 61 63 6B 20 30 30 3A 31 41 3A 37 44 3A 44 41 3A 37 31 3A 31 30 00 00 00 


[00:00:02.096] 
EVT <= 6E 00 


[00:00:02.100] 
EVT <= 0E 04 01 52 0C 00 


[00:00:02.105] 
CMD => 45 0C 01 00 


[00:00:02.110] 
EVT <= 6E 00 


[00:00:02.115] 
EVT <= 0E 04 01 45 0C 00 


[00:00:02.120] 
CMD => 1A 0C 01 03 


[00:00:02.125] 
EVT <= 6E 00 


[00:00:02.130] 
EVT <= 0E 04 01 1A 0C 00 


BTSTACK_EVENT_DISCOVERABLE_ENABLED 1
[00:00:02.138] 
EVT <= 66 01 01 


[00:00:02.142] 
CMD => 2F 0C 01 01 


[00:00:02.148] 
EVT <= 0E 04 01 2F 0C 00 


[00:00:02.153] 
EVT <= 6E 00 


[00:00:02.157] 
CMD => 5B 0C 01 01 


[00:00:02.162] 
EVT <= 6E 00 


[00:00:02.167] 
EVT <= 0E 04 01 5B 0C 01 


hci_init_done -> HCI_STATE_WORKING
BTSTACK_EVENT_STATE 2
[00:00:02.177] 
EVT <= 60 01 02 


BTstack up and running on 00:1A:7D:DA:71:10.

[00:00:07.308] 
EVT <= 05 04 00 00 00 16 


[00:00:07.314] 
EVT <= 03 0B 13 00 00 41 3C 38 E9 BB 70 01 00 


Connection_complete (status=19) 70:BB:E9:38:3C:41
[00:00:08.602] 
EVT <= 04 0A 41 3C 38 E9 BB 70 0C 02 5A 01 


Connection_incoming: 70:BB:E9:38:3C:41, type 1
create_connection_for_addr 70:BB:E9:38:3C:41, type fd
sending hci_accept_connection_request
[00:00:08.623] 
CMD => 09 04 07 41 3C 38 E9 BB 70 01 


[00:00:08.631] 
EVT <= 6E 00 


[00:00:08.636] 
EVT <= 0F 04 00 01 09 04 


[00:00:08.642] 
EVT <= 03 0B 00 30 00 41 3C 38 E9 BB 70 01 00 


Connection_complete (status=0) 70:BB:E9:38:3C:41
New connection: handle 48, 70:BB:E9:38:3C:41
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:00:08.662] 
EVT <= 61 01 01 


[00:00:08.666] 
CMD => 1B 04 02 30 00 


[00:00:08.672] 
EVT <= 20 07 41 3C 38 E9 BB 70 01 


[00:00:08.679] 
EVT <= 6E 00 


[00:00:08.682] 
EVT <= 0F 04 00 01 1B 04 


L2CAP_EVENT_TIMEOUT_CHECK
[00:00:18.657] 
EVT <= 73 02 30 00 


[00:00:18.661] 
CMD => 06 04 03 30 00 13 


[00:00:18.668] 
EVT <= 6E 00 


[00:00:18.672] 
EVT <= 0F 04 00 01 06 04 


[00:00:18.681] 
EVT <= 05 04 00 00 00 16 


[00:00:18.687] 
EVT <= 05 04 00 30 00 13 


Connection closed: handle 0x30, 70:BB:E9:38:3C:41
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0
[00:00:18.701] 
EVT <= 61 01 00 


[00:00:23.817] 
EVT <= 04 0A 41 3C 38 E9 BB 70 0C 02 5A 01 


Connection_incoming: 70:BB:E9:38:3C:41, type 1
create_connection_for_addr 70:BB:E9:38:3C:41, type fd
sending hci_accept_connection_request
[00:00:23.838] 
CMD => 09 04 07 41 3C 38 E9 BB 70 01 


[00:00:23.846] 
EVT <= 6E 00 


[00:00:23.851] 
EVT <= 0F 04 00 01 09 04 


[00:00:23.857] 
EVT <= 03 0B 00 30 00 41 3C 38 E9 BB 70 01 00 


Connection_complete (status=0) 70:BB:E9:38:3C:41
New connection: handle 48, 70:BB:E9:38:3C:41
BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1
[00:00:23.877] 
EVT <= 61 01 01 


[00:00:23.882] 
CMD => 1B 04 02 30 00 


[00:00:23.887] 
EVT <= 20 07 41 3C 38 E9 BB 70 01 


[00:00:25.894] 
EVT <= 6E 00 


[00:00:25.898] 
EVT <= 38 04 30 00 40 1F 


[00:00:25.904] 
EVT <= 0F 04 00 01 1B 04 


[00:00:25.910] 
EVT <= 0B 0B 00 30 00 FF FE 8F FE D8 3F 5B 87 


[00:00:25.918] 
CMD => 1C 04 03 30 00 01 


[00:00:25.925] 
EVT <= 6E 00 


[00:00:25.929] 
EVT <= 0F 04 00 01 1C 04 


[00:00:25.935] 
EVT <= 23 0D 00 30 00 01 01 0B 00 00 00 00 00 00 00 


Remote features 03, bonding flags f8
[00:00:26.011] 
EVT <= 32 09 41 3C 38 E9 BB 70 01 00 03 


pairing started, ssp 1, initiator 0, requested level 2
[00:00:26.024] 
EVT <= DF 0A 41 3C 38 E9 BB 70 30 00 01 00 


[00:00:26.032] 
EVT <= 31 06 41 3C 38 E9 BB 70 


gap_mitm_protection_required_for_security_level 2
[00:00:26.043] 
CMD => 2B 04 09 41 3C 38 E9 BB 70 01 00 04 


[00:00:26.051] 
EVT <= 6E 00 


[00:00:26.503] 
EVT <= 0E 0A 01 2B 04 00 41 3C 38 E9 BB 70 


[00:00:27.048] 
EVT <= 33 0A 41 3C 38 E9 BB 70 FF 96 03 00 


SSP User Confirmation Request with numeric value '235263'

SSP User Confirmation Auto accept

[00:00:27.064] 
CMD => 2C 04 06 41 3C 38 E9 BB 70 


[00:00:27.072] 
EVT <= 6E 00 


[00:00:27.076] 
EVT <= 0E 0A 01 2C 04 00 41 3C 38 E9 BB 70 


[00:00:28.734] 
EVT <= 36 07 00 41 3C 38 E9 BB 70 


pairing complete, status 00
[00:00:28.743] 
EVT <= E0 09 41 3C 38 E9 BB 70 30 00 00 20 


[00:00:28.751] 
EVT <= 06 03 00 30 00 


[00:00:28.756] 
CMD => 13 04 03 30 00 01 


[00:00:28.762] 
EVT <= 0F 04 00 01 13 04 


[00:00:28.768] 
EVT <= 6E 00

Matthias Ringwald

unread,
Aug 12, 2021, 11:57:17 AM8/12/21
to btsta...@googlegroups.com
HI Maheshwari

In the text output, there is still a newline after the timestamp and the HCI packet. Could you fix that as well?
Anyway. In the first connection requests, the connection was established and nothing happens. Later, pairing is started and completed.

I think I've seen this behavior. My guess here is that the USB driver fails to receive ACL packets on the Bulk In Endpoint. After the connection was established, we should receive e.g. an connection request for SDP.
Could you check if you get ACL packets? e.g. with a USB protocol analyzer.

Alternatively, could you try one of the client examples that send ACL packets to see if you get a response? You could run spp_streamer with an USB dongle on your laptop and spp_streamer_client on your device.

Cheers
Matthias

> On 11 Aug 2021, at 09:04, Maheshwari R <mahes...@gmail.com> wrote:
>
> Hi Mathias,
>
Reply all
Reply to author
Forward
0 new messages