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
YuhanLin[m] has quit [Quit: Idle timeout reached: 172800s]
dnm has quit [Read error: Connection reset by peer]
NishanthMenon has quit [Read error: Connection reset by peer]
NishanthMenon has joined #rust-embedded
dnm has joined #rust-embedded
anton_star has joined #rust-embedded
anton_star22 has joined #rust-embedded
anton_star has quit [Ping timeout: 256 seconds]
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 252 seconds]
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 246 seconds]
xnor has quit [Ping timeout: 276 seconds]
xnor has joined #rust-embedded
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 265 seconds]
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 252 seconds]
<i509vcb[m]> For embedded, has anyone found some reasonable way to write both an async and blocking API in such a fashion that you are not literally duplicating all the code. Something somewhat like maybe-async used over in std land would be interesting for embedded: https://github.com/fMeow/maybe-async-rs
<i509vcb[m]> However embedded I assume is complicated here a bit because something like embedded-hal (non async) has no way to wait nessecarily which would involve writing the code twice...
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 260 seconds]
<i509vcb[m]> embedded-hal-nb seems to be closest to that
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 245 seconds]
mrkajetanp has joined #rust-embedded
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
mrkajetanp has quit [Ping timeout: 248 seconds]
aliceryhl[m] has quit [Quit: Idle timeout reached: 172800s]
anton_star22 has quit [Quit: Client closed]
anton_star has joined #rust-embedded
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 252 seconds]
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 246 seconds]
M9names[m]1 has quit [Quit: Idle timeout reached: 172800s]
matoushybl[m] has quit [Quit: Idle timeout reached: 172800s]
marmrt[m]1 has quit [Quit: Idle timeout reached: 172800s]
birdistheword99[ has quit [Quit: Idle timeout reached: 172800s]
therustybits[m] has quit [Quit: Idle timeout reached: 172800s]
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 260 seconds]
anton_star has quit [Ping timeout: 256 seconds]
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 252 seconds]
anton_star has joined #rust-embedded
mrkajetanp has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 248 seconds]
mrkajetanp has joined #rust-embedded
anton_star has quit [Quit: Client closed]
GuineaWheek[m] has joined #rust-embedded
<GuineaWheek[m]> i really wish cargo supported having different runners based on feature flags -- target triple isn't sufficient
sugoi has joined #rust-embedded
sugoi has quit [Ping timeout: 252 seconds]
Gnome[m] has joined #rust-embedded
<Gnome[m]> Is there any blockers for a new release to riscv-rt-macros? There was a merged PR from a little bit ago that swapped over to syn 2 and I'm on a crusade to remove syn 1 from my dependency tree... even though I'm using an xtensa chip it still shows up in my Cargo.lock (I know, silly, but that's my motivation).
AtleoS has joined #rust-embedded
mrkajetanp has quit [Ping timeout: 246 seconds]
mrkajetanp has joined #rust-embedded
<dirbaio[m]> you know something being in Cargo.lock doesn't mean it's getting compiled, right?
<dirbaio[m]> Cargo.lock locks the versions of every potential dep, even those that are disabled due to Cargo features not being enabled, or due to being target-specific for another target.
<dirbaio[m]> to view your real dependency tree use cargo tree with the right --target and --features.
<JamesMunns[m]> <dirbaio[m]> "Cargo.lock locks the versions of..." <- Man I had that one bite me recently. I was hoping I could handle multiple versions of embassy-usb (0.2 and 0.3) for postcard-rpc, but it wasn't possible to get the usbd stuff to resolve so I ended up just dropping 0.2 support
GrantM11235[m] has joined #rust-embedded
<GrantM11235[m]> There is a new generic integer RFC https://github.com/rust-lang/rfcs/pull/3686
<thejpster[m]1> I wrote a thing about Embedded Rust for Raspberry Pi
<thejpster[m]1> Amazed they left this line in:
<thejpster[m]1> > Maybe if you all ask nicely enough, we’ll see some more top-tier silicon vendors offering official Rust support for their chips (hint, hint)!
<thejpster[m]1> * Amazed they left this line in:
<thejpster[m]1> > I will note, though, that with the exception of some lovely folks at Espressif, pretty much all of the open-source Embedded Rust so far has been done by individuals working for free in their spare time. Maybe if you all ask nicely enough, we’ll see some more top-tier silicon vendors offering official Rust support for their chips (hint, hint)!
<thejpster[m]1> mabez I got Espressif onto the Raspberry Pi blog. You're welcome ;)
K900 has quit [Quit: Idle timeout reached: 172800s]
andar1an[m]1 has quit [Quit: Idle timeout reached: 172800s]
mrkajetanp has quit [Ping timeout: 252 seconds]
Artea has quit [Quit: ZNC 1.8.2 - https://znc.in]
Artea has joined #rust-embedded
Artea has quit [Quit: ZNC 1.8.2 - https://znc.in]
Artea has joined #rust-embedded
AugustoRoman[m] has joined #rust-embedded
<AugustoRoman[m]> Is there a recommended approach for logging in a library that will be used both on an embedded device AND on my mac running locally and using embedded_graphics_simulator? I normally use defmt for embedded but couldn't figure out how to get that to log to the terminal in local mode.
Artea has quit [Ping timeout: 272 seconds]
mrkajetanp has joined #rust-embedded
<dirbaio[m]> <AugustoRoman[m]> "Is there a recommended approach..." <- Embassy uses this to support both defmt and log, feel free to copy-paste https://github.com/embassy-rs/embassy/blob/main/embassy-usb/src/fmt.rs
<dirbaio[m]> (Due to reasons of how the macros work it cant be made into a reusable crate, it must be copy-pasted...)
<AugustoRoman[m]> that's perfect, thanks!
<AugustoRoman[m]> dirbaio[m]: I just found https://lib.rs/crates/defmt-or-log and was looking through it. It seems like it's similar, but I don't understand the fine points of rust to determine why it's a crate vs the usb solution.
<dirbaio[m]> From a quick reading of the code it still needs your crate to have defmt/log features and conditionally depend on defmt
<dirbaio[m]> And if the user depends on two libs that use defmt-or-log and enables defmt only in one, the other will break
<dirbaio[m]> Same issues I ran into when I tried to make that fmt.rs into a crate
<dirbaio[m]> I think they're unfixable
<AugustoRoman[m]> I briefly tried to look into making a logger for defmt that would log to the terminal instead of exporting over some other transport, but I quickly got lost. Seems like it should be relatively straightforward, at least conceptually.
<dirbaio[m]> Due to The elf hacks it does it might be hard to get working on windows, Mac
PeterKrull[m] has joined #rust-embedded
<PeterKrull[m]> Hey, anyone here who have done "routing" of signals within the firmware, or have any ideas on how to do so? I use embassy, and I have some logic that determines how my different tasks inputs and outputs (essentially SPMC channels) connect to each other based on some state. With my current implementation I have a task that is... (full message at
<PeterKrull[m]> * Hey, anyone here who have done "routing" of async channel values within the firmware, or have any ideas on how to do so? I use embassy, and I have some logic that determines how my different tasks inputs and outputs (essentially SPMC channels) connect to each other based on some state. With my current... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/HeaEjKkpSRprTKzxRibZUiDz>)
<PeterKrull[m]> * Hey, anyone here who have done "routing" of async channel values within the firmware, or have any ideas on how to do so effectively? I use embassy, and I have some logic that determines how my different tasks inputs and outputs (essentially SPMC channels) connect to each other based on some state. With my... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/JideOFvGwVbJxRTJUKqYUUTA>)
d3zd3z[m] has joined #rust-embedded
<d3zd3z[m]> I am finding that `Arc::new(MyThing::new()) as Arc<dyn MyTrait>` works with alloc's Arc, but gives a non-primitive cast error when trying to use the portable-atomic-util Arc.
<JamesMunns[m]> d3zd3z[m]: probably either an API gap (that could be fixed), or it might be a behavior that is only available to the real Arc, which might not be fixable.
<JamesMunns[m]> (that's probably not helpful, but just a heads up it could be the latter case, at least)
<d3zd3z[m]> ChatGPT suggested `Arc<Box<...>>` as a workaround, and also suggested the util's Arc might need an UnsizedCoerce impl.
<JamesMunns[m]> As a human, I can't comment on suggestions by statistical models :)
<JamesMunns[m]> <PeterKrull[m]> "Hey, anyone here who have done..." <- > <@peterkrull_:matrix.org> Hey, anyone here who have done "routing" of async channel values within the firmware, or have any ideas on how to do so effectively? I use embassy, and I have some logic that determines how my different tasks inputs and outputs (... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/zbUlrGSJEPTqsgeYHgBbvVue>)
<JamesMunns[m]> JamesMunns[m]: like, it doesn't answer your question, but there are likely other ways to potentially structure the code, that doesn't require one central "message bus" of events
<PeterKrull[m]> I just find channels (a no_std re-impl of https://docs.rs/tokio/latest/tokio/sync/watch/index.html to be exact) extremely intuitive and a nice abstraction for what I am doing, which is a flight controller. There are many signals being updated constantly at different rates, and receivers should, as much as possible, be immediately awaken when some input signal changes. This is mostly relevant for my filters (controllers,
<PeterKrull[m]> estimators, etc.) which are implemented as tasks, the inputs and outputs of which should be configurable depending on the flight mode. Implementing the filters as tasks means I can put the most timing-sensitive stuff in an interrupt executor. I essentially want the tasks to now know where their input came from, since that is handled somewhere else, which is the routing task in my case.
<JamesMunns[m]> As an example: You could instead model that as a Mutex and a WaitQueue, meaning that only the latest value is kept, and any waiting task can be awoken when the value is updated.
<JamesMunns[m]> then each task would just be awaiting the data it is interested in, and doing one "step" each time any of it's inputs change, and then effect an output.
mrkajetanp has quit [Ping timeout: 276 seconds]
<JamesMunns[m]> Sorry - this probably isn't helpful, "just do something else instead" is kind of a lame answer to your question
<JamesMunns[m]> but on no-std systems where we don't have things like LocalSet or heap allocated channels or broadcast channels, it often IS awkward to do channel multiplexing like this, even though it seems like a good idea to reach for, conceptually.
<JamesMunns[m]> But - I'll leave it there if that answer isn't interesting, happy to chat if you're interested tho.
<d3zd3z[m]> <d3zd3z[m]> "ChatGPT suggested `Arc<Box<...>>..." <- Digging through the code a bit, there is both a comment as to why UnsizedCoerce is unstable and therefore not implemented, and a pointer to a woraround
<d3zd3z[m]> s/woraround/workaround. Basically, Allocate a Box first, and then use `Arc::from` to turn that into an Arc. The coercion happens with the box, which supports it./
<Gnome[m]> <dirbaio[m]> "you know something being in..." <- > I know, silly, but that's my motivation
<PeterKrull[m]> JamesMunns[m]: No, its fine! I want to consider all options. I also just want to make sure what I am doing is not completely idiotic, but maybe just a bit awkward to implement.
m5zs7k_ has joined #rust-embedded
dav1d has quit [Quit: Ping timeout (120 seconds)]
m5zs7k has quit [Read error: Connection reset by peer]
dav1d has joined #rust-embedded
m5zs7k_ is now known as m5zs7k
rom4ik1 has quit [Read error: Connection reset by peer]
rom4ik1 has joined #rust-embedded
<thejpster[m]1> I had a chat with Arm today about ROPI and RWPI. They are going to send a fix to LLD to get rid of the error about unsupported relocation type in a debug section. But they said ROPI and RWPI only work on C and aren’t supported for C++ so we might have trouble with trait objects (because the vtable can’t live at a static address). Also statics can’t contain the address of another static.
<thejpster[m]1> If you are running code from RAM, PIC might work ok. Apparently the fixups are fairly easy.
BenPitcairn[m] has quit [Quit: Idle timeout reached: 172800s]
alex[m]12 has quit [Quit: Idle timeout reached: 172800s]
cyrozap_ is now known as cyrozap