From 4aca7c8811b70e420280893784cdad2acbe326f9 Mon Sep 17 00:00:00 2001 From: goueslati Date: Mon, 10 Jul 2023 16:54:48 +0100 Subject: wip --- examples/stm32wb/.cargo/config.toml | 4 +- examples/stm32wb/Cargo.toml | 6 +- examples/stm32wb/src/bin/tl_mbox_mac_2.rs | 117 ++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 examples/stm32wb/src/bin/tl_mbox_mac_2.rs (limited to 'examples') diff --git a/examples/stm32wb/.cargo/config.toml b/examples/stm32wb/.cargo/config.toml index 8b6d6d754..cf62a10a0 100644 --- a/examples/stm32wb/.cargo/config.toml +++ b/examples/stm32wb/.cargo/config.toml @@ -1,7 +1,7 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] # replace STM32WB55CCUx with your chip as listed in `probe-rs chip list` -# runner = "probe-rs run --chip STM32WB55RGVx --speed 1000 --connect-under-reset" -runner = "teleprobe local run --chip STM32WB55RG --elf" +runner = "probe-run --chip STM32WB55RGVx --speed 1000 --connect-under-reset" +# runner = "teleprobe local run --chip STM32WB55RG --elf" [build] target = "thumbv7em-none-eabihf" diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index 203ca1486..109734546 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml @@ -23,7 +23,7 @@ heapless = { version = "0.7.5", default-features = false } [features] -default = ["ble"] +default = ["ble", "mac"] mac = ["embassy-stm32-wpan/mac"] ble = ["embassy-stm32-wpan/ble"] @@ -35,6 +35,10 @@ required-features = ["ble"] name = "tl_mbox_mac" required-features = ["mac"] +[[bin]] +name = "tl_mbox_mac_2" +required-features = ["mac"] + [[bin]] name = "eddystone_beacon" required-features = ["ble"] diff --git a/examples/stm32wb/src/bin/tl_mbox_mac_2.rs b/examples/stm32wb/src/bin/tl_mbox_mac_2.rs new file mode 100644 index 000000000..e069adf87 --- /dev/null +++ b/examples/stm32wb/src/bin/tl_mbox_mac_2.rs @@ -0,0 +1,117 @@ +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] + +use defmt::*; +use embassy_executor::Spawner; +use embassy_stm32::bind_interrupts; +use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; +use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, MacAddress, ResetRequest, SetRequest}; +use embassy_stm32_wpan::sub::mm; +use embassy_stm32_wpan::TlMbox; +use {defmt_rtt as _, panic_probe as _}; + +bind_interrupts!(struct Irqs{ + IPCC_C1_RX => ReceiveInterruptHandler; + IPCC_C1_TX => TransmitInterruptHandler; +}); + +#[embassy_executor::task] +async fn run_mm_queue(memory_manager: mm::MemoryManager) { + memory_manager.run_queue().await; +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + /* + How to make this work: + + - Obtain a NUCLEO-STM32WB55 from your preferred supplier. + - Download and Install STM32CubeProgrammer. + - Download stm32wb5x_FUS_fw.bin, stm32wb5x_BLE_Stack_full_fw.bin, and Release_Notes.html from + gh:STMicroelectronics/STM32CubeWB@2234d97/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x + - Open STM32CubeProgrammer + - On the right-hand pane, click "firmware upgrade" to upgrade the st-link firmware. + - Once complete, click connect to connect to the device. + - On the left hand pane, click the RSS signal icon to open "Firmware Upgrade Services". + - In the Release_Notes.html, find the memory address that corresponds to your device for the stm32wb5x_FUS_fw.bin file + - Select that file, the memory address, "verify download", and then "Firmware Upgrade". + - Once complete, in the Release_Notes.html, find the memory address that corresponds to your device for the + stm32wb5x_BLE_Stack_full_fw.bin file. It should not be the same memory address. + - Select that file, the memory address, "verify download", and then "Firmware Upgrade". + - Select "Start Wireless Stack". + - Disconnect from the device. + - In the examples folder for stm32wb, modify the memory.x file to match your target device. + - Run this example. + + Note: extended stack versions are not supported at this time. Do not attempt to install a stack with "extended" in the name. + */ + + let p = embassy_stm32::init(Default::default()); + info!("Hello World!"); + + let config = Config::default(); + let mbox = TlMbox::init(p.IPCC, Irqs, config); + + spawner.spawn(run_mm_queue(mbox.mm_subsystem)).unwrap(); + + let sys_event = mbox.sys_subsystem.read().await; + info!("sys event: {}", sys_event.payload()); + + core::mem::drop(sys_event); + + let result = mbox.sys_subsystem.shci_c2_mac_802_15_4_init().await; + info!("initialized mac: {}", result); + + info!("resetting"); + let response = mbox + .mac_subsystem + .send_command(ResetRequest { set_default_pib: true }) + .await; + info!("{}", response); + + info!("setting extended address"); + let extended_address: u64 = 0xACDE480000000001; + defmt::debug!("{}", &extended_address as *const _ as *const u8); + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &extended_address as *const _ as *const u8, + pib_attribute: 0x6F, + stuffing: [0; 3], + }) + .await; + info!("{}", response); + + // info!("association request"); + // mbox.mac_subsystem + // .send_command(AssociateRequest { + // channel_number: 16, + // channel_page: 0, + // coord_addr_mode: 2, + // coord_address: MacAddress { short: [0x22, 0x11] }, + // capability_information: 0x80, + // coord_pan_id: [0xAA, 0x1A], + // security_level: 0, + + // key_id_mode: 0, + // key_index: 0, + // key_source: [0; 8], + // }) + // .await; + // info!("reading"); + // let result = mbox.mac_subsystem.read().await; + // info!("{}", result.payload()); + + // + // info!("starting ble..."); + // mbox.ble_subsystem.t_write(0x0c, &[]).await; + // + // info!("waiting for ble..."); + // let ble_event = mbox.ble_subsystem.tl_read().await; + // + // info!("ble event: {}", ble_event.payload()); + + info!("Test OK"); + cortex_m::asm::bkpt(); +} -- cgit From 6f4172fbc1280fdd9190ccddcf3cf6f25788c7be Mon Sep 17 00:00:00 2001 From: goueslati Date: Tue, 11 Jul 2023 16:07:33 +0100 Subject: wip: added MAC commands --- examples/stm32wb/Cargo.toml | 2 +- examples/stm32wb/src/bin/mac_ffd.rs | 174 ++++++++++++++++++++++++++++++ examples/stm32wb/src/bin/mac_rfd.rs | 116 ++++++++++++++++++++ examples/stm32wb/src/bin/tl_mbox_mac_2.rs | 117 -------------------- 4 files changed, 291 insertions(+), 118 deletions(-) create mode 100644 examples/stm32wb/src/bin/mac_ffd.rs create mode 100644 examples/stm32wb/src/bin/mac_rfd.rs delete mode 100644 examples/stm32wb/src/bin/tl_mbox_mac_2.rs (limited to 'examples') diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index 109734546..f23c8afa6 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml @@ -36,7 +36,7 @@ name = "tl_mbox_mac" required-features = ["mac"] [[bin]] -name = "tl_mbox_mac_2" +name = "mac_ffd" required-features = ["mac"] [[bin]] diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs new file mode 100644 index 000000000..4100d1ac5 --- /dev/null +++ b/examples/stm32wb/src/bin/mac_ffd.rs @@ -0,0 +1,174 @@ +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] + +use defmt::*; +use embassy_executor::Spawner; +use embassy_stm32::bind_interrupts; +use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; +use embassy_stm32_wpan::sub::mac::commands::{ResetRequest, SetRequest, StartRequest}; +use embassy_stm32_wpan::sub::mac::typedefs::PibId; +use embassy_stm32_wpan::sub::mm; +use embassy_stm32_wpan::TlMbox; +use {defmt_rtt as _, panic_probe as _}; + +bind_interrupts!(struct Irqs{ + IPCC_C1_RX => ReceiveInterruptHandler; + IPCC_C1_TX => TransmitInterruptHandler; +}); + +#[embassy_executor::task] +async fn run_mm_queue(memory_manager: mm::MemoryManager) { + memory_manager.run_queue().await; +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + /* + How to make this work: + + - Obtain a NUCLEO-STM32WB55 from your preferred supplier. + - Download and Install STM32CubeProgrammer. + - Download stm32wb5x_FUS_fw.bin, stm32wb5x_BLE_Stack_full_fw.bin, and Release_Notes.html from + gh:STMicroelectronics/STM32CubeWB@2234d97/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x + - Open STM32CubeProgrammer + - On the right-hand pane, click "firmware upgrade" to upgrade the st-link firmware. + - Once complete, click connect to connect to the device. + - On the left hand pane, click the RSS signal icon to open "Firmware Upgrade Services". + - In the Release_Notes.html, find the memory address that corresponds to your device for the stm32wb5x_FUS_fw.bin file + - Select that file, the memory address, "verify download", and then "Firmware Upgrade". + - Once complete, in the Release_Notes.html, find the memory address that corresponds to your device for the + stm32wb5x_BLE_Stack_full_fw.bin file. It should not be the same memory address. + - Select that file, the memory address, "verify download", and then "Firmware Upgrade". + - Select "Start Wireless Stack". + - Disconnect from the device. + - In the examples folder for stm32wb, modify the memory.x file to match your target device. + - Run this example. + + Note: extended stack versions are not supported at this time. Do not attempt to install a stack with "extended" in the name. + */ + + let p = embassy_stm32::init(Default::default()); + info!("Hello World!"); + + let config = Config::default(); + let mbox = TlMbox::init(p.IPCC, Irqs, config); + + spawner.spawn(run_mm_queue(mbox.mm_subsystem)).unwrap(); + + let sys_event = mbox.sys_subsystem.read().await; + info!("sys event: {}", sys_event.payload()); + + core::mem::drop(sys_event); + + let result = mbox.sys_subsystem.shci_c2_mac_802_15_4_init().await; + info!("initialized mac: {}", result); + + info!("resetting"); + let response = mbox + .mac_subsystem + .send_command(ResetRequest { set_default_pib: true }) + .await; + info!("{}", response); + + info!("setting extended address"); + let extended_address: u64 = 0xACDE480000000001; + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &extended_address as *const _ as *const u8, + pib_attribute: PibId::ExtendedAddress, + }) + .await; + info!("{}", response); + + info!("setting short address"); + let short_address: u16 = 0x1122; + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &short_address as *const _ as *const u8, + pib_attribute: PibId::ShortAddress, + }) + .await; + info!("{}", response); + + info!("setting association permit"); + let association_permit: bool = true; + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &association_permit as *const _ as *const u8, + pib_attribute: PibId::AssociationPermit, + }) + .await; + info!("{}", response); + + info!("setting TX power"); + let transmit_power: i8 = 2; + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &transmit_power as *const _ as *const u8, + pib_attribute: PibId::TransmitPower, + }) + .await; + info!("{}", response); + + info!("starting FFD device"); + let response = mbox + .mac_subsystem + .send_command(StartRequest { + channel_number: 16, + beacon_order: 0x0F, + superframe_order: 0x0F, + pan_coordinator: true, + battery_life_extension: false, + ..Default::default() + }) + .await; + info!("{}", response); + + info!("setting RX on when idle"); + let rx_on_while_idle: bool = true; + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &rx_on_while_idle as *const _ as *const u8, + pib_attribute: PibId::RxOnWhenIdle, + }) + .await; + info!("{}", response); + + // info!("association request"); + // mbox.mac_subsystem + // .send_command(AssociateRequest { + // channel_number: 16, + // channel_page: 0, + // coord_addr_mode: 2, + // coord_address: MacAddress { short: [0x22, 0x11] }, + // capability_information: 0x80, + // coord_pan_id: [0xAA, 0x1A], + // security_level: 0, + + // key_id_mode: 0, + // key_index: 0, + // key_source: [0; 8], + // }) + // .await; + // info!("reading"); + // let result = mbox.mac_subsystem.read().await; + // info!("{}", result.payload()); + + // + // info!("starting ble..."); + // mbox.ble_subsystem.t_write(0x0c, &[]).await; + // + // info!("waiting for ble..."); + // let ble_event = mbox.ble_subsystem.tl_read().await; + // + // info!("ble event: {}", ble_event.payload()); + + info!("Test OK"); + cortex_m::asm::bkpt(); +} diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs new file mode 100644 index 000000000..938fe754f --- /dev/null +++ b/examples/stm32wb/src/bin/mac_rfd.rs @@ -0,0 +1,116 @@ +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] + +use defmt::*; +use embassy_executor::Spawner; +use embassy_stm32::bind_interrupts; +use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; +use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, ResetRequest, SetRequest, StartRequest}; +use embassy_stm32_wpan::sub::mac::typedefs::{AddressMode, MacAddress, PibId}; +use embassy_stm32_wpan::sub::mm; +use embassy_stm32_wpan::TlMbox; +use {defmt_rtt as _, panic_probe as _}; + +bind_interrupts!(struct Irqs{ + IPCC_C1_RX => ReceiveInterruptHandler; + IPCC_C1_TX => TransmitInterruptHandler; +}); + +#[embassy_executor::task] +async fn run_mm_queue(memory_manager: mm::MemoryManager) { + memory_manager.run_queue().await; +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + /* + How to make this work: + + - Obtain a NUCLEO-STM32WB55 from your preferred supplier. + - Download and Install STM32CubeProgrammer. + - Download stm32wb5x_FUS_fw.bin, stm32wb5x_BLE_Stack_full_fw.bin, and Release_Notes.html from + gh:STMicroelectronics/STM32CubeWB@2234d97/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x + - Open STM32CubeProgrammer + - On the right-hand pane, click "firmware upgrade" to upgrade the st-link firmware. + - Once complete, click connect to connect to the device. + - On the left hand pane, click the RSS signal icon to open "Firmware Upgrade Services". + - In the Release_Notes.html, find the memory address that corresponds to your device for the stm32wb5x_FUS_fw.bin file + - Select that file, the memory address, "verify download", and then "Firmware Upgrade". + - Once complete, in the Release_Notes.html, find the memory address that corresponds to your device for the + stm32wb5x_BLE_Stack_full_fw.bin file. It should not be the same memory address. + - Select that file, the memory address, "verify download", and then "Firmware Upgrade". + - Select "Start Wireless Stack". + - Disconnect from the device. + - In the examples folder for stm32wb, modify the memory.x file to match your target device. + - Run this example. + + Note: extended stack versions are not supported at this time. Do not attempt to install a stack with "extended" in the name. + */ + + let p = embassy_stm32::init(Default::default()); + info!("Hello World!"); + + let config = Config::default(); + let mbox = TlMbox::init(p.IPCC, Irqs, config); + + spawner.spawn(run_mm_queue(mbox.mm_subsystem)).unwrap(); + + let sys_event = mbox.sys_subsystem.read().await; + info!("sys event: {}", sys_event.payload()); + + core::mem::drop(sys_event); + + let result = mbox.sys_subsystem.shci_c2_mac_802_15_4_init().await; + info!("initialized mac: {}", result); + + info!("resetting"); + let response = mbox + .mac_subsystem + .send_command(ResetRequest { set_default_pib: true }) + .await; + info!("{}", response); + + info!("setting extended address"); + let extended_address: u64 = 0xACDE480000000002; + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &extended_address as *const _ as *const u8, + pib_attribute: PibId::ExtendedAddress, + }) + .await; + info!("{}", response); + + info!("assocation request"); + let response = mbox + .mac_subsystem + .send_command(AssociateRequest { + channel_number: 16, + channel_page: 0, + coord_addr_mode: AddressMode::Short, + coord_address: MacAddress { short: [0x22, 0x11] }, + capability_information: 0x80, + coord_pan_id: [0xAA, 0x1A], + security_level: 0x00, + key_id_mode: 0, + key_source: [0; 8], + key_index: 0, + }) + .await; + info!("{}", response); + + info!("setting short address"); + let short: u64 = 0xACDE480000000002; + let response = mbox + .mac_subsystem + .send_command(SetRequest { + pib_attribute_ptr: &short as *const _ as *const u8, + pib_attribute: PibId::ShortAddress, + }) + .await; + info!("{}", response); + + info!("Test OK"); + cortex_m::asm::bkpt(); +} diff --git a/examples/stm32wb/src/bin/tl_mbox_mac_2.rs b/examples/stm32wb/src/bin/tl_mbox_mac_2.rs deleted file mode 100644 index e069adf87..000000000 --- a/examples/stm32wb/src/bin/tl_mbox_mac_2.rs +++ /dev/null @@ -1,117 +0,0 @@ -#![no_std] -#![no_main] -#![feature(type_alias_impl_trait)] - -use defmt::*; -use embassy_executor::Spawner; -use embassy_stm32::bind_interrupts; -use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; -use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, MacAddress, ResetRequest, SetRequest}; -use embassy_stm32_wpan::sub::mm; -use embassy_stm32_wpan::TlMbox; -use {defmt_rtt as _, panic_probe as _}; - -bind_interrupts!(struct Irqs{ - IPCC_C1_RX => ReceiveInterruptHandler; - IPCC_C1_TX => TransmitInterruptHandler; -}); - -#[embassy_executor::task] -async fn run_mm_queue(memory_manager: mm::MemoryManager) { - memory_manager.run_queue().await; -} - -#[embassy_executor::main] -async fn main(spawner: Spawner) { - /* - How to make this work: - - - Obtain a NUCLEO-STM32WB55 from your preferred supplier. - - Download and Install STM32CubeProgrammer. - - Download stm32wb5x_FUS_fw.bin, stm32wb5x_BLE_Stack_full_fw.bin, and Release_Notes.html from - gh:STMicroelectronics/STM32CubeWB@2234d97/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x - - Open STM32CubeProgrammer - - On the right-hand pane, click "firmware upgrade" to upgrade the st-link firmware. - - Once complete, click connect to connect to the device. - - On the left hand pane, click the RSS signal icon to open "Firmware Upgrade Services". - - In the Release_Notes.html, find the memory address that corresponds to your device for the stm32wb5x_FUS_fw.bin file - - Select that file, the memory address, "verify download", and then "Firmware Upgrade". - - Once complete, in the Release_Notes.html, find the memory address that corresponds to your device for the - stm32wb5x_BLE_Stack_full_fw.bin file. It should not be the same memory address. - - Select that file, the memory address, "verify download", and then "Firmware Upgrade". - - Select "Start Wireless Stack". - - Disconnect from the device. - - In the examples folder for stm32wb, modify the memory.x file to match your target device. - - Run this example. - - Note: extended stack versions are not supported at this time. Do not attempt to install a stack with "extended" in the name. - */ - - let p = embassy_stm32::init(Default::default()); - info!("Hello World!"); - - let config = Config::default(); - let mbox = TlMbox::init(p.IPCC, Irqs, config); - - spawner.spawn(run_mm_queue(mbox.mm_subsystem)).unwrap(); - - let sys_event = mbox.sys_subsystem.read().await; - info!("sys event: {}", sys_event.payload()); - - core::mem::drop(sys_event); - - let result = mbox.sys_subsystem.shci_c2_mac_802_15_4_init().await; - info!("initialized mac: {}", result); - - info!("resetting"); - let response = mbox - .mac_subsystem - .send_command(ResetRequest { set_default_pib: true }) - .await; - info!("{}", response); - - info!("setting extended address"); - let extended_address: u64 = 0xACDE480000000001; - defmt::debug!("{}", &extended_address as *const _ as *const u8); - let response = mbox - .mac_subsystem - .send_command(SetRequest { - pib_attribute_ptr: &extended_address as *const _ as *const u8, - pib_attribute: 0x6F, - stuffing: [0; 3], - }) - .await; - info!("{}", response); - - // info!("association request"); - // mbox.mac_subsystem - // .send_command(AssociateRequest { - // channel_number: 16, - // channel_page: 0, - // coord_addr_mode: 2, - // coord_address: MacAddress { short: [0x22, 0x11] }, - // capability_information: 0x80, - // coord_pan_id: [0xAA, 0x1A], - // security_level: 0, - - // key_id_mode: 0, - // key_index: 0, - // key_source: [0; 8], - // }) - // .await; - // info!("reading"); - // let result = mbox.mac_subsystem.read().await; - // info!("{}", result.payload()); - - // - // info!("starting ble..."); - // mbox.ble_subsystem.t_write(0x0c, &[]).await; - // - // info!("waiting for ble..."); - // let ble_event = mbox.ble_subsystem.tl_read().await; - // - // info!("ble event: {}", ble_event.payload()); - - info!("Test OK"); - cortex_m::asm::bkpt(); -} -- cgit From d5a4457b5e3a95a12f249315fb1d9b6a577307f2 Mon Sep 17 00:00:00 2001 From: goueslati Date: Wed, 12 Jul 2023 15:06:56 +0100 Subject: parsing MAC structs --- examples/stm32wb/src/bin/mac_ffd.rs | 101 +++++++++++++++--------------------- examples/stm32wb/src/bin/mac_rfd.rs | 14 ++--- 2 files changed, 50 insertions(+), 65 deletions(-) (limited to 'examples') diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs index 4100d1ac5..18b29362b 100644 --- a/examples/stm32wb/src/bin/mac_ffd.rs +++ b/examples/stm32wb/src/bin/mac_ffd.rs @@ -7,7 +7,7 @@ use embassy_executor::Spawner; use embassy_stm32::bind_interrupts; use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; use embassy_stm32_wpan::sub::mac::commands::{ResetRequest, SetRequest, StartRequest}; -use embassy_stm32_wpan::sub::mac::typedefs::PibId; +use embassy_stm32_wpan::sub::mac::typedefs::{MacChannel, PibId}; use embassy_stm32_wpan::sub::mm; use embassy_stm32_wpan::TlMbox; use {defmt_rtt as _, panic_probe as _}; @@ -65,109 +65,92 @@ async fn main(spawner: Spawner) { info!("initialized mac: {}", result); info!("resetting"); - let response = mbox - .mac_subsystem + mbox.mac_subsystem .send_command(ResetRequest { set_default_pib: true }) - .await; - info!("{}", response); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); info!("setting extended address"); let extended_address: u64 = 0xACDE480000000001; - let response = mbox - .mac_subsystem + mbox.mac_subsystem .send_command(SetRequest { pib_attribute_ptr: &extended_address as *const _ as *const u8, pib_attribute: PibId::ExtendedAddress, }) - .await; - info!("{}", response); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); info!("setting short address"); let short_address: u16 = 0x1122; - let response = mbox - .mac_subsystem + mbox.mac_subsystem .send_command(SetRequest { pib_attribute_ptr: &short_address as *const _ as *const u8, pib_attribute: PibId::ShortAddress, }) - .await; - info!("{}", response); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); info!("setting association permit"); let association_permit: bool = true; - let response = mbox - .mac_subsystem + mbox.mac_subsystem .send_command(SetRequest { pib_attribute_ptr: &association_permit as *const _ as *const u8, pib_attribute: PibId::AssociationPermit, }) - .await; - info!("{}", response); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); info!("setting TX power"); let transmit_power: i8 = 2; - let response = mbox - .mac_subsystem + mbox.mac_subsystem .send_command(SetRequest { pib_attribute_ptr: &transmit_power as *const _ as *const u8, pib_attribute: PibId::TransmitPower, }) - .await; - info!("{}", response); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); info!("starting FFD device"); - let response = mbox - .mac_subsystem + mbox.mac_subsystem .send_command(StartRequest { - channel_number: 16, + channel_number: MacChannel::Channel16, beacon_order: 0x0F, superframe_order: 0x0F, pan_coordinator: true, battery_life_extension: false, ..Default::default() }) - .await; - info!("{}", response); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); info!("setting RX on when idle"); let rx_on_while_idle: bool = true; - let response = mbox - .mac_subsystem + mbox.mac_subsystem .send_command(SetRequest { pib_attribute_ptr: &rx_on_while_idle as *const _ as *const u8, pib_attribute: PibId::RxOnWhenIdle, }) - .await; - info!("{}", response); - - // info!("association request"); - // mbox.mac_subsystem - // .send_command(AssociateRequest { - // channel_number: 16, - // channel_page: 0, - // coord_addr_mode: 2, - // coord_address: MacAddress { short: [0x22, 0x11] }, - // capability_information: 0x80, - // coord_pan_id: [0xAA, 0x1A], - // security_level: 0, - - // key_id_mode: 0, - // key_index: 0, - // key_source: [0; 8], - // }) - // .await; - // info!("reading"); - // let result = mbox.mac_subsystem.read().await; - // info!("{}", result.payload()); - - // - // info!("starting ble..."); - // mbox.ble_subsystem.t_write(0x0c, &[]).await; - // - // info!("waiting for ble..."); - // let ble_event = mbox.ble_subsystem.tl_read().await; - // - // info!("ble event: {}", ble_event.payload()); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); + + loop { + let evt = mbox.mac_subsystem.read().await; + defmt::info!("{:#x}", evt); + } info!("Test OK"); cortex_m::asm::bkpt(); diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs index 938fe754f..8042a3704 100644 --- a/examples/stm32wb/src/bin/mac_rfd.rs +++ b/examples/stm32wb/src/bin/mac_rfd.rs @@ -7,7 +7,9 @@ use embassy_executor::Spawner; use embassy_stm32::bind_interrupts; use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, ResetRequest, SetRequest, StartRequest}; -use embassy_stm32_wpan::sub::mac::typedefs::{AddressMode, MacAddress, PibId}; +use embassy_stm32_wpan::sub::mac::typedefs::{ + AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PibId, SecurityLevel, +}; use embassy_stm32_wpan::sub::mm; use embassy_stm32_wpan::TlMbox; use {defmt_rtt as _, panic_probe as _}; @@ -86,14 +88,14 @@ async fn main(spawner: Spawner) { let response = mbox .mac_subsystem .send_command(AssociateRequest { - channel_number: 16, + channel_number: MacChannel::Channel16, channel_page: 0, coord_addr_mode: AddressMode::Short, - coord_address: MacAddress { short: [0x22, 0x11] }, - capability_information: 0x80, + coord_address: MacAddress::Short([0x22, 0x11]), + capability_information: Capabilities::ALLOCATE_ADDRESS, coord_pan_id: [0xAA, 0x1A], - security_level: 0x00, - key_id_mode: 0, + security_level: SecurityLevel::Unsecure, + key_id_mode: KeyIdMode::Implicite, key_source: [0; 8], key_index: 0, }) -- cgit From eccd2ecebf01753e70705a6ca1e21bc83b2c204c Mon Sep 17 00:00:00 2001 From: goueslati Date: Wed, 12 Jul 2023 16:49:37 +0100 Subject: change MacAddress to a union instead of an enum --- examples/stm32wb/src/bin/mac_ffd.rs | 18 ++++--- examples/stm32wb/src/bin/mac_rfd.rs | 94 +++++++++++++++++++++++-------------- 2 files changed, 67 insertions(+), 45 deletions(-) (limited to 'examples') diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs index 18b29362b..4e2578a21 100644 --- a/examples/stm32wb/src/bin/mac_ffd.rs +++ b/examples/stm32wb/src/bin/mac_ffd.rs @@ -66,7 +66,7 @@ async fn main(spawner: Spawner) { info!("resetting"); mbox.mac_subsystem - .send_command(ResetRequest { set_default_pib: true }) + .send_command(&ResetRequest { set_default_pib: true }) .await .unwrap(); let evt = mbox.mac_subsystem.read().await; @@ -75,7 +75,7 @@ async fn main(spawner: Spawner) { info!("setting extended address"); let extended_address: u64 = 0xACDE480000000001; mbox.mac_subsystem - .send_command(SetRequest { + .send_command(&SetRequest { pib_attribute_ptr: &extended_address as *const _ as *const u8, pib_attribute: PibId::ExtendedAddress, }) @@ -87,7 +87,7 @@ async fn main(spawner: Spawner) { info!("setting short address"); let short_address: u16 = 0x1122; mbox.mac_subsystem - .send_command(SetRequest { + .send_command(&SetRequest { pib_attribute_ptr: &short_address as *const _ as *const u8, pib_attribute: PibId::ShortAddress, }) @@ -99,7 +99,7 @@ async fn main(spawner: Spawner) { info!("setting association permit"); let association_permit: bool = true; mbox.mac_subsystem - .send_command(SetRequest { + .send_command(&SetRequest { pib_attribute_ptr: &association_permit as *const _ as *const u8, pib_attribute: PibId::AssociationPermit, }) @@ -111,7 +111,7 @@ async fn main(spawner: Spawner) { info!("setting TX power"); let transmit_power: i8 = 2; mbox.mac_subsystem - .send_command(SetRequest { + .send_command(&SetRequest { pib_attribute_ptr: &transmit_power as *const _ as *const u8, pib_attribute: PibId::TransmitPower, }) @@ -122,7 +122,8 @@ async fn main(spawner: Spawner) { info!("starting FFD device"); mbox.mac_subsystem - .send_command(StartRequest { + .send_command(&StartRequest { + pan_id: [0xAA, 0x1A], channel_number: MacChannel::Channel16, beacon_order: 0x0F, superframe_order: 0x0F, @@ -138,7 +139,7 @@ async fn main(spawner: Spawner) { info!("setting RX on when idle"); let rx_on_while_idle: bool = true; mbox.mac_subsystem - .send_command(SetRequest { + .send_command(&SetRequest { pib_attribute_ptr: &rx_on_while_idle as *const _ as *const u8, pib_attribute: PibId::RxOnWhenIdle, }) @@ -151,7 +152,4 @@ async fn main(spawner: Spawner) { let evt = mbox.mac_subsystem.read().await; defmt::info!("{:#x}", evt); } - - info!("Test OK"); - cortex_m::asm::bkpt(); } diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs index 8042a3704..e5f8d54c9 100644 --- a/examples/stm32wb/src/bin/mac_rfd.rs +++ b/examples/stm32wb/src/bin/mac_rfd.rs @@ -6,7 +6,8 @@ use defmt::*; use embassy_executor::Spawner; use embassy_stm32::bind_interrupts; use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; -use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, ResetRequest, SetRequest, StartRequest}; +use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, GetRequest, ResetRequest, SetRequest}; +use embassy_stm32_wpan::sub::mac::event::MacEvent; use embassy_stm32_wpan::sub::mac::typedefs::{ AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PibId, SecurityLevel, }; @@ -67,52 +68,75 @@ async fn main(spawner: Spawner) { info!("initialized mac: {}", result); info!("resetting"); - let response = mbox - .mac_subsystem - .send_command(ResetRequest { set_default_pib: true }) - .await; - info!("{}", response); + mbox.mac_subsystem + .send_command(&ResetRequest { set_default_pib: true }) + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + info!("{:#x}", evt); info!("setting extended address"); let extended_address: u64 = 0xACDE480000000002; - let response = mbox - .mac_subsystem - .send_command(SetRequest { + mbox.mac_subsystem + .send_command(&SetRequest { pib_attribute_ptr: &extended_address as *const _ as *const u8, pib_attribute: PibId::ExtendedAddress, }) - .await; - info!("{}", response); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + info!("{:#x}", evt); + + info!("getting extended address"); + mbox.mac_subsystem + .send_command(&GetRequest { + pib_attribute: PibId::ExtendedAddress, + }) + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + info!("{:#x}", evt); + + if let Ok(MacEvent::MlmeGetCnf(evt)) = evt { + if evt.pib_attribute_value_len == 8 { + let value = unsafe { core::ptr::read_unaligned(evt.pib_attribute_value_ptr as *const u64) }; + + info!("value {:#x}", value) + } + } info!("assocation request"); - let response = mbox - .mac_subsystem - .send_command(AssociateRequest { - channel_number: MacChannel::Channel16, - channel_page: 0, - coord_addr_mode: AddressMode::Short, - coord_address: MacAddress::Short([0x22, 0x11]), - capability_information: Capabilities::ALLOCATE_ADDRESS, - coord_pan_id: [0xAA, 0x1A], - security_level: SecurityLevel::Unsecure, - key_id_mode: KeyIdMode::Implicite, - key_source: [0; 8], - key_index: 0, - }) - .await; - info!("{}", response); + let a = AssociateRequest { + channel_number: MacChannel::Channel16, + channel_page: 0, + coord_addr_mode: AddressMode::Short, + coord_address: MacAddress { short: [34, 17] }, + capability_information: Capabilities::ALLOCATE_ADDRESS, + coord_pan_id: [0xAA, 0x1A], + security_level: SecurityLevel::Unsecure, + key_id_mode: KeyIdMode::Implicite, + key_source: [0; 8], + key_index: 152, + }; + info!("{}", a); + mbox.mac_subsystem.send_command(&a).await.unwrap(); + let evt = mbox.mac_subsystem.read().await; + info!("{:#x}", evt); info!("setting short address"); let short: u64 = 0xACDE480000000002; - let response = mbox - .mac_subsystem - .send_command(SetRequest { + mbox.mac_subsystem + .send_command(&SetRequest { pib_attribute_ptr: &short as *const _ as *const u8, pib_attribute: PibId::ShortAddress, }) - .await; - info!("{}", response); - - info!("Test OK"); - cortex_m::asm::bkpt(); + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + info!("{:#x}", evt); + + loop { + let evt = mbox.mac_subsystem.read().await; + info!("{:#x}", evt); + } } -- cgit From 3f0c8bafb060fdf81a677f0ec37d4db11e732266 Mon Sep 17 00:00:00 2001 From: goueslati Date: Thu, 13 Jul 2023 15:20:50 +0100 Subject: make it work, disgustingly --- examples/stm32wb/src/bin/mac_ffd.rs | 30 ++++++++++++++++++++++++++--- examples/stm32wb/src/bin/mac_rfd.rs | 38 ++++++++++++++++++++++++++++++++----- 2 files changed, 60 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs index 4e2578a21..37d36fcdd 100644 --- a/examples/stm32wb/src/bin/mac_ffd.rs +++ b/examples/stm32wb/src/bin/mac_ffd.rs @@ -6,8 +6,9 @@ use defmt::*; use embassy_executor::Spawner; use embassy_stm32::bind_interrupts; use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; -use embassy_stm32_wpan::sub::mac::commands::{ResetRequest, SetRequest, StartRequest}; -use embassy_stm32_wpan::sub::mac::typedefs::{MacChannel, PibId}; +use embassy_stm32_wpan::sub::mac::commands::{AssociateResponse, ResetRequest, SetRequest, StartRequest}; +use embassy_stm32_wpan::sub::mac::event::MacEvent; +use embassy_stm32_wpan::sub::mac::typedefs::{MacChannel, MacStatus, PanId, PibId, SecurityLevel}; use embassy_stm32_wpan::sub::mm; use embassy_stm32_wpan::TlMbox; use {defmt_rtt as _, panic_probe as _}; @@ -123,7 +124,7 @@ async fn main(spawner: Spawner) { info!("starting FFD device"); mbox.mac_subsystem .send_command(&StartRequest { - pan_id: [0xAA, 0x1A], + pan_id: PanId([0x1A, 0xAA]), channel_number: MacChannel::Channel16, beacon_order: 0x0F, superframe_order: 0x0F, @@ -151,5 +152,28 @@ async fn main(spawner: Spawner) { loop { let evt = mbox.mac_subsystem.read().await; defmt::info!("{:#x}", evt); + + if let Ok(evt) = evt { + match evt { + MacEvent::MlmeAssociateInd(association) => mbox + .mac_subsystem + .send_command(&AssociateResponse { + device_address: association.device_address, + assoc_short_address: [0x33, 0x44], + status: MacStatus::Success, + security_level: SecurityLevel::Unsecure, + ..Default::default() + }) + .await + .unwrap(), + MacEvent::McpsDataInd(data_ind) => { + let data_addr = data_ind.msdu_ptr; + let mut a = [0u8; 256]; + unsafe { data_addr.copy_to(&mut a as *mut _, data_ind.msdu_length as usize) } + info!("{}", a[..data_ind.msdu_length as usize]) + } + _ => {} + } + } } } diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs index e5f8d54c9..756709132 100644 --- a/examples/stm32wb/src/bin/mac_rfd.rs +++ b/examples/stm32wb/src/bin/mac_rfd.rs @@ -6,10 +6,10 @@ use defmt::*; use embassy_executor::Spawner; use embassy_stm32::bind_interrupts; use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; -use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, GetRequest, ResetRequest, SetRequest}; +use embassy_stm32_wpan::sub::mac::commands::{AssociateRequest, DataRequest, GetRequest, ResetRequest, SetRequest}; use embassy_stm32_wpan::sub::mac::event::MacEvent; use embassy_stm32_wpan::sub::mac::typedefs::{ - AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PibId, SecurityLevel, + AddressMode, Capabilities, KeyIdMode, MacAddress, MacChannel, PanId, PibId, SecurityLevel, }; use embassy_stm32_wpan::sub::mm; use embassy_stm32_wpan::TlMbox; @@ -112,7 +112,7 @@ async fn main(spawner: Spawner) { coord_addr_mode: AddressMode::Short, coord_address: MacAddress { short: [34, 17] }, capability_information: Capabilities::ALLOCATE_ADDRESS, - coord_pan_id: [0xAA, 0x1A], + coord_pan_id: PanId([0x1A, 0xAA]), security_level: SecurityLevel::Unsecure, key_id_mode: KeyIdMode::Implicite, key_source: [0; 8], @@ -123,11 +123,16 @@ async fn main(spawner: Spawner) { let evt = mbox.mac_subsystem.read().await; info!("{:#x}", evt); + let short_addr = if let Ok(MacEvent::MlmeAssociateCnf(conf)) = evt { + conf.assoc_short_address + } else { + defmt::panic!() + }; + info!("setting short address"); - let short: u64 = 0xACDE480000000002; mbox.mac_subsystem .send_command(&SetRequest { - pib_attribute_ptr: &short as *const _ as *const u8, + pib_attribute_ptr: &short_addr as *const _ as *const u8, pib_attribute: PibId::ShortAddress, }) .await @@ -135,6 +140,29 @@ async fn main(spawner: Spawner) { let evt = mbox.mac_subsystem.read().await; info!("{:#x}", evt); + info!("sending data"); + let mut data_buffer = [0u8; 256]; + let data = b"Hello from embassy!"; + data_buffer[..data.len()].copy_from_slice(data); + mbox.mac_subsystem + .send_command(&DataRequest { + src_addr_mode: AddressMode::Short, + dst_addr_mode: AddressMode::Short, + dst_pan_id: PanId::BROADCAST, + dst_address: MacAddress::BROADCAST, + msdu_handle: 0x02, + ack_tx: 0x00, + gts_tx: false, + msdu_ptr: &data_buffer as *const _ as *const u8, + msdu_length: data.len() as u8, + security_level: SecurityLevel::Unsecure, + ..Default::default() + }) + .await + .unwrap(); + let evt = mbox.mac_subsystem.read().await; + info!("{:#x}", evt); + loop { let evt = mbox.mac_subsystem.read().await; info!("{:#x}", evt); -- cgit From f90b170dad91848d5a0ff746d873bd8a4ce7e91f Mon Sep 17 00:00:00 2001 From: goueslati Date: Thu, 13 Jul 2023 16:29:29 +0100 Subject: cleanup --- examples/stm32wb/.cargo/config.toml | 4 ++-- examples/stm32wb/src/bin/mac_ffd.rs | 10 +++++++--- examples/stm32wb/src/bin/mac_rfd.rs | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/stm32wb/.cargo/config.toml b/examples/stm32wb/.cargo/config.toml index cf62a10a0..51c499ee7 100644 --- a/examples/stm32wb/.cargo/config.toml +++ b/examples/stm32wb/.cargo/config.toml @@ -1,7 +1,7 @@ [target.'cfg(all(target_arch = "arm", target_os = "none"))'] # replace STM32WB55CCUx with your chip as listed in `probe-rs chip list` -runner = "probe-run --chip STM32WB55RGVx --speed 1000 --connect-under-reset" -# runner = "teleprobe local run --chip STM32WB55RG --elf" +# runner = "probe-run --chip STM32WB55RGVx --speed 1000 --connect-under-reset" +runner = "teleprobe local run --chip STM32WB55RG --elf" [build] target = "thumbv7em-none-eabihf" diff --git a/examples/stm32wb/src/bin/mac_ffd.rs b/examples/stm32wb/src/bin/mac_ffd.rs index 37d36fcdd..689a28353 100644 --- a/examples/stm32wb/src/bin/mac_ffd.rs +++ b/examples/stm32wb/src/bin/mac_ffd.rs @@ -168,9 +168,13 @@ async fn main(spawner: Spawner) { .unwrap(), MacEvent::McpsDataInd(data_ind) => { let data_addr = data_ind.msdu_ptr; - let mut a = [0u8; 256]; - unsafe { data_addr.copy_to(&mut a as *mut _, data_ind.msdu_length as usize) } - info!("{}", a[..data_ind.msdu_length as usize]) + let mut data = [0u8; 256]; + unsafe { data_addr.copy_to(&mut data as *mut _, data_ind.msdu_length as usize) } + info!("{}", data[..data_ind.msdu_length as usize]); + + if &data[..data_ind.msdu_length as usize] == b"Hello from embassy!" { + info!("success"); + } } _ => {} } diff --git a/examples/stm32wb/src/bin/mac_rfd.rs b/examples/stm32wb/src/bin/mac_rfd.rs index 756709132..ea349f9a8 100644 --- a/examples/stm32wb/src/bin/mac_rfd.rs +++ b/examples/stm32wb/src/bin/mac_rfd.rs @@ -148,7 +148,7 @@ async fn main(spawner: Spawner) { .send_command(&DataRequest { src_addr_mode: AddressMode::Short, dst_addr_mode: AddressMode::Short, - dst_pan_id: PanId::BROADCAST, + dst_pan_id: PanId([0x1A, 0xAA]), dst_address: MacAddress::BROADCAST, msdu_handle: 0x02, ack_tx: 0x00, -- cgit From 3705b4f40d206490a5165a287791206ac70573d9 Mon Sep 17 00:00:00 2001 From: xoviat Date: Sat, 15 Jul 2023 14:38:02 -0500 Subject: rustfmt --- examples/stm32wb/src/bin/eddystone_beacon.rs | 2 +- examples/stm32wb/src/bin/gatt_server.rs | 2 +- examples/stm32wb/src/bin/tl_mbox_ble.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/stm32wb/src/bin/eddystone_beacon.rs b/examples/stm32wb/src/bin/eddystone_beacon.rs index b99f8cb2e..451bd7d29 100644 --- a/examples/stm32wb/src/bin/eddystone_beacon.rs +++ b/examples/stm32wb/src/bin/eddystone_beacon.rs @@ -63,7 +63,7 @@ async fn main(_spawner: Spawner) { let sys_event = mbox.sys_subsystem.read().await; info!("sys event: {}", sys_event.payload()); - mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; + let _ = mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; info!("resetting BLE..."); mbox.ble_subsystem.reset().await; diff --git a/examples/stm32wb/src/bin/gatt_server.rs b/examples/stm32wb/src/bin/gatt_server.rs index 7621efb11..0f6419d45 100644 --- a/examples/stm32wb/src/bin/gatt_server.rs +++ b/examples/stm32wb/src/bin/gatt_server.rs @@ -71,7 +71,7 @@ async fn main(_spawner: Spawner) { let sys_event = mbox.sys_subsystem.read().await; info!("sys event: {}", sys_event.payload()); - mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; + let _ = mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; info!("resetting BLE..."); mbox.ble_subsystem.reset().await; diff --git a/examples/stm32wb/src/bin/tl_mbox_ble.rs b/examples/stm32wb/src/bin/tl_mbox_ble.rs index a511e89aa..90349422e 100644 --- a/examples/stm32wb/src/bin/tl_mbox_ble.rs +++ b/examples/stm32wb/src/bin/tl_mbox_ble.rs @@ -49,7 +49,7 @@ async fn main(_spawner: Spawner) { let sys_event = mbox.sys_subsystem.read().await; info!("sys event: {}", sys_event.payload()); - mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; + let _ = mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; info!("starting ble..."); mbox.ble_subsystem.tl_write(0x0c, &[]).await; -- cgit