Skip to content

Commit

Permalink
Add a README for bluetooth debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
peterharperuk committed May 1, 2024
1 parent fb3a85e commit d364f4e
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.

The Bluetooth examples that use audio require code in [pico-extras](https://github.com/raspberrypi/pico-extras). 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 in the build.

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](https://github.com/bluekitchen/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 afterwards run `pico-sdk/lib/btstack/tool/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](https://www.wireshark.org) application to analyze communications activity.

0 comments on commit d364f4e

Please sign in to comment.