BLE HCI Demo (nRF54L15)
The BLE HCI demo is a showcase firmware for the nRF54L15 DK that demonstrates LogScope’s features through physical button interactions and real Bluetooth LE connections.
Quick Start
Section titled “Quick Start”# Flash prebuilt hexnrfutil device program --firmware samples/nrf54l15-ble-hci-demo/build/merged.hex --serial-number <SN>nrfutil device reset --serial-number <SN>Or build from source:
source samples/nrf54l15-ble-hci-demo/setup-env.shwest build -b nrf54l15dk/nrf54l15/cpuapp samples/nrf54l15-ble-hci-demo --build-dir build-hci -pwest flash --build-dir build-hciThen open LogScope, connect via J-Link RTT with the Zephyr parser.
Buttons
Section titled “Buttons”| Button | Idle State | Connected State |
|---|---|---|
| Button 0 | Toggle advertising on/off | Force disconnect |
| Button 1 | Sensor anomaly sequence (4 messages) | Anomaly + 10 notification burst |
| Button 2 | Flash corruption sequence (5 messages) | Same |
| Button 3 | Stress burst (50 rapid-fire messages) | Same |
Button 0: BLE State Control
Section titled “Button 0: BLE State Control”When advertising: Stops advertising.
ble_mgr: Advertising stopped by userWhen stopped: Restarts advertising.
ble_mgr: Advertising restarted by userWhen connected: Forces a disconnect.
ble_mgr: User-initiated disconnectapp: Disconnected: XX:XX:XX:XX:XX:XX (reason 0x16 Remote User Terminated Connection)app: Re-advertising startedButton 1: Sensor Anomaly
Section titled “Button 1: Sensor Anomaly”Simulates a temperature spike:
sensor_drv: Anomaly detected: temperature spike to 85.2C (threshold: 60.0C)sensor_drv: Thermal threshold exceeded, initiating cooldownsensor_drv: Sensor read timeout during thermal event (retry 1/3)sensor_drv: Temperature returning to normal: 24.8CWhen a BLE device is connected, also sends 10 rapid BLE notifications.
Button 2: Flash Corruption
Section titled “Button 2: Flash Corruption”Simulates storage corruption with recovery:
flash_mgr: CRC mismatch at sector 0x00080000 (expected: 0xA3F1, got: 0x0000)flash_mgr: Wear level critical on sector 0x00080000 (writes: 99847)flash_mgr: Flash write failed at 0x00080000 (ECC error)flash_mgr: Sector 0x00080000 marked bad, remapping to 0x000A0000flash_mgr: Flash recovery complete, 1 sector remappedButton 3: Stress Burst
Section titled “Button 3: Stress Burst”Fires 50 rapid messages (20ms apart) with realistic content cycling through errors, warnings, and info messages. Great for testing LogScope’s parsing performance and filtering.
Recurring Events
Section titled “Recurring Events”| Interval | Module | Level | Message |
|---|---|---|---|
| Every 2s | sensor_drv | DBG | Temperature, humidity, accelerometer readings |
| Every 4s | crypto_mgr | DBG | AES-128-CCM encryption operations |
| Every 5s | app | INF | Heartbeat with uptime |
| Every 5s | flash_mgr | DBG | Flash write operations |
| ~8-12s | app | WRN | Retransmission warnings (pseudo-random interval) |
| Every 15s | flash_mgr | WRN | Flash wear level warnings |
| Every 15s | crypto_mgr | WRN | Key rotation warnings |
| Every 30s | flash_mgr | ERR | Flash write failures |
| Every 30s | crypto_mgr | ERR | MAC verification failures |
| Every 45s | app | WRN/INF | Battery level checks |
Bluetooth LE Connection
Section titled “Bluetooth LE Connection”The firmware advertises as “LogScope Demo”. Connect with the nRF Connect mobile app to see:
- Real HCI packets (Connection Complete, Parameter Updates, GATT operations)
- Application-level connection/disconnection logs
- Sensor data notifications (every 2s when subscribed)
GATT Service
Section titled “GATT Service”| Characteristic | UUID Suffix | Type | Description |
|---|---|---|---|
| Info | ...def1 | Read | Returns device info string |
| Command | ...def2 | Write | 0x01=burst, 0x02=reset sensor, 0x03=flash erase, 0x04=fault sim, 0x05=real fault |
| Sensor Data | ...def3 | Notify | 4-byte sensor value, every 2s when subscribed |
Suggested Watch Patterns
Section titled “Suggested Watch Patterns”Set these up in LogScope to see watch patterns in action:
"logscope.watchPatterns": [ { "name": "BLE State", "pattern": "Connected|Disconnected|Advertising", "regex": true, "color": "#4caf50" }, { "name": "Errors", "pattern": "failed|error|fault|CRC|timeout", "regex": true, "color": "#f44336" }, { "name": "Retransmission", "pattern": "Retransmission", "color": "#ff9800" }]Or add them one at a time using the LogScope: Add Watch Pattern command in the Command Palette (Cmd+Shift+P).
Requirements
Section titled “Requirements”- nRF54L15 DK (PCA10156)
- nRF Connect SDK v3.2.0
- Optional: phone with nRF Connect app