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
GenTooMan has quit [Remote host closed the connection]
GenTooMan has joined #rust-embedded
nex8192 has left #rust-embedded [Error from remote client]
nex8192 has joined #rust-embedded
starblue has quit [Ping timeout: 248 seconds]
starblue has joined #rust-embedded
therealprof[m] has joined #rust-embedded
<therealprof[m]> <adinack[m]> "i have never used this platform..." <- I noticed the PRs, thanks for that, but I'm currently on business travel across the continents... I'll have a quick look now but not promises... Please ping me again in 8 days or so if no one else takes care of them in the meantime.
<adinack[m]> therealprof[m]: thank you, no rush, i just wanted to get my foot into this chat, enjoy the continents
<therealprof[m]> All good, I do need a reminder every now and then to not miss anything in the excessive GH spam.
<therealprof[m]> I left some comments.
<adinack[m]> thank you!
vrakaslabs[m] has joined #rust-embedded
<vrakaslabs[m]> Alright, I've got a barebones Ethernet driver working on the Teensy 4.1: https://github.com/Timvrakas/rt1062-eth-rs
<vrakaslabs[m]> Is there any documentation on how to integrate new hardware with existing network stacks? I presume smoltcp is what I should be targeting?
<vrakaslabs[m]> * Alright, I've got a barebones Ethernet driver working on the Teensy 4.1: https://github.com/Timvrakas/rt1062-eth-rs/blob/master/src/main.rs
<vrakaslabs[m]> Is there any documentation on how to integrate new hardware with existing network stacks? I presume smoltcp is what I should be targeting?
crabbedhaloablut has joined #rust-embedded
<vrakaslabs[m]> <vrakaslabs[m]> "Alright, I've got a barebones..." <- At this point think I'm mostly unclear what an MVP setup of smoltcp looks like. I'm used to lwip with FreeRTOS, and in that setup I would aim for an ICMP demo as the proof of concept.
<vrakaslabs[m]> vrakaslabs[m]: For ICMP reply to work do I need need to call `iface.poll()` in a loop?
<vrakaslabs[m]> <vrakaslabs[m]> "For ICMP reply to work do I need..." <- Also I'm unclear if/how smoltcp handles interrupts from the Ethernet hardware, and what the timing looks like for RxTokens. Where in the process does the system wait until a packet is RXd?
<vrakaslabs[m]> vrakaslabs[m]: (I am very new to Rust, but I've written Ethernet drivers before, in C/++)
dirbaio[m] has joined #rust-embedded
<dirbaio[m]> <vrakaslabs[m]> "```fn consume<R, F>(mut self, f:..." <- > Is this meant to be blocking? That seems like it would prevent the poll() from returning,... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/goqrONOzxEmoWqzLhAGZyvCc>)
<dirbaio[m]> dirbaio[m]: > Also I'm unclear if/how smoltcp handles interrupts from the Ethernet hardware,... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/kWDDXdDoNSCUVRFLASSswgaE>)
<dirbaio[m]> dirbaio[m]: this is for raw smoltcp, which is more low-level, everything's based on manual polling so that it's agnostic to execution model (interrupts, tasks..)
<dirbaio[m]> dirbaio[m]: you might want to check out [embassy-net](https://crates.io/crates/embassy-net) for a higher-level alternative. it wraps `smoltcp` with `async`, so it's more similar to what you'd expect from a network stack in a C RTOS.
<dirbaio[m]> dirbaio[m]: so you spawn a backgournd task that handles the network stack, then you can await sending/receiving data on sockets from multiple of your tasks
<dirbaio[m]> > Also I'm unclear if/how smoltcp handles interrupts from the Ethernet hardware,... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/YQOucCrMGHwOvrYRMGKOgNYC>)
nex8192 has left #rust-embedded [Error from remote client]
nex8192 has joined #rust-embedded
hmw has quit [Quit: Bye.]
hmw has joined #rust-embedded
nex8192 has left #rust-embedded [Error from remote client]
nex8192 has joined #rust-embedded
emerent has quit [Ping timeout: 256 seconds]
emerent_ has joined #rust-embedded
emerent_ is now known as emerent
GeorgesP[m] has joined #rust-embedded
<GeorgesP[m]> Hi, using serde-json-core, how to deserialize a JSON with an array of elements with different types like this one : "{["a string", 4]}" ? I use heapless::Vec for the array, but if I use enum to manage the different types, then serde-json-core expect b'"' or b'{' and return Error:: ExpectedSomeValue ... (no_std question)
JamesMunns[m] has joined #rust-embedded
<JamesMunns[m]> To support this, you would need something like serde json's Value type, and it would probably require a heap (in the general case). serde json core specifically doesn't support that.
<GeorgesP[m]> Is there a way with heapless or some alloc on stack ? (Would prefer get heap free)
crabbedhaloablut has quit []
Foxyloxy has quit [Ping timeout: 245 seconds]
Foxyloxy has joined #rust-embedded
<JamesMunns[m]> Not easily, the main issue is that a value can contain another value, so you have a recursive type.
<JamesMunns[m]> There are some different hacks you could use like limiting it to "a list of up to 20 items that can each be a number or a string of up to 10 characters", that could work with heapless, but there's not a general way to solve this afaik.
<vrakaslabs[m]> <dirbaio[m]> "so you spawn a backgournd task..." <- Thanks for the help, I’ll take a look tonight!
nex8192 has left #rust-embedded [Error from remote client]
nex8192 has joined #rust-embedded
ignormies[m] has joined #rust-embedded
<ignormies[m]> Hey guys, I'm trying to switch my (stm32f411) program from `rtt_target` to `defmt` for my logging, but I'm encountering a weird issue.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/gHqDkEGjDQsOQgptPUldxOmV>)
<ignormies[m]> (I should clarify that `cargo run` resolves to `probe-run --chip STM32F411CEUx <my target>`)
nex8192 has left #rust-embedded [Error from remote client]
M9names[m] has joined #rust-embedded
<M9names[m]> Does your embed.toml specify that the RTT is defmt encoded?
<ignormies[m]> I'm not 100% sure -- this is what my `Embed.toml` looks like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/GCoSvBkJdLabJMApCXlVEuDU>)
Noah[m] has joined #rust-embedded
<Noah[m]> ignormies[m]: > <@ignormies:matrix.org> I'm not 100% sure -- this is what my `Embed.toml` looks like:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/bYLJYQrShSrkCvnsPDzUYKdK>)
<Noah[m]> channels = [{ up = 0, up_mode = "BlockIfFull", format = "Defmt" }] should do the trick
<ignormies[m]> Ah! Ok adding a channel with format = "Defmt" works! Thanks so much!