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
M9names[m] has quit [Quit: Idle timeout reached: 172800s]
<AlexandervanSaas> Turns out that mabez already did all of the heavy lifting by implementing a block device with block cache and implementing `embedded_io_async::{Read, Write}`for it. All I had to do was implement the embedded-storage traits and delegate to the existing read and write methods. https://github.com/MabezDev/embedded-fatfs/compare/master...avsaase:embedded-fatfs:embedded-storage
<AlexandervanSaas> It's a little strange to implement a nor flash trait for an sd card because the semantics don't match but it seems to work fine.
<AlexandervanSaas> I added an example using sequential-storage and I found using a cache is basically mandatory because otherwise the linear scans are killing performance.
<AlexandervanSaas> That creates a bit of a challenge though because the sequential-storage cache RAM ram use scales with the number of pages/blocks and with an SD card and 512 byte blocks that quickly adds up. 8 megs when using the full u32 range 😅
<diondokter[m]> <AlexandervanSaas> "That creates a bit of a challeng..." <- Ha lol. Yeah depending on which cache you're using, it has a couple of bytes per page of cache
<diondokter[m]> Ok, so that's 8 million page you have
<diondokter[m]> s/page/pages/
<AlexandervanSaas> diondokter[m]: `u32::MAX / 512`
<diondokter[m]> Ehh feel free to contribute a cache that works better for this use case 🙈
<AlexandervanSaas> > <@diondokter:matrix.org> Ok, so that's 8 million pages you have
<AlexandervanSaas> * `(u32::MAX + 1) / 512`
<AlexandervanSaas> I think the cache itself needs to be written to disk to make this work in a performant way
tschundler has joined #rust-embedded
<AlexandervanSaas> Before you know it I'm writing my own shitty version of a FAT 🤣
K900 has quit [Quit: Idle timeout reached: 172800s]
geky[m] has quit [Quit: Idle timeout reached: 172800s]
crabbedhaloablut has quit []
crabbedhaloablut has joined #rust-embedded
<thejpster[m]> all versions of FAT are shitty
JomerDev[m] has joined #rust-embedded
<JomerDev[m]> <thejpster[m]> "all versions of FAT are shitty" <- Hey now, no FAT shaming please :P
zeenix[m] has joined #rust-embedded
<zeenix[m]> James Munns: hi. This `maitake_sync::WaitQueue` you're using in postcard-rpc is quite similar to `event_listener::Event` I was talk about yesterday: https://docs.rs/event-listener/latest/event_listener/#examples
jxsl has joined #rust-embedded
<JamesMunns[m]> Neat! IIRC it's also similar to tokio's Notify
<JamesMunns[m]> it looks like event_listener uses an alloc::Vec in no_std, and an intrusive list in std. maitake-sync::WaitQueue uses an intrusive list for both. This doesn't matter for postcard-rpc on std, but I use it because I like it and it works the same on std/no_std :)
<zeenix[m]> ah right. event-listener is only nostd, not noalloc
badyjoke[m] has joined #rust-embedded
<badyjoke[m]> Hello ! Does cargo valgrind works for embedded targets ?
M9names[m] has joined #rust-embedded
<M9names[m]> valgrind instruments Linux's memory allocator to do it's work.
<M9names[m]> if your embedded target is not running linux, the answer is no.
adamhott[m] has joined #rust-embedded
<adamhott[m]> I feel like I bought a plane ticket but am standing at the window of the gate while the plane is taking off outside. I just learned how convenient static mut is....
Vicente[m] has joined #rust-embedded
<Vicente[m]> Hi, I need help with smol `Arc<Mutex<Option<TcpStream>>>`. Why it is it hanging at `Acquire lock 3`?
<Vicente[m]> `lock()` says:
<Vicente[m]> ``````
<Vicente[m]> Hi, I need help with smol `Arc<Mutex<Option<TcpStream>>>`. Why it is it hanging at `Acquire lock 3`?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/eOrmmeHUkkdgMfpsOujtNBQJ>)
<Vicente[m]> * Hi, I need help with smol `Arc<Mutex<Option<TcpStream>>>`. Why it is it hanging at `Acquire lock 3`?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/pIboGcONHEjQtSsyXnqkHvci>)
<Vicente[m]> * Hi, I need help with smol `Arc<Mutex<Option<TcpStream>>>`. Why it is it hanging at `Acquire lock 3`?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/QXygiecCtioAmoXLWiPHfoMJ>)
<Vicente[m]> * Hi, I need help with smol `Arc<Mutex<Option<TcpStream>>>`. Why it is it hanging at `Acquire lock 3`?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/vdDlZQbPkKLqIWEKMNETrOPa>)
<Vicente[m]> Isn't stream_wrapper dropped when reasigned on line 7?
<Vicente[m]> * Hi, I need help with smol `Arc<Mutex<Option<TcpStream>>>`. Why it is it hanging after `Acquire lock 3`?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/zMNzBetwAzNSlvcIMXAMTaIu>)
<Vicente[m]> I'm new to Rust, solved by manually drop()
xnor has joined #rust-embedded
<dirbaio[m]> <Vicente[m]> "Isn't stream_wrapper dropped..." <- `let stream_wrapper = ...` creates a new variable with the same name that shadows the old one. the old still exists and still gets dropped at the end of the function.
<dirbaio[m]> if you instead do stream_wrapper = ..., that does reassign the variable which does drop the guard.
<dirbaio[m]> * if you instead do stream_wrapper = ... without let, that does reassign the variable which does drop the guard.
<Gnome[m]> <adamhott[m]> "I feel like I bought a plane..." <- RE: static mut, it isn't a good idea to rely on it especially nowadays as it will be warned on usage in Rust 2024 and possibly removed in Rust 2027. It's better to use interior mutability, the closest to `static mut` would be `SyncUnsafeCell` but you should probably be using something like `static_cell` or `OnceLock`.
inara has quit [Quit: Leaving]
inara has joined #rust-embedded
crabbedhaloablut has quit []
crabbedhaloablut has joined #rust-embedded
lehmrob has joined #rust-embedded
lehmrob has quit [Quit: Konversation terminated!]
jxsl has quit [Ping timeout: 252 seconds]
<Vicente[m]> <Gnome[m]> "RE: static mut, it isn't a..." <- Is this okay or could be removed too?
<Vicente[m]> ``````
<Vicente[m]> > <@gnomeddev:matrix.org> RE: static mut, it isn't a good idea to rely on it especially nowadays as it will be warned on usage in Rust 2024 and possibly removed in Rust 2027. It's better to use interior mutability, the closest to `static mut` would be `SyncUnsafeCell` but you should probably be using something... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/iJfPomYcvDNrhqqAxCsrkMHs>)