firefrommoonligh has quit [Quit: Idle timeout reached: 172800s]
trinhtuan[m] has quit [Quit: Idle timeout reached: 172800s]
LudovicVanasse[m has quit [Quit: Idle timeout reached: 172800s]
ericseppanen[m] has quit [Quit: Idle timeout reached: 172800s]
GrantM11235[m] has quit [Quit: Idle timeout reached: 172800s]
mkj[m] has joined #rust-embedded
<mkj[m]>
is there a way to mark fields as safe for FieldWriter using svd2rust? things like timeouts or lengths which are multi-bit but not intended as enums
<ericseppanen[m]>
Is there a circular buffer / ring buffer / spsc channel implementation that can be used on rp2040 for sending data between cores?
<ericseppanen[m]>
<EricSeppanen[m]> "Is there a circular buffer..." <- I could just put data in a heapless::Deque behind a lock, I guess? But I'm a bit spoiled by lockfree channels in userspace so that's what I reach for by instinct.
<M9names[m]>
heapless spsc is also an option if you don't need a deque
<M9names[m]>
<MurrayToddWillia> "Okay, so for my own understandin..." <- > <@murraytodd:matrix.org> Okay, so for my own understanding, let me play things back. This has to do with the fact that the rp2040 has two cores, so rather than assuming `portable-atomic` should use it's own critical-section based on single-core... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/WvAdWTDDBcTuQMHQwzhIgTUI>)
<ericseppanen[m]>
bbqueue uses cortex-m 0.6 and hasn't been released since 2021. Hard to tell if it would play nicely with the rest of the ecosystem?
<M9names[m]>
bbqueue should be fine. but it's really for "I want to DMA to/from the buffer", if you don't need that then it's probably not a great fit
<M9names[m]>
and it's not like it's unmaintained, if it hasn't changed it's because no-one has needed it to change
<ericseppanen[m]>
heapless::spsc would probably be OK but it's a bit hard to call split() in a const context.
<ericseppanen[m]>
* const context. Maybe StaticCell<Producer> would work though...
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has joined #rust-embedded
henrik_alser[m] has joined #rust-embedded
<henrik_alser[m]>
Eric Seppanen: you can also use embassy-sync zerocopy_channel for example (with CriticalSectionRawMutex)
<henrik_alser[m]>
(They can be used outside of embassy aswell if you don’t use it)
<JamesMunns[m]1>
<M9names[m]> "and it's not like it's unmaintai..." <- It's a little unmaintained. Ithinel has started helping out but I haven't had time to give it love for a while.
purepani[m] has quit [Quit: Idle timeout reached: 172800s]
<henrik_alser[m]>
(Note that zerocopy_channel is spsc only, if you need mpsc you can use for example atomic-pool or heapless::Pool and send Box on a channel as above
jakzale has quit [Remote host closed the connection]
jakzale has joined #rust-embedded
<henrik_alser[m]>
* (Note that zerocopy_channel is spsc only, if you need mpsc you can use for example atomic-pool or heapless::Pool and send Box on a normal Channel as in the above multicore example
<henrik_alser[m]>
* (Note that zerocopy_channel is spsc only, if you need mpsc you can use for example atomic-pool or heapless::Pool and send Box on a normal Channel as in the above multicore example)
embedded-enthusi has joined #rust-embedded
embedded-enthusi has quit [Ping timeout: 268 seconds]
Makarov has quit [Ping timeout: 250 seconds]
dangroshev[m] has quit [Quit: Idle timeout reached: 172800s]
DominicFischer[m has quit [Quit: Idle timeout reached: 172800s]
Makarov has joined #rust-embedded
Makarov has quit [Ping timeout: 250 seconds]
dirbaio[m] has joined #rust-embedded
<dirbaio[m]>
<diondokter[m]> "Doesn't this also unlock getting..." <- Nope 🥲
<diondokter[m]>
what else is in the way then?
<dirbaio[m]>
the std::io traits need the std::io::Error struct
<takkaryx[m]>
started looking for a static allocated protobuf implementation for Rust, and came across this: https://github.com/dflemstr/femtopb just recently, anyone have any experience with it? looking to use USB with protobuf on an STM32F4 to report data periodically.
dngrs[m] has quit [Quit: Idle timeout reached: 172800s]
<takkaryx[m]>
henrik_alser[m]: oh hey, another one! thanks!
<henrik_alser[m]>
Yeah i haven’t tried either but just FYI :)
<takkaryx[m]>
well, I'm working on my USB layer, guess I'll give both a shot and see which one works better XD
barafael[m] has joined #rust-embedded
<barafael[m]>
Is there an alternative to micromath when better precision is required? Finally time to learn to use fixed point math?
<JamesMunns[m]1>
<barafael[m]> "Is there an alternative to..." <- libm?
IlPalazzo-ojiisa has quit [Remote host closed the connection]
firefrommoonligh has joined #rust-embedded
<firefrommoonligh>
Hmm. Well... Cmsis-dsp. Hardware cordic if available. Num_traits, which I think abstracts over mm and some other options; don't recall
<firefrommoonligh>
Both fixed and floating point have their own traps. I think you are more likely to hit fixed point traps, but it depends
<firefrommoonligh>
f64 can be useful too if you understand the performance implications of software floats, or if you have double prec Fpu
<barafael[m]>
I got no fpu, rp2040 :)
<barafael[m]>
Maybe the core intrinsics have some floating point ops
<henrik_alser[m]>
<barafael[m]> "Maybe the core intrinsics have..." <- Yeah, they are enabled by default in embassy-rp at least
thejpster[m] has quit [Quit: Idle timeout reached: 172800s]
AlexandervanSaas has joined #rust-embedded
<AlexandervanSaas>
<henrik_alser[m]> "Yeah, they are enabled by..." <- Are they? Not on the version on crates.io as far as I can see.
<henrik_alser[m]>
<AlexandervanSaas> "Are they? Not on the version..." <- Oh, i recall they were at some point back in time last time i needed them, but i might be wrong
<henrik_alser[m]>
But yeah just enable the feature barafael
<henrik_alser[m]>
And thanks for the heads-up Alexander van Saase 😅
pronvis has joined #rust-embedded
<barafael[m]>
So I still have to use libm for e.g. sqrt to become available right? I'm defining the math in a separate crate