Skip to content

Commit 09ee309

Browse files
committed
stm32: Use shared poll interval define and enable DLE.
Use ZEPHYR_BLE_POLL_INTERVAL_MS for poll timer values. Enable CONFIG_BT_AUTO_DATA_LEN_UPDATE for NUCLEO_WB55. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent a625ca1 commit 09ee309

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

ports/stm32/boards/NUCLEO_WB55/mpconfigvariant_zephyr_ble.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ MICROPY_HW_ENABLE_ISR_UART_FLASH_FUNCS_IN_RAM = 0
1313
# Use bump allocator for GATT structures (STM32 Zephyr builds don't link libc)
1414
CFLAGS += -DMICROPY_BLUETOOTH_ZEPHYR_GATT_POOL=1
1515

16+
# Enable auto DLE — STM32WB controller handles DLE fine
17+
CFLAGS += -DCONFIG_BT_AUTO_DATA_LEN_UPDATE=1
18+
1619
# Force linker to keep HCI device symbols (prevent --gc-sections from removing them)
1720
LDFLAGS += -Wl,--undefined=__device_dts_ord_0 -Wl,--undefined=mp_bluetooth_zephyr_hci_dev

ports/stm32/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ typedef long mp_off_t;
237237
__WFI(); \
238238
} while (0);
239239

240+
#ifndef MICROPY_THREAD_YIELD
240241
#define MICROPY_THREAD_YIELD()
242+
#endif
241243

242244
// Configuration for shared/runtime/softtimer.c.
243245
#define MICROPY_SOFT_TIMER_TICKS_MS uwTick

ports/stm32/mpzephyrport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static int hci_stm32_open(const struct device *dev, bt_hci_recv_t recv) {
307307

308308
// Start the soft timer to begin periodic work queue processing
309309
// This starts the timer which will fire and process work queues + HCI packets
310-
mp_bluetooth_zephyr_port_poll_in_ms(128); // Start timer with 128ms delay
310+
mp_bluetooth_zephyr_port_poll_in_ms(ZEPHYR_BLE_POLL_INTERVAL_MS);
311311

312312
return 0;
313313
}
@@ -498,7 +498,7 @@ void mp_bluetooth_hci_poll(void) {
498498
mp_bluetooth_zephyr_port_run_task(NULL);
499499

500500
// Schedule next poll if stack is active
501-
mp_bluetooth_zephyr_port_poll_in_ms(128);
501+
mp_bluetooth_zephyr_port_poll_in_ms(ZEPHYR_BLE_POLL_INTERVAL_MS);
502502
}
503503

504504
// Initialize Zephyr port (called early in initialization)

0 commit comments

Comments
 (0)