Skip to content

Commit

Permalink
Add a README for bluetooth debugging
Browse files Browse the repository at this point in the history
Fixes #426
  • Loading branch information
peterharperuk committed Oct 3, 2023
1 parent eca13ac commit 20a321b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ default being *background*. This can be changed by passing `-DBTSTACK_EXAMPLE_TY
examples can be built (which may be slow) by passing `-DBTSTACK_EXAMPLE_TYPE=all`
Freertos versions can only be built if `FREERTOS_KERNEL_PATH` is defined.

Some of the bluetooth examples require code in [pico-extras](git@github.com:raspberrypi/pico-extras.git). Pass `-DPICO_EXTRAS_PATH=${HOME}/pico-extras` on the cmake command line or define `PICO_EXTRAS_PATH=${HOME}/pico-extras` in your environment and re-run cmake to include them.

App|Description
---|---
[picow_bt_example_a2dp_sink_demo](https://github.com/bluekitchen/btstack/tree/master/example/a2dp_sink_demo.c) | A2DP Sink - Receive Audio Stream and Control Playback.
Expand Down
18 changes: 18 additions & 0 deletions pico_w/bt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Pico W Bluetooth Examples

The source for most of the Bluetooth examples is stored in pico-sdk/lib/btstack/example.
There's a standalone example in `pico-examples/pico_w/bt/standalone`.

## Debugging

To debug bluetooth issues you can enable btstack debug output which also enables packet logging.
Define `WANT_HCI_DUMP=1` in your CMakeLists.txt file. Uncomment this line to enable debug in the btstack examples.

target_compile_definitions(picow_bt_example_common INTERFACE
#WANT_HCI_DUMP=1 # This enables btstack debug
)

## Packet logging

To view packet logs, save the output from the debug port (e.g. the uart) to a file and run `pico-sdk/btstack/tools/create_packet_log.py <filename>`.
This will generate a file with the same name except for a `pklg` extension. This can be opened in the Wireshark application to analyze communications activity.

0 comments on commit 20a321b

Please sign in to comment.