Skip to content

Circuitpython doesn't compile when disabling BLE (including working quick fix) #10750

@meatdryer

Description

@meatdryer

CircuitPython version and board name

Adafruit CircuitPython 10.0.1 on 2025-10-09; Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM with ESP32S3

Code/REPL

mpconfigboard.mk:

CIRCUITPY_BLE_FILE_SERVICE = 0
CIRCUITPY_SERIAL_BLE = 0

Behavior

Circuitpython won't build when disabling BLE_FILE_SERVICE and SERIAL_BLE.

PacketBuffer.c seems to be missing a compilation guard when the build flags are set. It seems like the prototype is removed from the header file but the implementation still exists in the C-file.

There also seems to be a parameter mis-match between the header-file and the C-file:
max_packet_size vs. outgoing_buffer_size

-- Compilation error:
GEN build-adafruit_feather_esp32s3_4mbflash_2mbpsram/genhdr/root_pointers.h
common-hal/_bleio/PacketBuffer.c:162:6: error: no previous prototype for '_common_hal_bleio_packet_buffer_construct' [-Werror=missing-prototypes]
162 | void _common_hal_bleio_packet_buffer_construct(

-- Quick fix that works:

shared-bindings/_bleio/PacketBuffer.h:
(Line 28)
uint32_t *outgoing_buffer1, uint32_t *outgoing_buffer2, size_t outgoing_buffer_size,
--->
uint32_t *outgoing_buffer1, uint32_t *outgoing_buffer2, size_t max_packet_size,

ports/espressif/common-hal/_bleio/PacketBuffer.c
(Line 162)
#if CIRCUITPY_SERIAL_BLE || CIRCUITPY_BLE_FILE_SERVICE // Exposed via shared-bindings header when enabled void _common_hal_bleio_packet_buffer_construct( #else // Internal static helper when disabled (avoids "missing prototype" error) static void _common_hal_bleio_packet_buffer_construct( #endif

Description

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions