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
<re_irc> <@burrbull:matrix.org> : Interesting. I never thought this way, but this could also work with typestates. Something like:
<re_irc> pub enum SdaPin1 {
<re_irc> B8(PB8<Alternate<x>>),
<re_irc> }
<re_irc> ...
<re_irc> impl Instance for I2C1 {
<re_irc> type Sda = SdaPin1;
<re_irc> type Scl = SclPin1;
<re_irc> }
<re_irc> let i2c_baro = I2c::new(dp.I2C1, SdaPin1::B8(pb8.into_alternate()), , SclPin1::B9(pb9.into_alternate()), I2cConfig::default());
<re_irc> This adds some verbosity in user code, but now I2c does not have "PINS" generic.
<re_irc> <@burrbull:matrix.org> -,
<re_irc> <@burrbull:matrix.org> Interesting. I never thought this way, but this could also work with typestates. Something like:
<re_irc> pub enum SdaPin1 {
<re_irc> B8(PB8<Alternate<x>>),
<re_irc> ...
<re_irc> impl Instance for I2C1 {
<re_irc> }
<re_irc> type Sda = SdaPin1;
<re_irc> type Scl = SclPin1;
<re_irc> ...
<re_irc> }
<re_irc> let i2c_baro = I2c::new(dp.I2C1, SdaPin1::B8(pb8.into_alternate()), SclPin1::B9(pb9.into_alternate()), I2cConfig::default());
<re_irc> This adds some verbosity in user code, but now I2c does not have "PINS" generic.
<re_irc> <@korken89:matrix.org> : I agree here, I'll find some time to open an issue for this. E.g. i use a logging framework where embedded units in the field talk to a central backend that decodes logs. It works great, bit the backend needs to support all versions of defmt that can come. The issue then becomes, if you can only support one, what happens at times when the wire format breaks? Either loose logging support for all units in the field or force...
<re_irc> ... to an old version, either way you have become locked. :(
<re_irc> <@korken89:matrix.org> I agree here, I'll find some time to open an issue for this. E.g. i use a logging framework where embedded units in the field talk to a central backend that decodes logs. It works great, with the only requirement that the backend needs to support all versions of defmt that can come. The issue then becomes, if you can only support one, what happens at times when the wire format breaks? Either loose logging support for all...
<re_irc> ... units in the field or force to an old version, either way you have become locked. :(
<re_irc> <@burrbull:matrix.org> * generic (at least i hope so).
IlPalazzo-ojiisa has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> Nice!
rardiol has joined #rust-embedded
rardiol_ has joined #rust-embedded
rardiol has quit [Read error: Connection reset by peer]
dc740 has joined #rust-embedded
emerent has quit [Ping timeout: 240 seconds]
emerent has joined #rust-embedded
<re_irc> <@firefrommoonlight:matrix.org> At this pt, the reason I probably won't impl something like this is ensuring correct pins for all variants
<re_irc> <@firefrommoonlight:matrix.org> There are also considerations like pin output speed, hardware PUs etc that may still need to be configured separately
<re_irc> <@firefrommoonlight:matrix.org> Doable, but don't feel like the tedium
<re_irc> <@dngrs:matrix.org> : I tried their git version a few days ago and it didn't support the new defmt wire format. I'm not seeing any recent commits in their log (https://github.com/knurling-rs/probe-run/commits/main) indicating updated support - am I missing something?
<re_irc> <@dngrs:matrix.org> : (tangent) oof, the issue you linked (specifically, your comment) makes a good point. It seems like a rock vs hard place situation :|
<re_irc> <@datdenkikniet:matrix.org> Pretty sure no "probe-run" that supports wire format 4 exists atm
<re_irc> <@datdenkikniet:matrix.org> Since the latest version has "defmt-decoder = "=0.3.5""
<re_irc> <@datdenkikniet:matrix.org> Which is yanked, and older than "0.3.6" which actually supports version 4
<re_irc> <@dngrs:matrix.org> aye. so this bites every crate that uses a semver dependency on defmt
<re_irc> <@dngrs:matrix.org> (as in "defmt = "0.3"")
<re_irc> <@dngrs:matrix.org> : FYI this includes embassy examples, e.g. here (https://github.com/embassy-rs/embassy/blob/master/examples/stm32f1/Cargo.toml#L15)
<re_irc> <@admin:orangemurker.com> : There is a PR open to update the defmt-decoder version. At this moment you can clone the repo and build it by yourself to fix the issue before an official release gets published.
<re_irc> <@dngrs:matrix.org> : aye! I've been mostly pinning defmt to older versions for the time being but at some point this becomes tedious
<re_irc> <@dngrs:matrix.org> it gets complicated by me running a defmt fork sometimes…
<re_irc> <@sousandrei:matrix.org> Anyone used the sx127x_lora crate before? I've got it to compile and run on a STM32L433 Board with a FeatherWing RFM9x LoRa radio, but I get version mismatch :c
<re_irc> Something is funky on the SPI?
<re_irc> <@sousandrei:matrix.org> -Something is funky on the SPI?
<re_irc> <@sousandrei:matrix.org> the reading register part is always returning zero 🤔
<re_irc> <@datdenkikniet:matrix.org> Never tried it, but I would also recommend that you ask in #public-lora-wan-rs:matrix.org (https://matrix.to/#/#public-lora-wan-rs:matrix.org)!
<re_irc> <@sousandrei:matrix.org> that is a path forward! Thank you
rardiol_ has quit [Ping timeout: 268 seconds]
dc740 has quit [Remote host closed the connection]
<re_irc> <@andrewgazelka:matrix.org> : I messed around a little and it is definitely possible to get alternate pins :) https://github.com/andrewgazelka/cube-query
<re_irc> <@andrewgazelka:matrix.org> code is pretty bad rn. will clean up if I do anything more with it
<re_irc> <@dirbaio:matrix.org> : have you guys seen ["stm32-data"}(https://github.com/embassy-rs/stm32-data)?
<re_irc> <@dirbaio:matrix.org> * "stm32-data" (https://github.com/embassy-rs/stm32-data)?
<re_irc> <@dirbaio:matrix.org> it has pin data in a nice json format ready to use https://github.com/embassy-rs/stm32-data-old/blob/main/data/chips/STM32H743ZI.json#L5278
<re_irc> <@dirbaio:matrix.org> it gets the data from stm32cube xmls, and from C headers
<re_irc> <@andrewgazelka:matrix.org> I have it starred dont know much about it tho
<re_irc> <@andrewgazelka:matrix.org> ah thats nice
<re_irc> <@andrewgazelka:matrix.org> do you need to run the new one to generate the json file?
<re_irc> <@dirbaio:matrix.org> yeah, on the "stm32-data" repo run "cargo run --release --bin stm32-data-gen"
<re_irc> <@dirbaio:matrix.org> you get the jsons in "build/data/"
<re_irc> <@andrewgazelka:matrix.org> cool :)
<re_irc> <@andrewgazelka:matrix.org> yea half of this project was just so I can understand the XML files better
<re_irc> <@dirbaio:matrix.org> (I linked to the old repo because that one committed the generated json files, but we had to stop doing that as the repo size balooned beyond hundreds of megabytes 😭)
<re_irc> <@dirbaio:matrix.org> the XMLs are awful
<re_irc> <@andrewgazelka:matrix.org> ^^^^^ facts
<re_irc> <@andrewgazelka:matrix.org> XML in general
<re_irc> <@andrewgazelka:matrix.org> is awful
<re_irc> <@andrewgazelka:matrix.org> https://corecursive.com/json-vs-xml-douglas-crockford/
<re_irc> <@andrewgazelka:matrix.org> ^ just dropped
<re_irc> <@dirbaio:matrix.org> there's A TON of exceptions and inconsistent naming. stm32-data is full of "if"s to workaround/unify these
<re_irc> <@andrewgazelka:matrix.org> I am a younger SWE and I was surprised that XML used to be the hipster data format
<re_irc> <@andrewgazelka:matrix.org> but ¯_(ツ)_/¯
<re_irc> <@dirbaio:matrix.org> it was a lot of work, I'd not recommend reinventing it 😂
<re_irc> <@dirbaio:matrix.org> * stm32-data
<re_irc> <@andrewgazelka:matrix.org> : im not reinventing it. just wanted a simple CLI for a single task
<re_irc> <@andrewgazelka:matrix.org> if I wanted to do anything more I would use embassy fs
<re_irc> <@dirbaio:matrix.org> nice!
<re_irc> <@andrewgazelka:matrix.org> don't know much about them but from what I know their HAL looks really good too
<re_irc> <@andrewgazelka:matrix.org> hopefully will be able to run in stable soon :)
<re_irc> <@dirbaio:matrix.org> you can already use it in stable
<re_irc> <@dirbaio:matrix.org> if you either don't use async
<re_irc> <@andrewgazelka:matrix.org> ah thought it forced you to use async. I didn't know that
<re_irc> <@andrewgazelka:matrix.org> regardless, will be excited when futures in traits become stable
<re_irc> <@andrewgazelka:matrix.org> as I am sure everyone will be
<re_irc> <@dirbaio:matrix.org> or you use it with the "TaskStorage" api. The only thing requiring async is the "#[embassy_executor::task]" macros
<re_irc> <@dirbaio:matrix.org> and yeah async traits also require nightly, but everything in embassy has a non-trait api in addition to the traits