Skip to content

Commit 3ad146a

Browse files
Add a README for bluetooth debugging (#427)
Fixes #426
1 parent fb3a85e commit 3ad146a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ default being *background*. This can be changed by passing `-DBTSTACK_EXAMPLE_TY
153153
examples can be built (which may be slow) by passing `-DBTSTACK_EXAMPLE_TYPE=all`
154154
Freertos versions can only be built if `FREERTOS_KERNEL_PATH` is defined.
155155

156+
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.
157+
156158
App|Description
157159
---|---
158160
[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.

pico_w/bt/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Pico W Bluetooth Examples
2+
3+
The source for most of the Bluetooth examples is stored in `pico-sdk/lib/btstack/example`.
4+
There's a standalone example in `pico-examples/pico_w/bt/standalone`.
5+
6+
## Debugging
7+
8+
To debug Bluetooth issues you can enable [btstack](https://github.com/bluekitchen/btstack) debug output which also enables packet logging.
9+
Define `WANT_HCI_DUMP=1` in your CMakeLists.txt file. Uncomment this line to enable debug in the btstack examples.
10+
11+
target_compile_definitions(picow_bt_example_common INTERFACE
12+
#WANT_HCI_DUMP=1 # This enables btstack debug
13+
)
14+
15+
## Packet logging
16+
17+
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>`.
18+
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 commit comments

Comments
 (0)