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
Guest7221 has joined #rust-embedded
Guest7221 has left #rust-embedded [Error from remote client]
_whitelogger has quit [Server closed connection]
_whitelogger has joined #rust-embedded
starblue has quit [Ping timeout: 240 seconds]
starblue has joined #rust-embedded
emerent has quit [Ping timeout: 252 seconds]
emerent has joined #rust-embedded
crabbedhaloablut has joined #rust-embedded
paulyoung[m] has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has joined #rust-embedded
Guest7221 has joined #rust-embedded
cr1901 has joined #rust-embedded
cr1901_ has quit [Ping timeout: 258 seconds]
ryan-summers[m] has joined #rust-embedded
<ryan-summers[m]> <paulyoung> "Hi. What I meant was, I’m pretty..." <- Ah yes indeed, USB works in such a way as it is always host-powered. If your adapter is a USB-OTG device, it _could_ power your device, but those are pretty rare in practice. In reality, that's usually something like a smart phone
<ryan-summers[m]> <paulyoung> "Maybe I’ll just get an F4..." <- I would highly recommend against making a USB host on an embedded device. It is _very_ complicated and I don't know if it's well supported.
Guest7221 has quit [Ping timeout: 258 seconds]
MathiasKoch[m] has joined #rust-embedded
<JamesMunns[m]> not generally. IIRC, those non-self-describing code paths require in the general case to act pretty "hash-mappy", which doesn't fit well at all with postcard
<JamesMunns[m]> (that's why its marked WontImplement)
<JamesMunns[m]> If you can share a reproduction, like a git repo that does the serde json core round trip, then the postcard attempted round trip, either as a bin crate so I can run it on a desktop, or as a lib with a unit test or something, I can look at it in more detail, but my gut feeling/memory of this is "postcard can't really handle this"
<JamesMunns[m]> If you make up that repro, I can at least promise a detailed response of why not, or workarounds I can think of.
<JamesMunns[m]> One potentially annoying workaround is to actually make two (very similar) structs, one intended for json, and one for postcard, and impl `from` between them, so you can do something like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/tagMkwvuMKlFwBpgYxCqmIqZ>)
<MathiasKoch[m]> Absolutely. I have a pretty simple unit test running here, so I can just shell that out to its own repo.. hang on :)
<MathiasKoch[m]> JamesMunns[m]: > <@jamesmunns:beeper.com> One potentially annoying workaround is to actually make two (very similar) structs, one intended for json, and one for postcard, and impl `from` between them, so you can do something like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/zelnDrJQFIWfhxEMtydCdCIc>)
<JamesMunns[m]> MathiasKoch[m]: Yeah, it'd basically just be copy paste, and one has the flatten attribute and the other doesn't, IMO? It feels unsatisfying, but if it's just one type, that might be a pretty straightforward way of doing it.
<JamesMunns[m]> Working on something else ATM, will try to take a peek today
<MathiasKoch[m]> No problem, just happy you want to take a peek 👍️ Thanks !
starblue has quit [Ping timeout: 255 seconds]
starblue has joined #rust-embedded
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #rust-embedded
Guest7221 has joined #rust-embedded
Guest7221 has quit [Changing host]
Guest7221 has joined #rust-embedded
Guest7221 has quit [Client Quit]
Guest7221 has joined #rust-embedded
Guest7221 has quit [Changing host]
Guest7221 has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]
GiacomoPasini[m] has joined #rust-embedded
<GiacomoPasini[m]> Hey, I have a question about portable-atomics. How do I patch my entire dependency tree to use that instead of core::sync::Atomics? I guess I'm not the first one that wants to use a no_std package on a platform without atomics but I can't find an easy way to patch dependencies (don't think I can use a cargo patch on core)
<danielb[m]> 😭
<danielb[m]> are you using esp32?
<danielb[m]> * using esp32 by any chance?
<GiacomoPasini[m]> mainly targeting riscv32im
<ryan-summers[m]> I think the main way we have done this in the past is just update all the dependencies in the chain to use the atomics shim
<ryan-summers[m]> But that obviously becomes super painful with a long dep chain
korken89[m] has joined #rust-embedded
<korken89[m]> Does anyone else use the `-D warnings` to get error on warnings in CI? When I do this for embedded targets the don't link properly and I'm not sure why.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/PRvKzTWdOdfczQXCTLMwWMbS>)
<korken89[m]> s/the/they/
<korken89[m]> I think it has something to do with the linker variables not being passed correctly anymore, as if the RUSTFLAGS is completely overwriting existing flags
<GiacomoPasini[m]> <ryan-summers[m]> "But that obviously becomes super..." <- are portable-atomics a drop-in replacement for their core counterparts? How stupid would be to have build script that replaces imports (if possible at all)?
<ryan-summers[m]> GiacomoPasini[m]: Generally, `atomic-polyfill` is used in embedded. I think it may have came after, but it's a drop-in replacement from what I remember
<GiacomoPasini[m]> atomic-polyfill is deprecated and suggests to use portable-atomics, that's why I was looking into that
<ryan-summers[m]> Ah gotcha, they keep changing
romancardenas[m] has joined #rust-embedded
<romancardenas[m]> This is a riscv32imc board that uses atomic-polyfill, maybe it helps you
<romancardenas[m]> (this board is a bit weird and supports atomic operations partially, so that's why we have weird feature flags)
<GiacomoPasini[m]> thank you!
<GiacomoPasini[m]> my problem is that the project I would like to use has lots of dependencies and would be quite consuming to contribute a patch like that to each of them
<romancardenas[m]> Yes, I know... if I'm not wrong, libraries should look like this: https://github.com/romancardenas/riscv-slic/blob/main/riscv-slic/Cargo.toml
<romancardenas[m]> So they always provide a set of features to propagate the configuration of portable-atomic
<romancardenas[m]> This is very annoying though, but I don't know if there is any workaround
<dirbaio[m]> <korken89[m]> "I think it has something to do..." <- try passing linker args from build.rs, these don't get overwritten if you set RUSTFLAGS
IlPalazzo-ojiisa has joined #rust-embedded
notgull has quit [Ping timeout: 252 seconds]
notgull has joined #rust-embedded
<romancardenas[m]> Can anyone send me a few pointers to get external interrupts working in qemu for riscv? Currently I have simple applications working, but when I rely on external interrupts... They never happen 😢
<romancardenas[m]> Also delays based on polling do not introduce delay at all
xnor has quit [Server closed connection]
xnor has joined #rust-embedded
bartmassey[m] has quit [Quit: Idle timeout reached: 172800s]
jannic[m] has quit [Quit: Idle timeout reached: 172800s]
neceve has joined #rust-embedded
adamgreig[m] has quit [Quit: Idle timeout reached: 172800s]
dkm[m] has joined #rust-embedded
<dkm[m]> <waveguide[m]> "I wonder too how many modificati..." <- In the case of AdaCore's compilers based on GCC, the modifications are very small and everything that makes sense is sent upstream.
jessebraham[m] has quit [Quit: Idle timeout reached: 172800s]
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
lulf[m] has quit [Quit: Idle timeout reached: 172800s]
andresovela[m] has quit [Quit: Idle timeout reached: 172800s]
ruabmbua[m] has quit [Quit: Idle timeout reached: 172800s]
johngigantic[m] has quit [Quit: Idle timeout reached: 172800s]
neceve has quit [Ping timeout: 255 seconds]
dne has quit [Remote host closed the connection]
dne has joined #rust-embedded
stephe has quit [Ping timeout: 240 seconds]
stephe has joined #rust-embedded