From 0faddb3c8a0f44e04577c8f6e46bf0d1e976d2c9 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 23 Jun 2025 13:02:36 +1000 Subject: [PATCH] zephyr/boards/nucleo_wb55rg: Enable BLE, I2C, SPI and add filesystem. Bluetooth works well now on this board, so enable all supported features. Also increase the MicroPython GC heap size to make use of the available RAM. Unfortunately the filesystem does not match the stm32 port's NUCLEO_WB55 configuration. That's not possible to do because stm32 uses a 512 byte flash erase size, while zephyr uses 4096 bytes. But at least here in zephyr there's now a sizable and usable filesystem. Signed-off-by: Damien George --- ports/zephyr/boards/nucleo_wb55rg.conf | 16 ++++++++++++++++ ports/zephyr/boards/nucleo_wb55rg.overlay | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 ports/zephyr/boards/nucleo_wb55rg.overlay diff --git a/ports/zephyr/boards/nucleo_wb55rg.conf b/ports/zephyr/boards/nucleo_wb55rg.conf index fab993676..adfab367c 100644 --- a/ports/zephyr/boards/nucleo_wb55rg.conf +++ b/ports/zephyr/boards/nucleo_wb55rg.conf @@ -1,5 +1,21 @@ CONFIG_NETWORKING=n + +# Hardware features +CONFIG_FLASH=y +CONFIG_FLASH_MAP=y +CONFIG_I2C=y +CONFIG_SPI=y + +# Bluetooth CONFIG_BT=y CONFIG_BT_DEVICE_NAME_DYNAMIC=y +CONFIG_BT_GATT_DYNAMIC_DB=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_CENTRAL=y +CONFIG_BT_GATT_CLIENT=y +CONFIG_BT_L2CAP_TX_MTU=252 +CONFIG_BT_BUF_ACL_RX_SIZE=256 +CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n + +# MicroPython config +CONFIG_MICROPY_HEAP_SIZE=131072 diff --git a/ports/zephyr/boards/nucleo_wb55rg.overlay b/ports/zephyr/boards/nucleo_wb55rg.overlay new file mode 100644 index 000000000..d9a4d3f24 --- /dev/null +++ b/ports/zephyr/boards/nucleo_wb55rg.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Damien P. George + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Delete the defined partitions and create bigger one for storage. */ +/delete-node/ &slot1_partition; +/delete-node/ &scratch_partition; +/delete-node/ &storage_partition; +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* Storage slot: 424 KiB placed after slot0_partition. */ + storage_partition: partition@70000 { + label = "storage"; + reg = <0x00070000 DT_SIZE_K(424)>; + }; + }; +};