pico_btstack: use PICO_BTSTACK_PATH for compile_gatt.py #2950
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!2950
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-btstack-compile-gatt-path"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #2901.
pico_btstack_make_gatt_header()insrc/rp2_common/pico_btstack/CMakeLists.txtwas invoking the bundledcompile_gatt.pyvia${PICO_SDK_PATH}/lib/btstack/tool/...even when the user had supplied an out-of-tree BTstack via-DPICO_BTSTACK_PATH=.... The rest of the file already routes everything (sources, include dirs, suppress-warnings list, etc.) throughPICO_BTSTACK_PATH; only this one invocation didn't.Switch the
add_custom_commandat line 342 to use${PICO_BTSTACK_PATH}/tool/compile_gatt.pyto match.Compatibility
In the default case,
PICO_BTSTACK_PATHis set to${PICO_SDK_PATH}/lib/btstack(line 9 of the same file), so${PICO_BTSTACK_PATH}/tool/compile_gatt.pyresolves to exactly the same path the old code produced. The change is therefore a no-op for builds that don't override the variable.For builds that do override it (the case the issue is about), the user's
compile_gatt.pyis now used as intended.Test plan
grep -n 'PICO_SDK_PATH' src/rp2_common/pico_btstack/CMakeLists.txt: only line 9 (default forPICO_BTSTACK_PATH) and line 12 (submodule-init hint message) remain. No other stray references.cmake --build buildforPICO_PLATFORM=rp2040 PICO_BOARD=pico. The SDK itself doesn't ship a GATT-using example, so the function definition is exercised only by configure; no in-tree behaviour change.End-to-end verification with an out-of-tree BTstack
Set up a separate BTstack root (
/tmp/btstack-oot), a minimal consumer project that callspico_btstack_make_gatt_header()on a tiny.gattfile, and configured withPICO_BOARD=pico2_w -DPICO_BTSTACK_PATH=/tmp/btstack-oot.Configured twice: once with the file at
origin/develop(no fix), once with this branch. The generatedgatt_consumer_gatt_headerbuild rule encodes the literalpython3 <path>/compile_gatt.py ...command, so the path used is visible without running the command.origin/develop(no fix)/home/andrii/pico-sdk/lib/btstack/tool/compile_gatt.py← bundled, override ignored/tmp/btstack-oot/tool/compile_gatt.py← user'sPICO_BTSTACK_PATHrespectedThen built the target on the fix branch:
python3runs from the override path, producestest.h, and the generated header self-documents the invocation in a comment -// To generate test.h: /tmp/btstack-oot/tool/compile_gatt.py ....I've fixed this internally - but it hasn't made it to the develop branch.
Please remove "Co-Authored-By: Claude" line.
Force-pushed to drop the
Co-Authored-Bytrailer. New HEAD:ea7d803c.@peterharperuk please merge if u r happy