Skip to content

ble_keyboard_peripheral_builder example works but ble_keyboard_peripheral_builder_macro does not on nrf52840 #290

Open
@Keaton-Clark

Description

@Keaton-Clark

Description

ble_keyboard_peripheral_builder_macro example panics at ble_keyboard_peripheral_builder_macro.rs:378 with error:

0.000000 ERROR panicked at 'unwrap failed: Server :: new(sd, "12345678")'
error: `Raw(Forbidden)`

while ble_keyboard_peripheral_builder does not

Information

  • Commands:
    • ble_keyboard_peripheral_builder:
      • cargo build --bin ble_keyboard_peripheral_builder --features nrf52840-dk
      • probe-rs run --chip nRF52840_xxAA target/thumbv7em-none-eabihf/debug/ble_keyboard_peripheral_builder
    • ble_keyboard_peripheral_builder_macro:
      • cargo build --bin ble_keyboard_peripheral_builder_macro --features nrf52840-dk
      • probe-rs run --chip nRF52840_xxAA target/thumbv7em-none-eabihf/debug/ble_keyboard_peripheral_builder_macro
  • Hardware:
    • mdbt50q-1mv2 (nrf52840) module on custom hardware
    • jlink-edu
  • Rust:
    • cargo 1.86.0-nightly (0e3d73849 2025-02-01)
    • rustc 1.86.0-nightly (4a4309466 2025-02-02)
  • Git:
commit bb1600b728c8acbaecf974741ee5867b472289f3 (HEAD -> master, origin/master, origin/HEAD)
Merge: 93ad991 9678ea6
Author: Alex Moon <[email protected]>
Date:   Wed Jan 8 22:30:47 2025 +0000

    Merge pull request #286 from NZRosto/macros-feature
    
    Add macros feature

Logs

ble_keyboard_peripheral_builder_macro

      Erasing ✔ 100% [####################] 112.00 KiB @  28.88 KiB/s (took 4s)
  Programming ✔ 100% [####################] 112.00 KiB @  18.58 KiB/s (took 6s)                                                                                                                                                                                                                                                     Finished in 9.91s
0.000000 INFO  Hello World!
└─ ble_keyboard_peripheral_builder_macro::____embassy_main_task::{async_fn#0} @ examples/src/bin/ble_keyboard_peripheral_builder_macro.rs:343 
0.000000 INFO  softdevice RAM: 31496 bytes
└─ nrf_softdevice::softdevice::{impl#0}::enable @ nrf-softdevice/src/fmt.rs:138 
0.000000 WARN  You're giving more RAM to the softdevice than needed. You can change your app's RAM start address to 20007b08
└─ nrf_softdevice::softdevice::{impl#0}::enable @ nrf-softdevice/src/fmt.rs:151 
0.000000 ERROR panicked at 'unwrap failed: Server :: new(sd, "12345678")'
error: `Raw(Forbidden)`
└─ ble_keyboard_peripheral_builder_macro::____embassy_main_task::{async_fn#0} @ examples/src/bin/ble_keyboard_peripheral_builder_macro.rs:378 
0.000000 ERROR panicked at /home/kc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/defmt-0.3.10/src/lib.rs:380:5:
explicit panic
└─ panic_probe::print_defmt::print @ /home/kc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/panic-probe-0.3.2/src/lib.rs:104

ble_keyboard_peripheral_builder

      Erasing ✔ 100% [####################] 108.00 KiB @  28.83 KiB/s (took 4s)
  Programming ✔ 100% [####################] 108.00 KiB @  18.87 KiB/s (took 6s)                                                                                                                                                                                                                                                     Finished in 9.47s
0.000000 INFO  Hello World!
└─ ble_keyboard_peripheral_builder::____embassy_main_task::{async_fn#0} @ examples/src/bin/ble_keyboard_peripheral_builder.rs:447 
0.000000 INFO  softdevice RAM: 31496 bytes
└─ nrf_softdevice::softdevice::{impl#0}::enable @ nrf-softdevice/src/fmt.rs:138 
0.000000 WARN  You're giving more RAM to the softdevice than needed. You can change your app's RAM start address to 20007b08
└─ nrf_softdevice::softdevice::{impl#0}::enable @ nrf-softdevice/src/fmt.rs:151 
0.000000 TRACE ble evt 16
└─ nrf_softdevice::ble::on_evt @ nrf-softdevice/src/fmt.rs:112 
0.000000 DEBUG conn_params conn_sup_timeout=500 max_conn_interval=36 min_conn_interval=36 slave_latency=0
└─ nrf_softdevice::ble::gap::on_evt @ nrf-softdevice/src/fmt.rs:125 
0.000000 DEBUG connected role=Peripheral peer_addr=RandomPrivateResolvable:[72, e6, 76, 24, 1f, 7a]
└─ nrf_softdevice::ble::peripheral::advertise_inner::{async_fn#0}::{closure#1} @ nrf-softdevice/src/fmt.rs:125 
0.000000 TRACE conn 0: connected
└─ nrf_softdevice::ble::connection::{impl#15}::new::{closure#0} @ nrf-softdevice/src/fmt.rs:112 
0.000000 INFO  advertising done!
└─ ble_keyboard_peripheral_builder::____embassy_main_task::{async_fn#0} @ examples/src/bin/ble_keyboard_peripheral_builder.rs:517 
0.000000 TRACE ble evt 19
└─ nrf_softdevice::ble::on_evt @ nrf-softdevice/src/fmt.rs:112 
0.000000 TRACE ble evt sec params request conn=3, bond=1, io_caps=4, keypress=0, lesc=1, mitm=1, oob=0, key_size=0..=16
└─ nrf_softdevice::ble::gap::on_evt @ nrf-softdevice/src/fmt.rs:112 
0.000000 TRACE ble evt 25
└─ nrf_softdevice::ble::on_evt @ nrf-softdevice/src/fmt.rs:112 
0.000000 TRACE ble evt auth status: bonded=0, error_src=1, lesc=0, kdist_own=0, kdist_peer=0
└─ nrf_softdevice::ble::gap::on_evt @ nrf-softdevice/src/fmt.rs:112 
0.000000 TRACE ble evt 17
└─ nrf_softdevice::ble::on_evt @ nrf-softdevice/src/fmt.rs:112 
0.000000 TRACE on_disconnected conn_handle=3
└─ nrf_softdevice::ble::gap::on_evt @ nrf-softdevice/src/fmt.rs:112 
0.000000 TRACE conn 0: disconnected
└─ nrf_softdevice::ble::connection::{impl#12}::on_disconnected @ nrf-softdevice/src/fmt.rs:112 
0.000000 INFO  gatt_server run exited with error: DisconnectedError
└─ ble_keyboard_peripheral_builder::____embassy_main_task::{async_fn#0} @ examples/src/bin/ble_keyboard_peripheral_builder.rs:522 
0.000000 TRACE conn 0: dropped, already disconnected
└─ nrf_softdevice::ble::connection::{impl#13}::drop::{closure#0} @ nrf-softdevice/src/fmt.rs:112

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions