Giter Site home page Giter Site logo

drogue-iot / drogue-device Goto Github PK

View Code? Open in Web Editor NEW
179.0 179.0 25.0 6.38 MB

A distribution of tools and examples for building embedded IoT applications in Rust

Home Page: https://drogue.io

License: Apache License 2.0

Rust 99.76% RPC 0.24%
async drogue-device embedded iot lora rust wifi

drogue-device's People

Contributors

bobmcwhirter avatar bors[bot] avatar ctron avatar danbev avatar dejanb avatar dependabot[bot] avatar jcrossley3 avatar lulf avatar lunarpulse avatar matoushybl avatar obabec avatar quentinmit avatar rukai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

drogue-device's Issues

WIFI AP mode

Are there any plans implementing support for Wifi AP mode?

Suggestion to add Config type to Board trait

This issue is more of a request for feedback on an suggestion to add a configuration type for the Board Trait.

Motivation

I wanted to add an example that uses USART1 for the STM32F072 Discovery Board that I'm using and I ran into an issue. What I wanted to do is to pass in a configuration object to the Board so that a user can specify which UART1 Port/Pin combinations that are available on this board that should be used. So a user can either use PA9 and PA10, or PB6 and PB7
when using USART1 on this board, and this was something that I thought would be useful to be able to configure.

Suggestion

After trying out different things ways to accomplish this I came up with the suggestion to add an associated type to
Board trait:

/// A board capable of creating itself using peripherals.                       
pub trait Board: Sized {                                                        
    type Peripherals;                                                           
    type Config;                                                                
                                                                                   
    fn new(peripherals: Self::Peripherals, config: Option<Self::Config>) -> Self;
}                                                                               

The Config type is new here and intended to allows a Board implementation to optionally have a config type specifically for that board, for example Stm32f072bDisco:

impl Board for Stm32f072bDisco<'_> {                                            
    type Peripherals = embassy_stm32::Peripherals;                              
    type Config = Stm32f072bDiscoConfig;                                        
                                                                                
    fn new(p: Self::Peripherals, config: Option<Self::Config>) -> Self {        
        let usart1 = match config {                                             
            None => None,                                                       
            Some(board_config) => match board_config.uart_config {              
                UartConfig::Uart1PortA => Some(Uart::new(                       
                    p.USART1,                                                   
                    p.PA10,                                                     
                    p.PA9,                                                      
                    NoDma,                                                      
                    NoDma,                                                      
                    Config::default(),                                          
                )),                                                             
                UartConfig::Uart1PortB => Some(Uart::new(                       
                    p.USART1,                                                   
                    p.PB7,                                                      
                    p.PB6,                                                      
                    NoDma,                                                      
                    NoDma,                                                      
                    Config::default(),                                          
                )),                                                             
            },                                                                  
        };                                                                      
        ...                                                                     

This configuration can then be used by an application like this:

#[embassy::main(config = "config()")]                                           
async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) {           
    let board_config = BoardConfig { uart_config: Uart1PortB};                  
    let mut usart1 = BSP::new(p, Some(board_config)).0.usart1.unwrap();         
                                                                                
    usart1.bwrite_all(b"STM32F072B Discovery Board UART Example\r\n").unwrap(); 
    usart1.bwrite_all(Stm32f072bDisco::uart_description(&board_config.uart_config)).unwrap();
}                                                                               

Example implementation

uart-example

To run the uart example first start minicom in a terminal:

$ minicom --baudrate 115200 --device /dev/ttyUSB0                               

Next run the uart example:

$ cd drogue-device/examples/stm32f0/stm32f072b-disco/uart                       
$ cargo run                                                                     
    Finished dev [optimized + debuginfo] target(s) in 0.12s                     
     Running `probe-run --chip STM32F072R8Tx /home/danielbevenius/work/drougue/drogue-device/examples/stm32f0/stm32f072b-disco/target/thumbv6m-none-eabi/debug/stm32f072b-disco-uart`
(HOST) INFO  flashing program (24 pages / 24.00 KiB)                            
(HOST) INFO  success!                                                           
────────────────────────────────────────────────────────────────────────────────

And in the minicom terminal the following output should be displayed:

Welcome to minicom 2.7.1                                                        
                                                                                
OPTIONS: I18n                                                                   
Compiled on Jan 26 2021, 00:00:00.                                              
Port /dev/ttyUSB0, 05:36:23
Press CTRL-A Z for help on special keys                                         
                                                                                
STM32F072B Discovery Board UART Example                                         
UART1 Tx: PB6, Rx: PB7                                                          

Questions

Since this suggestion added a second parameter to Board::new all of the existing boards would required to be updated and the examples. I've not done that in the above linked branch as I'm not sure if that is a valid change and wanted to ask here before doing anything more.

Create integration test for drogue-temperature app

Haivng an end to end test for the drogue-temperature app that uses the sandbox would be great, as it would allow us to validate

  • Drogue device
  • Drogue TLS
  • Drogue Temperature app

As of Drogue Cloud 0.8, the sandbox will support API keys for device management, which we can store in GH secrets and use in the test. The test would then

  • Create test app
  • Create test device
  • Start consumer
  • Run device sending temperature values
  • Await message to arrive at consumer and validate payload
  • Teardown device
  • Teardown app

Pico W example error linking

I am trying to get the example running on a Pico W, using the instuctions here: https://book.drogue.io/drogue-device/dev/examples/rp2040/pico-w/app/README.html

I am using the "Running with UF2 image" instuctions, and am getting an error on step 3

PS C:\GITRoot\drogue-device\examples\rp2040\pico-w\app> cargo build --release
   Compiling rp2040-pico-w v0.1.0 (C:\GITRoot\drogue-device\examples\rp2040\pico-w\app)
error: linking with `rust-lld` failed: exit code: 1
  |
  = note: "rust-lld" "-flavor" "gnu" "C:\\Users\\Gilbert\\AppData\\Local\\Temp\\rustcknm8GI\\symbols.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.0.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.1.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.10.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.11.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.12.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.13.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.14.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.15.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.2.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.3.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.4.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.5.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.6.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.7.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.8.rcgu.o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70.rp2040_pico_w.e1835cce-cgu.9.rcgu.o" "--as-needed" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\release\\deps" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\build\\rp2040-pico-w-78cc776101c1d519\\out" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\build\\cortex-m-7bcea78665f1282c\\out" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\build\\cortex-m-rt-a6d3bfd8a9140011\\out" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\build\\defmt-c50f544e84b25453\\out" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\build\\embassy-rp-da2508194ddd4bc7\\out" "-L" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\build\\rp2040-pac2-93954b094293253f\\out" "-L" "C:\\Users\\Gilbert\\.rustup\\toolchains\\nightly-2023-02-07-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib" "-Bstatic" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_boot_rp-3b8b1b98056898f6.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libserde_json_core-8de27e85733a083a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libryu-9273cabd98c5b5ec.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcyw43-fd98b42ede813140.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libnum_enum-eb7f19c44c112c4c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcortex_m_rt-27c0a11f7ef31675.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_usb_logger-c223e127e73dd37f.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\liblog-515917fd7e895b99.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_usb-8cc0b6e8fb29b6d9.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libusbd_hid-7bddb39af41de508.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libusb_device-668fc9d89a4b396a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libssmarshal-e24ee174b9cc5922.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libencode_unicode-cda6f2ee663585ca.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_net_driver_channel-7ce0e155af83d465.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libpanic_probe-2201b8d54e38b3b0.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_rp-3f07cbb5472bbfac.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_hal_nb-7c8dc5d0c0eecf02.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\librp2040_pac2-5aeb5d87d9b66b0c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_usb_driver-62af0156296510c7.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_futures-07462db31eea6cf9.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_cortex_m-7e833fa7853f48a3.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcortex_m-4a1efc5894d96eda.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libvolatile_register-5397e4c54c66d382.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libvcell-cc695925722ec002.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libbare_metal-19182d66d9d57fca.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_net-8231b1e3837ae3d1.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_hal_common-ac156deafc98c0a2.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libnum_traits-a0b286fd76d7eb0c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libsmoltcp-6bea5b56a754692f.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libmanaged-4d92a2b7cf6f7148.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_net_driver-e450a8e9ac8805bd.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_executor-26761d05ccfa2e2d.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libstatic_cell-581f11d4bed0c685.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libatomic_polyfill-eb54b7f80b021395.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libdrogue_device-a9382a2ef1dd0521.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libserde_cbor-d42d296ffae5e068.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libhalf-1bf4418e56556a3d.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_lora-0e21e299e6872480.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\liblorawan_device-85ca4de1d1cbbdcd.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\liblorawan-e7ce636a378ceed1.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcmac-15e53291953fd8ae.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libdbl-6ddf2c9f47890198.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcrypto_mac-951ee3e19f97344c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libaes-a4819aebeda7f41c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libaes_soft-a20d761dd1d2794a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcipher-3b698eadf6ea90b8.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libreqwless-b28d4f1581dfb09a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libhex-20365b9949cdb4c6.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libhttparse-c891f178b881d018.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libbase64-bc814efff231f37a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\librand_chacha-f2504b87d3f23c99.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libppv_lite86-3807ff4d3764d24a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libnourl-1bf9b3ea0ff80307.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_tls-5e7189251689931c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libp256-cee64eb3760cdf95.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libelliptic_curve-9622674f37a4cd65.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libsec1-0d6732b07fd5c174.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libder-9450bbd03f3b5ba7.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libconst_oid-38187427b5b086bd.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libbase16ct-becb22a71342cf81.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libhkdf-4531b668dfb547a3.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libhmac-523b96487a29db4e.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libgroup-050f9e720ce9c797.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libff-04eb6ca35c2417e3.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcrypto_bigint-afd77ec569cb9424.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libzeroize-77f944e326c4dec1.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libsha2-2cbe9de206567393.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libdigest-0c5e7c5d97600609.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libblock_buffer-71451b236ccee4b7.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libaes_gcm-34bdf003663608dd.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libctr-581e3deb11bc69af.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libghash-6c3952a0e554fd7c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libpolyval-2255f25cf28edec5.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libopaque_debug-358f5df949a17581.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libuniversal_hash-7333fda156453330.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libsubtle-ec6767d7e1a33b59.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libaes-e8955f6301c2bc7b.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcfg_if-45ba975d0123ce3a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcipher-b6b37ba361dfb4dc.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libinout-d6baa9a5d8e688e0.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libaead-d0d87dabdd13cf16.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcrypto_common-7a17e2fbb6416bee.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libgeneric_array-0200c28daa1c32b8.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libtypenum-dba814c1846b1a07.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\librand_core-c8a2ca5a4899dc36.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_time-4f0e7de31241e230.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_nal_async-c87c1fcac880ae7d.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libno_std_net-d7453722a35b6a86.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_nal-4e222a2e7565179c.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libno_std_net-2d41bb9545ba1e1f.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_update-cba816db6179ec43.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libfutures-1ad573b1d5088525.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libpostcard-0ace07cd6fbe384a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcobs-b7a611e5f9a2155f.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libserde-734109e47c326acd.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_embedded_hal-46d730a5d32d7218.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_sync-d9dcc67bbbc25b5e.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libfutures_util-6da3ee8b17c5a919.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libpin_project_lite-f4faa528038e2075.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libfutures_sink-a63fed04297963e2.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libfutures_task-5925c71374172cb9.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libpin_utils-1d5b75e921cab79b.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libfutures_core-4dd02731fc55c1ce.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_io-f4b9fc3d4b13bb39.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libheapless-e9c68ec21764af24.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libstable_deref_trait-9abf8ac45dde5995.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libatomic_polyfill-d36699f44c1bc909.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libhash32-4a37903663766a69.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libbyteorder-29ece460041ffc24.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_hal-2c731d20d9702cf7.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libvoid-9a8a18c9c6f04e76.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libnb-534500f77780a0cc.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libnb-085fa83dbad38f87.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembassy_boot-c27f564eac7d81a3.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libsignature-7e59badf5219036d.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_storage_async-33857e4f6ab952fc.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_storage-be7b8abdd54ae634.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_hal_async-dd7e6c3f73fae0d2.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libembedded_hal-f66c27e7a9e80743.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libdefmt_rtt-f4d1e9ad9840027e.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcritical_section-aece1a46de4da6c9.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libcritical_section-e884e0d6a2eaf54a.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libbare_metal-56942ed6ffb41e48.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libdefmt-f242fb94b4100761.rlib" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\libbitflags-fde50d0f756b751d.rlib" "C:\\Users\\Gilbert\\.rustup\\toolchains\\nightly-2023-02-07-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib\\librustc_std_workspace_core-ccb7dfa5e4c7fdc1.rlib" "C:\\Users\\Gilbert\\.rustup\\toolchains\\nightly-2023-02-07-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib\\libcore-afe3b1261452b8cb.rlib" "C:\\Users\\Gilbert\\.rustup\\toolchains\\nightly-2023-02-07-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib\\libcompiler_builtins-ba54ad513026d051.rlib" "-Bdynamic" "--eh-frame-hdr" "-znoexecstack" "-L" "C:\\Users\\Gilbert\\.rustup\\toolchains\\nightly-2023-02-07-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib" "-o" "C:\\GITRoot\\drogue-device\\examples\\rp2040\\pico-w\\app\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_pico_w-4901ca84cba3eb70" "--gc-sections" "-O1" "--nmagic" "-Tlink.x" "-Tdefmt.x"
  = note: rust-lld: warning: section type mismatch for .uninit.defmt-rtt.BUFFER
          >>> C:\GITRoot\drogue-device\examples\rp2040\pico-w\app\target\thumbv6m-none-eabi\release\deps\libdefmt_rtt-f4d1e9ad9840027e.rlib(defmt_rtt-f4d1e9ad9840027e.defmt_rtt.9049a59a-cgu.0.rcgu.o):(.uninit.defmt-rtt.BUFFER): SHT_PROGBITS
          >>> output section .uninit: SHT_NOBITS

          rust-lld: warning: section type mismatch for .got
          >>> <internal>:(.got): SHT_PROGBITS
          >>> output section .got: SHT_NOBITS

          rust-lld: warning: section type mismatch for .got.plt
          >>> <internal>:(.got.plt): SHT_PROGBITS
          >>> output section .got: SHT_NOBITS

          rust-lld: warning: section type mismatch for .got
          >>> <internal>:(.got): SHT_PROGBITS
          >>> output section .got: SHT_NOBITS

          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 98005 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102757 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102776 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102786 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102798 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102816 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102840 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102865 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102876 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102879 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102888 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102904 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102928 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102936 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102949 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 102980 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 103003 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 103012 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 103040 bytes
          rust-lld: error: section '.rodata' will not fit in region 'FLASH': overflowed by 103056 bytes
          rust-lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)


error: could not compile `rp2040-pico-w` due to previous error

SPI driver

We need a drogue-device driver for SPI that works on different boards.

Simplify actor API to simplify and improve efficiency

I'm going to focus on the NotifyHandler trait here, but arguments apply equally to the RequestHandler trait.

At present, an Actor have the ability to handle multiple message types by implementing a NotifyHandler for a given message type. This provides a lot of flexibility when implementing Actors, but there are a few implications of this model:

  • Actors can only process a single message at a time, so a notification handler must not block. When implementing actors, care must be taken to ensure processing of one message does not potentially block another, which can be
    counter-intuitive in a complex driver having multiple NotifyHandler implementations spread throughout the source code: any of these handlers cannot use an "unbounded" await if it also expects some event to happen that "unblocks" the awaited request.

  • ActorContext must Box incoming requests/messages, because it can be any type. This causes a need for heap to be used to store the messages in the actor context, rather than being able to allocate space for potential requests at compile time.

  • Most driver implementation packages have a separate component for handling interrupts (so that an interrupt cannot be blocked), an actor component that handles the incoming requests that may block, and sometimes a controller component in the middle that can do the 'background processing' to prevent the 'actor' component from blocking the processing logic.

With the above limitations, I think the current APIs and traits provide "too much" flexibility that cannot be utilized anyway.

An alternative model

Use associated types on actors to specify a RequestType and a ResponseType for an actor (default ()). The Actor trait could specify a default "on_request" implementation for this type actors that don't handle any incoming messages. Actors that handle messages can specify both the types and the handler implementation for those types.

Notify-style messages are also of the RequestType, but the Address<> API is still not async. The ActorContext will just disregard the response value.

Advantages:

  • Actor implementation can more easily be reasoned about since it is clear that only one on_request() can be blocking at a time.
  • No need to think about notify vs request from an implementation: A notify is just a request where response is ignored.
  • Should make way for some code and memory usage savings, I think ActorContext can now reserve space at compile time for incoming messages for a given actor.

The API towards the users is the Address<>, which encapsulates the actual message types sent to the actor, so all APIs in drogue-device would stay the same, and in the event of handling multiple requests, an enum would be used to support different message types.

Disadvantages:

  • Complex actors with request types and responses of different sizes will be forced to store the largest sizes. However, given that we have a way to deal with references to data now, I think it should be fine.

@bobmcwhirter ^^

Configure max message queue per ActorContext

At present, the message queue size of an actor is bound to its type using the MessageQueueSize associated type. Instead, having the size configured per ActorContext would allow tuning memory usage to an applications use case.

Unable to discern whether to use boards or device/src/bsp/boards

Hi there,

I'm looking to use this toolset and I'm having trouble figuring out which BSP to use. It seems like the top level boards file is newer but only by a month, and there's only a few minor differences I can tell (looking at the STM32L4 directory). Would you please be able to provide some guidance?

Consolidate config file compilation in examples to be more friendly

<BobMcWhirter[m]> how do I build this locally? what am I missing?
<BobMcWhirter[m]> thread 'main' panicked at 'Unable to locate config file
/Users/bob/repos/drogue-device/examples/nrf52/microbit/rak811/config/dev_eui.txt.',
rak811/build.rs:22:13
<BobMcWhirter[m]> I supposed I need that file, but I dunno the content or
format of it?
<BobMcWhirter[m]> All 3 really?
<BobMcWhirter[m]> To use this example, you need to create the files
config/dev_eui.txt, config/app_eui.txt, and
<BobMcWhirter[m]> config/app_key.txt to configure the device EUI,
application EUI, and application key for OTAA
<BobMcWhirter[m]> configuration of your device.
<@jcrossley3> empty might work?
<BobMcWhirter[m]> seems to
<BobMcWhirter[m]> plus wifi.�.txt and http..txt
<BobMcWhirter[m]> so many files
<JimCrossley[m]> yeah, it's a problem :)
<BobMcWhirter[m]> we should .gitkeep the config/ dirs also
<BobMcWhirter[m]> so I don't have to mkdir those before touching files
<JimCrossley[m]> or just commit empty ones?
<JimCrossley[m]> with CHANGE_ME's in there, if required?
<BobMcWhirter[m]> that'd be good, as it would denote the format that goes into
them also
<BobMcWhirter[m]> if we commit empty .txt files, we then need to .gitignore
them so we don't inadvertently checkin actual credentials
<BobMcWhirter[m]> and/or look for something in $HOME/.drogue
<BobMcWhirter[m]> outside of the tree
<BobMcWhirter[m]> bonus points if it a single .drogue/config.toml
<BobMcWhirter[m]> probably wouldn't work with the include_bytes! though, yeah?
<BobMcWhirter[m]> but we could make our own proc macro to process a .toml out
of tree and spew the bits.
<BobMcWhirter[m]> let ssid = drogue_config!(wifi.ssid)

wifi/esp8266 doesn't work with defmt

It looks like two issues are present:

  1. The wifi+esp feature includes log (which is not allowed and fails with a compiler error)
  2. Some types cannot be passed into defmt macros:
    error[E0277]: the trait bound `DriverError: Format` is not satisfied
       --> /home/jreimann/git/drogue-device/device/src/fmt.rs:164:13
        |
    164 |             ::defmt::error!($s $(, $x)*);
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Format` is not implemented for `DriverError`
    

A LoRa driver

A driver interface for LoRa devices and example implementation as well as chip example

Improve getting started experience

Current issues where we can improve

  • Taking the step from example to standalone crate (templates)
  • Simpler more understandable examples for basic things like blinky
  • Better example documentation both in code and readme (now included inline in book as of #237)

@ctron Iirc, you had some more points around actor documentation. Could you add those points here? There are some actor introcution in the 'Introduction', and a programmatic introduction in the 'Basic application' section of https://book.drogue.io/drogue-device/dev/index.html. But iirc you had some other valid points.

Drivers doc missing page title

When browsing the driver docs at https://book.drogue.io/drogue-device/dev/drivers.html, I noticed in my browser title bar (and anywhere it shows page titles, like in history), the title of the page is Untitled :: Drogue IoT . Ideally, that would be Drivers :: Drogue IoT to match the other pages, like Concepts :: Drogue IoT and Examples :: Drogue IoT.

I believe this is likely because there is not a top level = Drivers in docs/modules/ROOT/pages/drivers.adoc, but that's just a guess at how these page titles are generated.

Ability to run framework on desktop

Having the ability to run drogue-device on x86 allows testing some drivers using standard peripherals like UART/SPI on a PC rather than needing a microcontroller. It also allows for writing more integration-like tests, hooking drogue-device to drogue-cloud and verifying components that need to talk to drogue-cloud.

examples/std/cloud not works.

First the IP address look changed to [Ipv4(Address([34, 249, 85, 182])) and Ipv4(Address([34, 247, 113, 130]))]

But it not works if change to right IP address.

...
INFO  cloud] Response status: Forbidden

Add MQTT client

Having an async MQTT client that works with drogue cloud.

Use of `&'static mut self` is unsound

Very interesting project! :)

One thing that jumped at me while reading the blogpost is the use of &'static mut self. It's not sound since it allows the user to create multiple concurrent &mut's to the same data. For example you can "hold on" to self by storing it in a static. In the next call you get two &mut's to the same data, one from the static and another from self.

use cortex_m::interrupt::{Mutex, free};

static SAVED: Mutex<Cell<Option<&'static mut Foo>>> = Mutex::new(Cell::new(None));

impl NotifyHandler for Foo {
    fn on_notify(&'static mut self, message: State) -> Completion {
       free(|cs| {
           if let Some(self2) = SAVED.borrow(cs).get() {
                info!("Got two &mut's to the same data! {:?} {:?}", self, self2);
           } 
           SAVED.borrow(cs).set(Some(self)
       })
    }
}

Problems with STM32L432KCU

I am still having some issues with the STM32L432KCU. Also see: #42

Not having the embassy main end with loop {}, will case the following issue:

(HOST) INFO  flashing program (15.99 KiB)
(HOST) INFO  success!
(HOST) ERROR Max number of RTT attach retries exceeded.
Error: RTT control block not found in target memory.
- Make sure RTT is initialized on the target.
- Depending on the target, sleep modes can interfere with RTT.

Adding the loop will (obviously) however not run the rest of the program.

Structure of HAL vs driver vs API

@bobmcwhirter I think we are using HAL to mean both the API that drivers implement, and the API that drivers consume to access hardware-specific details. I suggest that we split these up so that we don't mingle these two concepts, and I think maybe this is what you attempted with the 'port' concept? IMO a good set of categories would be:

  • hal/ - low-level hardware-specific API + implementations (for stm32, nrf etc.).
  • api/ - Generic APIs for using peripherals. UART, SPI, Scheduler, Delayer, Arbiter, WiFi, LoRa etc.
  • driver/ - implementation of an API, that optionally uses a HAL (or APIs like embedded hal) and/or other APIs.

In practice, this would mean these renamings if we think about SPI and Timer only:

src/hal/spi/mod.rs -> src/api/spi.rs
src/driver/spi/mod.rs stays
src/hal/timer/mod.rs stays

Wdyt?

Alternatively, if we want to continue to use HAL to mean the API, maybe we can keep HAL as is, and introduce 'hardware' for the hardware-specific implementations (i.e. move hal/timer/*.rs to hardware/timer/), or something else (something other than port, I'm not sure I understand that name).

FWIW, I think this is a bit confusing in Rust Embedded in general. There is nrf-hal, stm-hal etc which I think corresponds to my definition of HAL. And then there is embedded_hal, which is really just APIs implemented by HALs.

Want to compile drogue-device\examples\stm32l0xx\lora-discovery - always get this error...

Hi,

I want to test the -stm32 with rust but get always following error...
Any idea?!

Thanks a lot.

Compiling serde_yaml v0.8.17
Compiling stm32-metapac-gen v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=c458ad52e698ae0e9810e90d094394bd3ab35c77#c458ad52)
Compiling stm32-metapac v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=c458ad52e698ae0e9810e90d094394bd3ab35c77#c458ad52)
Compiling embassy-stm32 v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=c458ad52e698ae0e9810e90d094394bd3ab35c77#c458ad52)
error: failed to run custom build command for embassy-stm32 v0.1.0 (https://github.com/embassy-rs/embassy.git?rev=c458ad52e698ae0e9810e90d094394bd3ab35c77#c458ad52)

Caused by:
process didn't exit successfully: C:\Users\cvoller\git\drogue-device\examples\stm32l0xx\lora-discovery\target\release\build\embassy-stm32-cce071716c42b90a\build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'failed to execute gen.py: Os { code: 2, kind: NotFound, message: "Das System kann die angegebene Datei nicht finden." }', C:\Users\cvoller.cargo\git\checkouts\embassy-9312dcb0ed774b29\c458ad5\embassy-stm32\build.rs:20:10
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Add CoAP client

A CoAP client that works with the upcoming drogue-cloud CoAP endpoint.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.