Using @matheo-lucak 's fork of rust-radio-sx127x I finally have some examples compiling with embedded-hal-1.0.0 on stm32f4xx_hal and forks/branches of stm32g4xx_hal and stm32h7xx_hal. (Details are reported with other examples at https://github.com/pdgilbert/rust-integration-testing/actions . See jobs eg(lora_spi* in the workflow runs.)
The lora_spi_send and lora_spi_receive examples compile with all three hals. The lora_spi_gps example does not compile on stm32f4xx_hal because the embedded-io traits are not implemented. (See https://github.com/stm32-rs/stm32f4xx-hal/issues/721.) It compiles but probably does not work yet withstm32g4xx_hal and stm32h7xx_hal. I need to rework some logic for the change to embedded-io traits. Nothing has yet been tested on hardware.
One problem that I found subtle is the need for common versions for traits to work properly. In particular I had trouble with Transmit and Receive traits. For example, in my Cargo.toml I need
Click to expand compiling error
```
...
error[E0599]: no method named `start_transmit` found for struct `Sx127x` in the current scope
--> examples/radio-sx127x/lora_spi_send.rs:94:14
|
94 | lora.start_transmit(message).unwrap(); // should handle error
| ^^^^^^^^^^^^^^ method not found in `Sx127x, ..., ..., ..., ..., ...>>`
|
::: /home/paul/.cargo/git/checkouts/radio-hal-f38ece0492420e67/7aade85/src/lib.rs:39:8
|
39 | fn start_transmit(&mut self, data: &[u8]) -> Result<(), Self::Error>;
| -------------- the method is available for
...
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
45 + use radio::Transmit;
|
...
warning: unused import: `radio::Transmit`
--> examples/radio-sx127x/lora_spi_send.rs:57:5
|
57 | use radio::Transmit;
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
...
```
Is it possible radio-sx127x can re-export radio traits so I can manage this problem by using traites from radio-sx127x rather than from radio?
(BTW I have closed several old issues that are out-of-date. Thanks for all your help on those @ryankurte)
Using @matheo-lucak 's fork of
rust-radio-sx127x
I finally have some examples compiling withembedded-hal-1.0.0
onstm32f4xx_hal
and forks/branches ofstm32g4xx_hal
andstm32h7xx_hal
. (Details are reported with other examples at https://github.com/pdgilbert/rust-integration-testing/actions . See jobseg(lora_spi*
in the workflow runs.)The
lora_spi_send
andlora_spi_receive
examples compile with all three hals. Thelora_spi_gps
example does not compile onstm32f4xx_hal
because theembedded-io
traits are not implemented. (See https://github.com/stm32-rs/stm32f4xx-hal/issues/721.) It compiles but probably does not work yet withstm32g4xx_hal
andstm32h7xx_hal
. I need to rework some logic for the change toembedded-io
traits. Nothing has yet been tested on hardware.One problem that I found subtle is the need for common versions for traits to work properly. In particular I had trouble with
Transmit
andReceive
traits. For example, in myCargo.toml
I needwhich specifies that the
radio
rev is the same as that used byradio-sx127x
. If I do simplethe error messages can be very confusing:
Click to expand compiling error
``` ... error[E0599]: no method named `start_transmit` found for struct `Sx127x` in the current scope --> examples/radio-sx127x/lora_spi_send.rs:94:14 | 94 | lora.start_transmit(message).unwrap(); // should handle error | ^^^^^^^^^^^^^^ method not found in `Sx127xIs it possible
radio-sx127x
can re-exportradio
traits so I can manage this problem by using traites fromradio-sx127x
rather than fromradio
?(BTW I have closed several old issues that are out-of-date. Thanks for all your help on those @ryankurte)