From c0f0b5b84cc86acba74df92531da9bb866f2cebb Mon Sep 17 00:00:00 2001 From: Anne Jan Brouwer Date: Wed, 29 Jul 2026 03:24:55 +0200 Subject: [PATCH 1/3] ble_hci: fill in the handle and error code of an ATT Error Response send_error() takes a handle and an error code and then ignored both: the initialiser only set the two opcodes, so every Error Response the device sent carried handle 0x0000 and error code 0x00. 0x00 is not a valid ATT error code, and a client may treat such a response as malformed. BlueZ does. During service discovery it reads Server Supported Features (0x2B3A), no attribute matches, the malformed error comes back, and it abandons the ATT bearer and finishes with an empty database. The peripheral then appears to have no services at all, even though its Read By Group Type Responses were correct. Found on an nRF52840 talking to BlueZ, by reading the ATT exchange over SWD. With the fields filled in, that read is answered with Attribute Not Found, discovery proceeds, and the client sees every service and characteristic. --- devices/ble_hci/common-hal/_bleio/att.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index 930b4793161..7e4a43aee97 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -136,6 +136,8 @@ static void send_error(uint16_t conn_handle, uint8_t opcode, uint16_t handle, ui .code = BT_ATT_OP_ERROR_RSP, }, { .request = opcode, + .handle = handle, + .error = code, }}; hci_send_acl_pkt(conn_handle, BT_L2CAP_CID_ATT, sizeof(rsp), (uint8_t *)&rsp); From 15fd5bb2bf70fa13c2ba5ef4bb00b20beefcc511 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Jul 2026 12:33:47 -0400 Subject: [PATCH 2/3] shrink feather_m4_can --- ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk index ee414b6e214..206716c6879 100644 --- a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk @@ -19,6 +19,7 @@ CIRCUITPY_I2CTARGET = 0 CIRCUITPY_JPEGIO = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_SYNTHIO = 0 +CIRCUITPY_VECTORIO = 0 CIRCUITPY_LTO_PARTITION = one From eba2973be2265b120d90836a760e5494fe302bd0 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 29 Jul 2026 12:34:42 -0400 Subject: [PATCH 3/3] shrink pimoroni_pico_dv_base_w --- .../raspberrypi/boards/pimoroni_pico_dv_base_w/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/raspberrypi/boards/pimoroni_pico_dv_base_w/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_pico_dv_base_w/mpconfigboard.mk index 1eee6ce8e10..016dd0d7269 100644 --- a/ports/raspberrypi/boards/pimoroni_pico_dv_base_w/mpconfigboard.mk +++ b/ports/raspberrypi/boards/pimoroni_pico_dv_base_w/mpconfigboard.mk @@ -20,6 +20,7 @@ CIRCUITPY_WIFI = 1 CIRCUITPY_PICODVI = 1 CIRCUITPY_AUDIOFILEWRITER = 0 +CIRCUITPY_BLEIO_HCI = 0 # No room: this board fills FLASH_FIRMWARE. Frees ~9kB. Not the board's I2S # line-out/HDMI audio, which audiobusio still provides.