Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "Raspberry Pi Foundation Raspberry Pi Pico"

[modules]
__future__ = true
_bleio = false
_bleio = true # Zephyr board has _bleio
_eve = false
_pew = false
_pixelmap = false
Expand Down
16 changes: 16 additions & 0 deletions ports/zephyr-cp/boards/raspberrypi/rpi_pico_w_zephyr/board.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,19 @@ CONFIG_MBEDTLS_ENTROPY_C=y
CONFIG_MBEDTLS_CTR_DRBG_C=y

CONFIG_TEST_RANDOM_GENERATOR=y

# Bluetooth over the shared gSPI bus (CONFIG_BT itself comes from the
# zephyr,bt-hci chosen node in the overlay).
#
# The CYW43439's BT controller firmware does not implement the Bluetooth 5
# extended advertising/scanning commands, and the port defaults BT_EXT_ADV on,
# so turn it off here and let the host use the legacy 0x200B/0x200C commands.
CONFIG_BT_EXT_ADV=n
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

# Connections. prj.conf allows 5 on every board, and every connection reserves
# its buffers and state in static RAM up front. The Pico W's 264 KB is mostly
# spoken for by the WiFi and BT stacks already: with 5, the CircuitPython heap
# left over came to ~16.5 KB, too little for adafruit_ble plus a program. Two
# still covers the BLE workflow plus one more central.
CONFIG_BT_MAX_CONN=2
55 changes: 55 additions & 0 deletions ports/zephyr-cp/boards/raspberrypi/rpi_pico_w_zephyr/board.overlay
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
/* Partition layout is owned by the mcuboot fork (dts/raspberrypi/rpi_pico.dtsi)
* and applied to this image by sysbuild. This overlay only adds board/app config. */

/*
* Settings partition: one exception to the layout above. sysbuild prepends the
* adaboot layout (dts/raspberrypi/rpi_pico_w.dtsi) to this overlay, so what
* is set here wins.
*
* The settings partition backs Bluetooth bond keys via NVS, so it must be
* erase-sector aligned and hold at least two of the RP2040's 4K sectors.
* The layout gives it one (0x17f000, 4K); nvs_mount() rejects a single sector
* with -EINVAL, which makes bt_enable() fail before ever opening the HCI
* driver and surfaces as a bare OSError from "import _bleio".
*
* nvm and the filesystem must stay where ports/raspberrypi puts them
* (cptools/check_partitions.py enforces this), so the second sector comes out
* of the code partition, not out of the CIRCUITPY drive. The code partition
* still starts at 0x100, after the second stage bootloader.
*/
&code_partition {
reg = <0x100 (0x17e000 - 0x100)>;
};

/delete-node/ &storage_partition;

&flash0 {
partitions {
storage_partition: partition@17e000 {
compatible = "zephyr,mapped-partition";
label = "storage";
reg = <0x17e000 0x2000>;
};
};
};

/*
* Bluetooth. Same CYW43439 as the Pico 2 W: HCI is not on a UART, it shares
* the WiFi gSPI bus, so hang the shared-bus HCI transport off the board's
* stock infineon,airoc-wifi node and point the host at it. CONFIG_BT then
* enables itself via the zephyr,bt-hci chosen (see
* ../../../internal-modules/circuitpython-kconfig/Kconfig).
*/
&pio0_spi0 {
airoc-wifi@0 {
cyw43_bt_hci: cyw43_bt_hci {
compatible = "infineon,cyw43-bt-hci";
status = "okay";
};
};
};

/ {
chosen {
zephyr,bt-hci = &cyw43_bt_hci;
};
};

#include "../../../app.overlay"
Loading