diff options
| author | xoviat <[email protected]> | 2023-06-18 18:51:14 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-06-18 18:51:14 -0500 |
| commit | b95c0210b83d0742fa4663b2726e4e7b82a4e068 (patch) | |
| tree | f088a1d83cd416807079330515ae7514c3e10991 /examples/stm32wb/src | |
| parent | 9f63158aad81486b4bd0ffe6f8d7103458ba360f (diff) | |
stm32/wpan: add draft mac mbox
Diffstat (limited to 'examples/stm32wb/src')
| -rw-r--r-- | examples/stm32wb/src/bin/tl_mbox_ble.rs (renamed from examples/stm32wb/src/bin/tl_mbox_tx_rx.rs) | 0 | ||||
| -rw-r--r-- | examples/stm32wb/src/bin/tl_mbox_mac.rs | 64 |
2 files changed, 64 insertions, 0 deletions
diff --git a/examples/stm32wb/src/bin/tl_mbox_tx_rx.rs b/examples/stm32wb/src/bin/tl_mbox_ble.rs index 439bd01ac..439bd01ac 100644 --- a/examples/stm32wb/src/bin/tl_mbox_tx_rx.rs +++ b/examples/stm32wb/src/bin/tl_mbox_ble.rs | |||
diff --git a/examples/stm32wb/src/bin/tl_mbox_mac.rs b/examples/stm32wb/src/bin/tl_mbox_mac.rs new file mode 100644 index 000000000..f13f260b5 --- /dev/null +++ b/examples/stm32wb/src/bin/tl_mbox_mac.rs | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![feature(type_alias_impl_trait)] | ||
| 4 | |||
| 5 | use defmt::*; | ||
| 6 | use embassy_executor::Spawner; | ||
| 7 | use embassy_stm32::bind_interrupts; | ||
| 8 | use embassy_stm32::ipcc::{Config, ReceiveInterruptHandler, TransmitInterruptHandler}; | ||
| 9 | use embassy_stm32_wpan::TlMbox; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | ||
| 11 | |||
| 12 | bind_interrupts!(struct Irqs{ | ||
| 13 | IPCC_C1_RX => ReceiveInterruptHandler; | ||
| 14 | IPCC_C1_TX => TransmitInterruptHandler; | ||
| 15 | }); | ||
| 16 | |||
| 17 | #[embassy_executor::main] | ||
| 18 | async fn main(_spawner: Spawner) { | ||
| 19 | /* | ||
| 20 | How to make this work: | ||
| 21 | |||
| 22 | - Obtain a NUCLEO-STM32WB55 from your preferred supplier. | ||
| 23 | - Download and Install STM32CubeProgrammer. | ||
| 24 | - Download stm32wb5x_FUS_fw.bin, stm32wb5x_BLE_Stack_full_fw.bin, and Release_Notes.html from | ||
| 25 | gh:STMicroelectronics/STM32CubeWB@2234d97/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x | ||
| 26 | - Open STM32CubeProgrammer | ||
| 27 | - On the right-hand pane, click "firmware upgrade" to upgrade the st-link firmware. | ||
| 28 | - Once complete, click connect to connect to the device. | ||
| 29 | - On the left hand pane, click the RSS signal icon to open "Firmware Upgrade Services". | ||
| 30 | - In the Release_Notes.html, find the memory address that corresponds to your device for the stm32wb5x_FUS_fw.bin file | ||
| 31 | - Select that file, the memory address, "verify download", and then "Firmware Upgrade". | ||
| 32 | - Once complete, in the Release_Notes.html, find the memory address that corresponds to your device for the | ||
| 33 | stm32wb5x_BLE_Stack_full_fw.bin file. It should not be the same memory address. | ||
| 34 | - Select that file, the memory address, "verify download", and then "Firmware Upgrade". | ||
| 35 | - Select "Start Wireless Stack". | ||
| 36 | - Disconnect from the device. | ||
| 37 | - In the examples folder for stm32wb, modify the memory.x file to match your target device. | ||
| 38 | - Run this example. | ||
| 39 | |||
| 40 | Note: extended stack versions are not supported at this time. Do not attempt to install a stack with "extended" in the name. | ||
| 41 | */ | ||
| 42 | |||
| 43 | let p = embassy_stm32::init(Default::default()); | ||
| 44 | info!("Hello World!"); | ||
| 45 | |||
| 46 | let config = Config::default(); | ||
| 47 | let mbox = TlMbox::init(p.IPCC, Irqs, config); | ||
| 48 | |||
| 49 | let sys_event = mbox.sys_subsystem.read().await; | ||
| 50 | info!("sys event: {}", sys_event.payload()); | ||
| 51 | |||
| 52 | // mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; | ||
| 53 | // | ||
| 54 | // info!("starting ble..."); | ||
| 55 | // mbox.ble_subsystem.write(0x0c, &[]).await; | ||
| 56 | // | ||
| 57 | // info!("waiting for ble..."); | ||
| 58 | // let ble_event = mbox.ble_subsystem.read().await; | ||
| 59 | // | ||
| 60 | // info!("ble event: {}", ble_event.payload()); | ||
| 61 | |||
| 62 | info!("Test OK"); | ||
| 63 | cortex_m::asm::bkpt(); | ||
| 64 | } | ||
