From c9a142b580dd60d29efd5ca430d3d9c6a71d4e2c Mon Sep 17 00:00:00 2001 From: mikecarper Date: Mon, 19 Oct 2026 20:43:40 -0700 Subject: [PATCH] Include live stack and advertising readbacks in BLE debug exports --- docs/research/nrf52_bluetooth_debug.md | 10 ++++++++++ scripts/capture_nrf52_ble_debug.py | 2 ++ 2 files changed, 12 insertions(+) diff --git a/docs/research/nrf52_bluetooth_debug.md b/docs/research/nrf52_bluetooth_debug.md index fd60a6a4b..0de079309 100644 --- a/docs/research/nrf52_bluetooth_debug.md +++ b/docs/research/nrf52_bluetooth_debug.md @@ -49,6 +49,14 @@ application may have the misleading USB product name T1000-E-BOOT. - get bluetooth.trace: format, latest sequence, capacity and dropped writes. - get bluetooth.trace.state: advertising, connection, security, UART notification state, MTU, app traffic and queues. +- get bluetooth.trace.stack: actual running SoftDevice firmware ID and SDK + query status. This is a live query, independent of build and bootloader labels. +- get bluetooth.trace.advertiser: live active/idle advertising set counts, + status, own advertising address and privacy mode. The cached framework flag + is also included for comparison. No peer addresses or IRKs are requested. +- get bluetooth.trace.identity: own GAP name/address and payload lengths. +- get bluetooth.trace.advertising: bounded copies of the public advertising + and scan-response payloads, up to 31 bytes each. - get bluetooth.trace.stats: cumulative connects, disconnects, secured sessions, RX/TX operations and last disconnect reason/time. - get bluetooth.trace.timing: uptime, maximum loop gap, maximum stack @@ -59,6 +67,8 @@ The debug commands are restricted to local Companion transport requests and are not exposed through remote mesh management. Replies and raw records are decoded by the exporter. Sequence gaps and overwritten records are reported. Diagnostic contention is counted and dropped rather than blocking BLE. +The exporter retains unsupported-command replies from older format-2 images; +missing newer readbacks do not prevent export of their event rings. ## Reading the result diff --git a/scripts/capture_nrf52_ble_debug.py b/scripts/capture_nrf52_ble_debug.py index a49eb7aca..74e689c1b 100644 --- a/scripts/capture_nrf52_ble_debug.py +++ b/scripts/capture_nrf52_ble_debug.py @@ -123,6 +123,8 @@ def export(port_name): terminal.read_prompt() for command in ("ver", "get radio", "get tx", "get bluetooth.trace.state", "get bluetooth.trace.stats", "get bluetooth.trace.timing", + "get bluetooth.trace.stack", "get bluetooth.trace.advertiser", + "get bluetooth.trace.identity", "get bluetooth.trace.advertising", "get bluetooth.trace"): result["commands"][command] = terminal.command(command) head = values(result["commands"]["get bluetooth.trace"])