ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
IlPalazzo-ojiisa has quit [Quit: Leaving.]
starblue has quit [Ping timeout: 246 seconds]
starblue has joined #rust-embedded
<M9names[m]> Not that I'm aware of, I usually just fall back to 8bit when I need 8bit
starblue has quit [Ping timeout: 272 seconds]
starblue has joined #rust-embedded
AugustoRoman[m] has quit [Quit: Idle timeout reached: 172800s]
enaut[m] has quit [Quit: Idle timeout reached: 172800s]
starblue has quit [Ping timeout: 264 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
jakzale has joined #rust-embedded
<jakzale> Does anyone know why rustup does not provide riscv32im-unknown-none-elf target?
mali[m] has joined #rust-embedded
<mali[m]> Is there a good guideline for error handling for embedded?
<mali[m]> Or is there a vague consensus?
<mali[m]> jakzale: are you on nightly? I remember some tagets being only available on some snapshots
<mali[m]> I see that that architecture has limited support?
<mali[m]> Found this: If the desired target is under Tier 2.5 or Tier 3 then it likely cannot be added directly via rustup and will required additional work.
<jakzale> maili[m]: I'm on nightly, which has risc32-i, -imac, -imafc, and -imc, but not -im.
<jakzale> https://doc.rust-lang.org/nightly/rustc/platform-support/riscv32-unknown-none-elf.html lists riscv32-im as tier 2, but for rustup it's tier 2.5, hmmm...
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<mali[m]> I remember that a particular nightly snapshot lacked the architecture that I needed, I had to select an earlier build.
<mali[m]> But in your case it seems to be an arch that is already a deprioritized
<jakzale> mali[m] thanks! I will try to switch to riscv32-imac then.
<mali[m]> I must give you a warning there, I am not entirely sure (:
<mali[m]> There might be others who develop pon RISC-V
<mali[m]> I just remember an instance from the past.
<mali[m]> Hazy
<mali[m]> <jakzale> "mali ⚡️ thanks! I will try to..." <- I see that there was a proposal https://github.com/rust-lang/compiler-team/issues/701
<M9names[m]> strange that it shows as tier2 in the rustc book but doesn't have core compiled...
<M9names[m]> you can just ask cargo to build core for riscv32im as part of your project build if you on nightly anyway
<mali[m]> that arch is not available in rustup target list
<mali[m]> but is available in riscv32im-unknown-none-elf
<mali[m]> * but is available in rustc --print target-list
<mali[m]> It smells like "you have to compile the toolchain for this target"
<M9names[m]> but that would mean it's not tier 2?
djdisodo[m] has joined #rust-embedded
<djdisodo[m]> unlike uart
<djdisodo[m]> spi and iic is provided with clock so it should be possible to make pure software driver for spi or iic that is stable
<djdisodo[m]> is there any one that's written using embedded-hal api?
<djdisodo[m]> or maybe embassy, to set lower bound for clock interval
<djdisodo[m]> dirbaio[m]: is there async version?
<dirbaio[m]> not afaik
<dirbaio[m]> but it doesn't make much sense, since it requires the cpu to be busy 100% of the time doing the bitbanging
<djdisodo[m]> dirbaio[m]: what if clock speed isn't that fast?
<JamesMunns[m]> djdisodo[m]: if you think it would be useful you could make one that is async! I think nobody has made it because nobody wanted it yet.
<JamesMunns[m]> (bitbang-hal isn't "official" either, just something neat someone made that fills that gap)
<M9names[m]> this was in the same stabilisation rfc and has rust-std built, but rv32im isn't.
<vollbrecht[m]> ah interesting link, here i see a tier2.5 for the first time. Is this tier2.5 targets without hosttools?
<M9names[m]> i think all it needs is to be added to [the dockerfile](https://github.com/rust-lang/rust/blob/master/src/ci/docker/host-x86_64/dist-various-1/Dockerfile)
<M9names[m]> <vollbrecht[m]> "ah interesting link, here i..." <- I don't think it is supposed to exist. see https://github.com/rust-lang/rust/issues/52715#issuecomment-527108105
dreamcat4 has joined #rust-embedded
orclev[m] has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has joined #rust-embedded
<dirbaio[m]> hmm why is GHA not running here? https://github.com/rust-embedded/qemu-exit/pull/31
<JamesMunns[m]> looks like it only runs on pushes to master and cron, not PRs?
<JamesMunns[m]> so when you MQ it, it'll run, but not on the PR itself
<JamesMunns[m]> ah, does the empty item means it runs on all PRs? I don't know gha syntax that well
<dirbaio[m]> I think so yes? it means "no conditions"
<JamesMunns[m]> I think you need to set a positive match? like branches: * or something?
<JamesMunns[m]> idk, again, not super familiar with it
<JamesMunns[m]> then: TIL and i'm out of ideas :D
<dirbaio[m]> i've force-merged the PR since it's only docs changes anyway
<dirbaio[m]> and gha is not running either for the commit on master :D
<dirbaio[m]> it's as if gha is completely off on that repo
<dirbaio[m]> repo settings look ok 🤷
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has quit [Quit: Leaving.]
kenny has quit [Quit: WeeChat 4.2.1]
_whitelogger has joined #rust-embedded
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
IlPalazzo-ojiis1 has joined #rust-embedded
cbjamo[m] has quit [Quit: Idle timeout reached: 172800s]
bartmassey[m] has quit [Quit: Idle timeout reached: 172800s]
AtleoS has quit [Read error: Connection reset by peer]
AtleoS has joined #rust-embedded
dne has quit [Read error: Connection reset by peer]
dne has joined #rust-embedded
<mali[m]> Long ago I had written an accelerometer device driver, I had written this:
<mali[m]> I sort of get this, but I am failing a bit on the Error definitions.
<mali[m]> I mean, I wrote it, but still I wrote it not fully grasping it
<mali[m]> Does this mean that this impl is valid for all Error E s that spi::Transfer and spi::Write Traits allow?
<mali[m]> * Does this mean that this impl is valid for all Error E s that spi::Transfer and spi::Write Traits allow?
<mali[m]> * Does this mean that this impl is valid for all Error E s that spi::Transfer and spi::Write Traits allow?
<mali[m]> Then whatever this Error type is, I return that type.
<mali[m]> Somehow PinError is also in the definition, the result is not of type `Result<, PinError>`
<mali[m]> I want to write explicit Errors like WrongID and raise them to the application
<Ecco> Dang, I'm fighting the type system
<Ecco> let mut spi = Spi::new_txonly(p.SPI1, p.PB4, p.PA15, NoDma, NoDma, spi_config);
<Ecco> What is the type of the spi variable here?
<Ecco> I'm trying to define a type alias to make my life easier, but I just can't figure out the original type of the "spi" variable
GrantM11235[m] has joined #rust-embedded
<GrantM11235[m]> Is this embassy-stm32? It should be something like `Spi<'static, SPI1, NoDma, NoDma>`
<Ecco> Hmm, indeed, it is. Thanks!
<Ecco> Did you just know? Or is there a way to figure that out?
<GrantM11235[m]> If you use rust-analyzer it should show up in your IDE
<GrantM11235[m]> You can also look up the docs for the function https://docs.embassy.dev/embassy-stm32/git/stm32c011d6/spi/struct.Spi.html#method.new_txonly
<GrantM11235[m]> That shows that the function returns `Self`, which in this case is `Spi<'d, T, Rx, Tx>` it also tells you that `T` is the type of `peri` function argument, `Tx` is `txdma`, and `Rx` is `rxdma`
<GrantM11235[m]> Normally you would see something like `peri: T`, but in this case it is `peri: impl Peripheral<P=T>`. That is a trick that embassy uses to allow you to construct the spi with either `p.SPI1` or `&mut p.SPI1`
<GrantM11235[m]> docs.embassy.dev shows the docs for the latest git version of the embassy crates, which might not be the same version that you are using. You can see a local version of the docs (for all your dependencies, not just embassy) by running cargo docs --show
adamgreig[m] has quit [Quit: Idle timeout reached: 172800s]
<Ecco> awesome, thank you so much!!!
timokrgr[m] has quit [Quit: Idle timeout reached: 172800s]
dne has quit [Remote host closed the connection]
dne has joined #rust-embedded
IlPalazzo-ojiis1 has quit [Quit: Leaving.]
firefrommoonligh has quit [Quit: Idle timeout reached: 172800s]