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
<adamgreig[m]> what're people's favourite ways to have a persistent static flag these days? a static mut in a dodgy link section feels a bit old school, but ConstStaticCell<MaybeUninit<u32>> feels like it's probably still UB
ivche_ has joined #rust-embedded
starblue has quit [Ping timeout: 252 seconds]
ivche has quit [Ping timeout: 276 seconds]
ivche_ is now known as ivche
starblue has joined #rust-embedded
<JamesMunns[m]> I have grounded for that, but for "read data that might have never been initialized" is likely always going to be ub outside of asm
<JamesMunns[m]> That said, with UC/MU like grounded does, In would be surprised if it ever actually led to miscompilation
Rahix has quit [Quit: ZNC - https://znc.in]
Rahix has joined #rust-embedded
bartmassey[m] has quit [Quit: Idle timeout reached: 172800s]
GuineaWheek[m] has quit [Quit: Idle timeout reached: 172800s]
pcs38 has joined #rust-embedded
t-moe[m] has quit [Quit: Idle timeout reached: 172800s]
chrysn[m] has quit [Quit: Idle timeout reached: 172800s]
MathiasKoch[m] has joined #rust-embedded
Kaspar[m] has quit [Quit: Idle timeout reached: 172800s]
sroemer has quit [Ping timeout: 252 seconds]
<adamgreig[m]> <JamesMunns[m]> "I have grounded for that, but..." <- yea, i'm leaning towards a little asm blob that reads the pointer, though it feels a bit silly to replace `ptr.read()` with `asm!("ldr {reg}, [{ptr}]", reg=out(reg), ptr=in(reg) ptr)` or such
sroemer has joined #rust-embedded
sroemer has quit [Changing host]
sroemer has joined #rust-embedded
M9names[m] has quit [Quit: Idle timeout reached: 172800s]
^Dan has joined #rust-embedded
^Dan has quit [Remote host closed the connection]
<joelsa[m]> Hey, I am writing a lot of code currently that is heavily shared between Linux and STM32. Did anybody ever write a transport for defmt on Linux?
<joelsa[m]> Right now I have feature-gated it all to use either log::info! or defmt::info! based on whether std is enabled or not and made sure my types implement both core::fmt::Debug and defmt::Format, but this is not really ergonomic and I'd really love to be able to simply use defmt::info on Linux.
<MathiasKoch[m]> <joelsa[m]> "Hey, I am writing a lot of..." <- > <@joelsa:fehler-in-der-matrix.de> Hey, I am writing a lot of code currently that is heavily shared between Linux and STM32. Did anybody ever write a... (full message at <https://catircservices.org/_irc/v1/media/download/AR0xl16NC1mywWKhTnjwt1kRKSS1uEcmRS0k1e-GgRu7rRJ8YXJuyl5dGFjcIXKCfGfdx2gcDmfJqOJKkUa79Ra_8AAAAAAAAGNhdGlyY3NlcnZpY2VzLm9yZy9aWlpHUGxNUEZ3RkhIWnFsc0VQRmRrZmo>)
<realroot[m]1> to move it toward the center vertically
<danielb[m]> oh god the curse of writing a half-assed library that people keep using 🤦‍♂️
<realroot[m]1> Should I use something else? I am hacking on watchful , it uses that
<danielb[m]> no but the author doesn't remember how to help you 🥲
<danielb[m]> what is mytext?
<danielb[m]> so, a linear layout will only take up as much space vertically as the tallest child. If you want to move that lower, you probably shouldn't .align_to(..., Top) to the display
<danielb[m]> but you can fine-tune the placement with translate(Point)
<realroot[m]1> thanks, i'l ltry it
lepusembedded[m] has quit [Quit: Idle timeout reached: 172800s]
Koen[m] has quit [Quit: Idle timeout reached: 172800s]
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
KenMatsui[m] has quit [Quit: Idle timeout reached: 172800s]
mkj[m] has quit [Quit: Idle timeout reached: 172800s]
<realroot[m]1> <danielb[m]> "All you should need, if you only..." <- > <@bugadani:matrix.org> All you should need, if you only want to center the text is... (full message at <https://catircservices.org/_irc/v1/media/download/AUPDh2Xymh3AplpiQyd29WvIagNfwQ6M-8ppDE5p-Lc5GYX1kbr2SOaSINXF6BRXN23gyaAGbndEX0RiBwobQIW_8AAAAAAAAGNhdGlyY3NlcnZpY2VzLm9yZy9LVlBmTkNYYlZORW5ybE5LUkp5UkZ6dVE>)
<realroot[m]1> I have another text in the center
<realroot[m]1> is that possible or at beast do I need to chain them in a vertical layout? that will move the other from the center a little i think
<danielb[m]> you can use translate to place something to where you need it to be
pcs38 has quit [Quit: leaving]
S-676 has joined #rust-embedded
S-676 has left #rust-embedded [#rust-embedded]
dirbaio[m] has quit [Quit: Idle timeout reached: 172800s]
AlexandrosLiarok has joined #rust-embedded
<AlexandrosLiarok> Any good way to deserialize from external eeprom a multi-sector object without 1) requiring a large buffer of lebgth equal to all the required sectors and 2) ideally without requiring a separate copy object eg by doing inplace deserialization?
<AlexandrosLiarok> So basically ideally I would like to have a streaming deserializer which would do per-sector processing and work directly on the final deserialized object, maybe a MaybeUninit or something.
<AlexandrosLiarok> Currently i just use serde json core and serde brief
<AlexandrosLiarok> s/separate/stack/, s/object//
Kert[m] has joined #rust-embedded
<Kert[m]> Are you specifically deserializing json ? I just wrote a streaming json tokenizer that has no buffer at all, except one bit-stack ( e.g. u32 that tracks nesting depth). Hoping to put this on Github in the next few days
<AlexandrosLiarok> I can use json if it meets the above restrictions. Main issue is I have a very large main parameters structure which contains like 300 diferent f32/enums/integer values. It is at most 3-levels nested and requires forward compatibility so I either need text fields or something like field indices like serde brief. The resulting serialized payload is very large.
<AlexandrosLiarok> I don't have huge eeprom restrictions but I do have ram/stack usage restrictions
<AlexandrosLiarok> Mostly anxious about the stack usage sincenits not tracked statically
<AlexandrosLiarok> * Mostly anxious about the stack usage since it is not tracked statically
<Kert[m]> So if i understand this right, you'd basically want to pass the final structure by ref to the deserializer and have it write directly to the fields as much as possible, without doing copies ? Something like StAX-style parser of whatever the serialized format is
<Kert[m]> * format is ( or perhaps Cap'N'Proto ? )
nerwalt[m] has joined #rust-embedded
<nerwalt[m]> Does anyone use TLS on Nordic nrf91* series chips with Nordic's modem library? If so, have you run into the 2K recv limit on secure sockets? I am curious what the best approach is to deal with this limit. The limitation does not appear well documented and there aren't many solution suggestions in the Nordic forums. The suggestions I see are either highly SDK specific or to use mbedtls. Is application layer TLS a decent option?
pcs38 has joined #rust-embedded
<AlexandrosLiarok> <Kert[m]> "So if i understand this right..." <- Yea pretty much
<diondokter[m]> <nerwalt[m]> "Does anyone use TLS on Nordic..." <- I've never used it. But apparently it's pretty trivial to configure in e.g. nginx
<DavidBrown[m]> Alexandros Liarokapis: have you looked at minicbor? I don't know if cbor would meet your needs, but it has some decent support to be zero-copy when possible (e.g. strings or byte arrays in the data can just be references to the decode buffer).
<AlexandrosLiarok> Hmm I haven't mostly because I don't care so much about zero copies, just that I avoid stack allocations and not require complete buffers for deserialization. But would perhaps be worth looking into it.
<DavidBrown[m]> I think it is going to want completely buffers for deserialization, so maybe not the best choice.
<AlexandrosLiarok> yea probably.
<RobinMueller[m]> What are your favorite ring buffer implementations? I have used ringbuf and heapless queue, but maybe there are some other hidden gems I don't know yet :)
<RobinMueller[m]> * ring buffer / queue implementations? I
ian_rees[m] has quit [Quit: Idle timeout reached: 172800s]
pcs38 has quit [Quit: leaving]