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
<spinfast[m]> And people wonder why no one likes dealing with C/C++ dependencies in distros...
<spinfast[m]> "1.59" sheesh
<spinfast[m]> I get nix probably can't produce as small of an image or whatever but yocto was pretty painful from my experience with it... nothing like some unintelligible bitbake error hours in
Guest7221 has left #rust-embedded [Error from remote client]
IlPalazzo-ojiisa has quit [Remote host closed the connection]
PhilMarkgraf[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7221 has joined #rust-embedded
emerent has quit [Ping timeout: 256 seconds]
emerent_ has joined #rust-embedded
emerent_ is now known as emerent
notgull has quit [Ping timeout: 256 seconds]
notgull has joined #rust-embedded
ducks2788[m] has quit [Quit: Idle timeout reached: 172800s]
crabbedhaloablut has joined #rust-embedded
Ralph[m]1 has joined #rust-embedded
<Ralph[m]1> not exactly an embedded problem per-se, but rustc complains about some code where i really don't understand why:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/WllvgIEimNQGhmGUqLPZbmIi>)
IlPalazzo-ojiisa has joined #rust-embedded
jannic[m] has joined #rust-embedded
<jannic[m]> Ralph: I'd say it's a rustc bug. This one: https://github.com/rust-lang/rust/issues/76053
<Ralph[m]1> thanks a lot for pointing me to that issue jannic! i'll add a comment to the one in the error message so that people can find it easier in the future
IlPalazzo-ojiisa has quit [Quit: Leaving.]
IlPalazzo-ojiis1 has joined #rust-embedded
Guest7221 has left #rust-embedded [Error from remote client]
<spinfast[m]> I forget, can chiptool specify the register size somewhere in yaml?
<spinfast[m]> ugh actually nevermind I don't think it'll work for what I want without a custom generator, wanted to use it to generate a regmap for an i2c device... nothing like hand writing out 55 registers worth of bitmaps and masks...
<spinfast[m]> kind of wish the svd/yaml -> IR would be split from the generator part, I guess I could PR that
<spinfast[m]> no real reason it couldn't be? dirbaio ?
<JamesMunns[m]> https://github.com/diondokter/device-driver was a proc macro approach to this
diondokter[m] has joined #rust-embedded
<diondokter[m]> It works fine, but it's grown too big. Can't really add anything anymore
<diondokter[m]> <JamesMunns[m]> "https://github.com/diondokter/..."; <- Not a proc macro. Way too big normal macro πŸ˜…
<spinfast[m]> I was thinking it’d be cool to do this with yaml like chiptool honestly
<spinfast[m]> Easy to describe registers, field sets, etc
<spinfast[m]> But yeah then wiring that up to i2c/spi/whatever non mmio would be interesting
<spinfast[m]> The macro looks neat
<JamesMunns[m]> Not sure if it helps, but I've sorta found a pattern I like recently for coupling types, by using a marker trait with a marker type. I use it in postcard-rpc:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/uqdJVBiYOuZUcDsUkPxeWGNf>)
<JamesMunns[m]> then you can have functions like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/uVlUSFSjbDcOVpaijBTrAVKM>)
Guest7221 has joined #rust-embedded
<JamesMunns[m]> basically, using it to "bundle" a bunch of metadata into a single entity. For I2C registers, you might have something like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/NzIJgxsuDcjQUsZehyEtyRVL>)
<JamesMunns[m]> something like that
<JamesMunns[m]> That way you don't need to codegen a ton of functions, you just codegen a bunch of marker types and trait impls, and let the compiler do all the monomorphizing for you.
<JamesMunns[m]> At least, I find it helpful for building a suite of functions that all need to take a bunch of consts and types, and that way you don't end up with some silly function that takes like 4 parameters and 4 different generic types lol
<JamesMunns[m]> like, you can also make functions like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/DPFTMqASMfCRrxHpbFveDyPR>)
<JamesMunns[m]> or even monomorphize a function that builds the right-sized transaction for you, with the proper endianness, like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/PugBtIZCCCpMsUlNhWBaOdTA>)
<JamesMunns[m]> anyway, this is the end of my "you can use marker traits to bundle metadata" braindump, that I now realize should be a blog post lol
<diondokter[m]> That could be a neat system! But something that's not in there is being able to specify the bitfields in a nice way.
<JamesMunns[m]> totally fair! I tend to use this with postcard a lot, maybe lean on a similar `ToBits` or `FromBits` trait? but that still leaves you with "implement serde but for bitfields"
<diondokter[m]> So my macro reads or creates some specified bytes and then uses bitvec to be able to read or write data to it with specified bit positions. It follows the integers or enums as integers.
<JamesMunns[m]> makes sense!
<JamesMunns[m]> If it was backed with a trait, you could use my marker trait by requiring type Value: ToBits; or something
Guest7221 has left #rust-embedded [Error from remote client]
starblue has quit [Ping timeout: 256 seconds]
StephenD[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7221 has joined #rust-embedded
IlPalazzo-ojiis1 has quit [Quit: Leaving.]
starblue has joined #rust-embedded
chrysn[m] has joined #rust-embedded
<chrysn[m]> Looking through old photos just found what is probably the first hint at emebbed-nal, from April 2019 at the Oxidize conference:
<chrysn[m]> (image description: Picture of a whiteboard. Black marker / my handwriting: "Is it time for embedded-hal style network abstractions yet? --christian". Blue marker / dunno whose handwriting: "yeh")
starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
Guest7221 has left #rust-embedded [Error from remote client]
<sirhcel[m]> While you are talking about the oxidize conference. I really enjoyed it 2020 and I would love to attend a conference of this kind again. What's the reason it did not got repeated yet? The incredible amount of work necessary for organizing it?
<thejpster[m]> well there was a pandemic in the middle
<thejpster[m]> it's been discussed, but we were a bit busy making Ferrocene
<thejpster[m]> I think Tweede Golf want to do something around Rust NL next year, possibly
<thejpster[m]> plus EuroRust 2022 was in Berlin anyway
<sirhcel[m]> thejpster[m]: That's good to hear and a pretty good excuse as well.
<sirhcel[m]> Then i will watch out for rust nl. Crossing fingers.
IlPalazzo-ojiisa has joined #rust-embedded
<sirhcel[m]> <thejpster[m]> "plus EuroRust 2022 was in Berlin..." <- That's another good point. I remember the talk from hendrik alser and ai maiga but i missed the embedded deep dive.
<sirhcel[m]> And something completely different: `rustfmt` puzzles me by reporting different results on linux and macos. I'm running the same version on both systems. But I'm getting different results with respect to presumed line lengths and wrapping. For example, I'm getting things like... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/qcdqDiVLmpIfFcTFNrHlTtDu>)
<thejpster[m]> daft question - same version?
<diondokter[m]> Also make sure you don't have a rogue rustfmt.toml file in your filesystem
<JamesMunns[m]> also rustfmt has a config file... yeah like Dion said :D
<sirhcel[m]> No config files are present on the systems. But to my surprise: despite having an `rustup update` on both machines and having the same toolchain versions on both, the actual version of `rustfmt` differs.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/JIWodUkeHYeLZPwSyktGvGpf>)
<sirhcel[m]> * No config files are present on the systems. But to my surprise: despite having ran `rustup update` on both machines and having the same toolchain versions on both, the actual version of `rustfmt` differs.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/UARDNgeXsDkqUWyYOEvbBCgK>)
<sirhcel[m]> No, i misread the version on linux for 1.7.0. It's actually the same version on both systems.
<sirhcel[m]> It's getting late for me ... πŸ˜…
<thejpster[m]> > Rustfmt is designed to be very configurable. You can create a TOML file called rustfmt.toml or .rustfmt.toml, place it in the project or any other parent directory and it will apply the options in that file. If none of these directories contain such a file, both your home directory and a directory called rustfmt in your global config directory (e.g. .config/rustfmt/) are checked as well.
<sirhcel[m]> Neither is present in my project and i checked out the same revision on both machines. By moving `rust-toolchain.toml` out of the way, I'm getting back the same result on both targets. But strangely enough even the nightly toolchain selected by this file is the same on both machines.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/VOdMLcRPldwqGwrPEVswCKjQ>)
<sirhcel[m]> * Neither is present in my project and i checked out the same revision on both machines. By moving `rust-toolchain.toml` out of the way, I'm getting back the same result on both targets. But strangely enough even the nightly toolchain selected by this file is the same on both machines.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/giqzLINADfWEJiciBJGBUQYL>)
<thejpster[m]> Almost all of the binaries in ~/.cargo/bin are actually rustup wearing a hat
<thejpster[m]> which is why they all have the exact same size
<sirhcel[m]> Thanks! I have never looked at these binaries from this perspective.
crabbedhaloablut has quit []
starblue has quit [Ping timeout: 260 seconds]
IlPalazzo-ojiisa has quit [Quit: Leaving.]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Read error: Connection reset by peer]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Ping timeout: 256 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Client Quit]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Client Quit]
IlPalazzo-ojiis1 has joined #rust-embedded
IlPalazzo-ojiis1 has quit [Client Quit]
IlPalazzo-ojiisa has joined #rust-embedded