You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 stm32-rs/stm32f4xx-hal#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
...
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<Base<Spi<SPI1>, ..., ..., ..., ..., ...>>`
|
::: /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)
The text was updated successfully, but these errors were encountered:
The rust-iot/rust-radio-sx127x master branch seems to be stuck at embedded-hal-rc. I can compile @matheo-lucak 's fork embedded-hal-1.0 but am not having any luck getting it to work on hardware (using stm32f4xx_hal with blackpill stm32f411 and stm32g4xx_hal with weact-stm32g474). I forked it to try and debug with my examples, but no luck with that either.
Does anyone actually have this working? On what hardware? Any other suggestions? Thanks.
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 stm32-rs/stm32f4xx-hal#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
Is 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)
The text was updated successfully, but these errors were encountered: