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
badrb[m] has joined #rust-embedded
<badrb[m]> Hi! Does any one have some recommendation for a modbus no_std crate?
<JamesMunns[m]> quick question, are you being a modbus master or slave in no_std mode?
<JamesMunns[m]> There's https://github.com/slowtec/modbus-core, but IIRC it only supported being a slave in no_std, which doesn't help if you want to talk to an external meter or something
<badrb[m]> Master
vollbrecht[m] has joined #rust-embedded
<badrb[m]> modbus-rtu
<vollbrecht[m]> are you wanting modbus-rtu or modbus-tcp :D
<JamesMunns[m]> Yeah that's a good question too, I was assuming rti
<JamesMunns[m]> s/rti/rtu/
<JamesMunns[m]> yeah, modbus-core::rtu only provides slave/server, not master/client
<JamesMunns[m]> I found that in a project recently, I think I ended up hacking together a basic master/client library by using some of the bits from tokio-modbus and modbus-core, but it wasn't a general solution, I basically implemented enough to talk to the three slave/server nodes I needed for that project
<JamesMunns[m]> maybe someone else knows of a better solution
<diondokter[m]> I've used this one with good success: https://github.com/alttch/rmodbus
<vollbrecht[m]> rmodbus claims no_std support but just from reading
<badrb[m]> I was surprised to not find much in the no_std realm, Modbus is fairly common.
<diondokter[m]> I've used it as both a server and a client
<JamesMunns[m]> tokio-modbus I've seen at a couple customers, but they are all on PCs talking to external sensors/actuators
<badrb[m]> JamesMunns[m]: Do you have sources published? It might be a good inspiration
<JamesMunns[m]> badrb[m]: no, sorry, that was a private customer project
<badrb[m]> Thanks guys, I’ll take a look at rmodbus!
<diondokter[m]> Here's my server code for rmodbus. It's flexible enough that I could put an async layer on top of it. Though, that's not really required to use, it was more to challenge myself 😬
<diondokter[m]> But the core of it is pretty much what they've written in the docs. So that's the best starting point
notgull has quit [Ping timeout: 246 seconds]
notgull has joined #rust-embedded
starblue has quit [Ping timeout: 268 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]
emerent_ has joined #rust-embedded
emerent is now known as Guest5403
Guest5403 has quit [Killed (platinum.libera.chat (Nickname regained by services))]
emerent_ is now known as emerent
AnandGedam[m] has joined #rust-embedded
<AnandGedam[m]> Hello all,
<AnandGedam[m]> I am beginning to explore rust for my FPGA board.
<AnandGedam[m]> Any leads or documentations to write startup code in rust for riscv architecture?
FlixtheNewbie[m] has joined #rust-embedded
<FlixtheNewbie[m]> Hello, I want to shrink my firmware size as much as possible, and I wonder if in this code, both constants have the same size or not:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/suyPHLKtkHUyXlxDpQiWTWTp>)
<FlixtheNewbie[m]> * Hello, I want to shrink my firmware size as much as possible, and I wonder if in this code, both constants data use the same size or not:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/KpOqMSSfCkDozCsBlPTSvNAq>)
<FlixtheNewbie[m]> I know that if we take only the array into account, the first one is bigger, but if I use a reference to Foo::Nothing, what space does it take? A full Foo size, or just one byte?
<FlixtheNewbie[m]> If the latter takes less space, how costly is such a series of indirections when I iterate over the array?
<FlixtheNewbie[m]> * the array on the FLASH?
burrbull[m] has joined #rust-embedded
<burrbull[m]> <FlixtheNewbie[m]> "I know that if we take only..." <- `size_of<ref> == size_of<usize>` 4 bytes for 32bit system
crabbedhaloablut has joined #rust-embedded
<vollbrecht[m]> dirbaio: didn't you want to release embedded-hal on gh? its still missing the gh release
thejpster[m] has joined #rust-embedded
<thejpster[m]> consts take zero space - they are pasted into the usage site at compile time.
<thejpster[m]> But Foo is 132 bytes and &Foo is 4 or 8 bytes (depending on platform). I suspect you’d get a single static Foo with the value Nothing and all the references would point to it.
<thejpster[m]> Indirections are low cost unless you have cache. You’d have to benchmark your application, but personally I wouldn’t worry about it until performance had been proven to be outside acceptable limits.
KarthiR[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7282 has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
jessebraham[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7282 has left #rust-embedded [Error from remote client]
Guest7282 has joined #rust-embedded
<dav1d> If I want to pass messages between embassy tasks, is the way to do it with a 'static Channel?
Guest7282 has left #rust-embedded [Error from remote client]
<diondokter[m]> <dav1d> "If I want to pass messages..." <- yes indeed! If you look at e.g. embassy-sync, then you'll see multiple flavours of channels. One of those will surely work for you
<dav1d> diondokter[m], cool thanks, wasnt sure if I have to make them static or if I can pass references
<diondokter[m]> To pass something to an embassy task, it needs to be 'static, so yes
Guest7282 has joined #rust-embedded
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
<FlixtheNewbie[m]> <thejpster[m]> "Indirections are low cost unless..." <- Thanks a lot, that's clear. I'll use the reference mechanism, then, I will be able to save a lot of space.
IlPalazzo-ojiisa has quit [Ping timeout: 264 seconds]
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
starblue has quit [Ping timeout: 256 seconds]
kenny has quit [Quit: WeeChat 4.1.1]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
bartmassey[m] has quit [Quit: Idle timeout reached: 172800s]
spinfast[m] has quit [Quit: Idle timeout reached: 172800s]
GrantM11235[m] has quit [Quit: Idle timeout reached: 172800s]
mameluc[m] has quit [Quit: Idle timeout reached: 172800s]
firefrommoonligh has quit [Quit: Idle timeout reached: 172800s]
dirbaio[m] has quit [Quit: Idle timeout reached: 172800s]
<dav1d> is there something like FuturesUnordered for embedded?
<dav1d> (aka no_std)
<dav1d> basically embassy-futures but with alloc
starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
_whitelogger has joined #rust-embedded