Open pdgilbert opened 8 months ago
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 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)