BlueKitchen btstack Library (espidf)

Hi!

I had a project running on the esp-idf, using Espressif’s own Visual Studio Code plugin.

After all the effort it took to get it working, I thought I’d try again with PlatformIO. I got a test pio project running fine, with ocd-based debugging working great with my esp32-pico-v4 board and an ESP-Prog JTAG adapter.

So then I copied my project’s code into a fresh pio project. This project uses BlueKitchen’s btstack library.

The plain-IDF setup for btstack is pretty straightforward - it comes with a .py script which, when run, copies the component into IDF at $IDF_PATH.

Since PIO installs its own IDF, I re-ran that script with $IDF_PATH set to PIO’s version. Completed fine.

But, when I build my project, I get btstack.h: No such file or directory errors.

Has anyone had any luck referencing btstack from a PlatformIO project?

Many thanks,
Chris

What ESP-IDF is the component targeted at? Remember that PlatformIO currently uses the v4.0 release.

Also, you might have more luck when taking your first working project and adding the new bluetooth stack as component as shown in the docs. An example with esp-aws-iot as a component is also available.

Thanks for the reply!

I got it working. I had the btstack directory under ${PROJECTROOT}/src/components so thought it’d get picked up automatically.

It wasn’t, but adding list(APPEND EXTRA_COMPONENT_DIRS btstack) to the root CMakeLists.txt file worked a treat!

Additionally, under PlatformIO, I’m not having the issue I had with ESP-IDF+Official ESP-IDF vscode plugin. Breakpoints weren’t getting hit it most .c files. However, under PIO, breakpoints seem to work fine everywhere. Brilliant!

(oh, and to answer your first question, btstack targets 4.0 of the IDF)