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
sahuagin has joined #rust-embedded
sahuagin has quit [Quit: leaving]
causal has quit [Quit: WeeChat 3.7.1]
<re_irc> <Joshua Ferguson> hey got any recommendations for devices to get into embedded systems that's not Arduino or raspberry pi?
<Darius> joshua: STM32 board? Or some other ARM board
<Darius> of course the stock situation for STM32s is pretty dire at the moment...
<re_irc> <Joshua Ferguson> yeah, kind of wanted to get another pi or two, but that's not happening
<Darius> RP2040 perhaps?
<re_irc> < (@mabez:matrix.org)> Joshua Ferguson: How about esp32? :)
<Darius> it is easy to buy two and flash one with the debug tool and use it to debug the other
<Darius> not sure about Rust and ESP32
dc740 has quit [Remote host closed the connection]
<re_irc> <Joshua Ferguson> looking it up, it looks like it's fairly cheap (3 for $20), and I can find examples that compiled at one point, I'll check them out
<Darius> they're AUD$7 each (RPi Pico) here and you can mount two on a breadboard pretty easily
<re_irc> < (@pauldfaria:matrix.org)> In the US the picos are $4 each. $6 with wifi but the support for that in rust is still being built out
starblue has quit [Ping timeout: 265 seconds]
starblue has joined #rust-embedded
<re_irc> < (@jamesmunns:beeper.com)> Joshua Ferguson definitely check out https://github.com/rp-rs/rp-hal for the RP2040, and https://esp-rs.github.io/book/ for the ESP32 :)
neceve has quit [Quit: ZNC - https://znc.in]
neceve has joined #rust-embedded
<re_irc> < (@CyReVolt:matrix.org)> https://github.com/orangecms/ch32v307-rust
<re_irc> I've started a bit of a demo (read: Daniel cluelessly hacking again) for the WCH CH32V307, should anyone be interested.
<re_irc> Feedback is welcome. :)
<re_irc> < (@sajattack:matrix.org)> feedback: it might be a good idea to keep embedded-hal implementations and application code separate
<re_irc> < (@sajattack:matrix.org)> and look into embedded_hal::digital::OutputPin and embedded_hal::blocking::Delay
IlPalazzo-ojiisa has joined #rust-embedded
bjc has quit [Remote host closed the connection]
<re_irc> <einferd> Hello everyone! I use an ESP32-C3 to collect measurements and send them via WiFi. So far it works, but I would like to store some data in the RTC memory during deep sleep. In C this is accomplished by annotating a variable with RTC_DATA_ATTR. Is there a way to do that in rust? Here is my code, if you are interested: https://github.com/friedrich/soil-moisture-sensor/tree/main/firmware
<re_irc> < (@explodingwaffle101:matrix.org)> I think youโ€™d get better luck asking in the esp rust matrix (donโ€™t have the link sorry), but it can probably be done with a link-section attribute of some kind
<re_irc> < (@amanda:graven.dev)> #esp-rs:matrix.org (https://matrix.to/#/#esp-rs:matrix.org) is the address of the room
<re_irc> <einferd> ๐Ÿ‘๐Ÿป Thanks!
<re_irc> <Stephen D> : Sorry for the very late response. I had a bug in element that made it not let me scroll up past a certain point. I'm on an stm32f411 so I have no tim6 or tim7. I'm going to keep trying stuff with tim1. I'm trying the non-pwm way of doing it but it's not helping. Thank you for the advice!
dc740 has joined #rust-embedded
<re_irc> < (@barafael:matrix.org)> I used postcard 0.7.3 which was fun. An enum variant with an u32 inside was always 5 bytes long. Now postcard 1.0 uses COBS, which is impressive and nice. However, the added complexity of needing to use an accumulator is not worth it for me. Is there another crate I can use instead?
<re_irc> < (@jamesmunns:beeper.com)> as a note, COBS isn't required in postcard 1.0
<re_irc> < (@jamesmunns:beeper.com)> the major change was using varints for all numbers
<re_irc> < (@barafael:matrix.org)> ok, I confused that then! Thanks for clarifying!
<re_irc> < (@jamesmunns:beeper.com)> yup! For example:
<re_irc> enum Ex {
<re_irc> B(u16),
<re_irc> A(u32),
<re_irc> < (@barafael:matrix.org)> Right, this is why I saw my client app running into timeouts
<re_irc> < (@jamesmunns:beeper.com)> Were you waiting for a fixed number of bytes (like 5?)
<re_irc> < (@barafael:matrix.org)> yup
<re_irc> < (@barafael:matrix.org)> I used "read_exact"
<re_irc> - Still use COBS (so you have definite framing)
<re_irc> < (@jamesmunns:beeper.com)> Ah yeah, that'll do it. You can either:
<re_irc> - There's a PR to add fixed size wrapper types
<re_irc> - Try to deserialize (and fail if you have an incomplete message, sorta CPU wasteful)
<re_irc> < (@jamesmunns:beeper.com)> (the third option basically "restores" the old postcard 0.x behavior)
<re_irc> < (@jamesmunns:beeper.com)> Oh, I guess fixint was merged, but I forgot to release?
<re_irc> < (@jamesmunns:beeper.com)> I can fix that later today, you can try it out with the git "main" branch for now
<re_irc> < (@barafael:matrix.org)> sweet :D thanks!
<re_irc> < (@jamesmunns:beeper.com)> https://github.com/jamesmunns/postcard/blob/main/src/fixint.rs if you want to skim the docs
<re_irc> < (@jamesmunns:beeper.com)> (also lets you customize little/big endian, if that's your preference :D)
<re_irc> < (@barafael:matrix.org)> super cool. Exactly what I needed I suppose :D !
<re_irc> < (@jamesmunns:beeper.com)> I'd _probably_ recommend the COBS approach, unless:
<re_irc> - You already have some reliable pipe, e.g. TCP+TLS
<re_irc> - you REALLY need to be conservative with bytes on the wire
<re_irc> < (@jamesmunns:beeper.com)> mostly because otherwise with the "read_exact" approach you could get 'out of sync' if you ever lose a byte (and/or maybe have a byte corrupted).
<re_irc> < (@jamesmunns:beeper.com)> COBS doesn't let you recover the corrupted/incomplete message, but at least lets you limit the "blast radius" to one message: e.g. you can definitely recover when you get the next framing zero.
<re_irc> < (@jamesmunns:beeper.com)> but that's just my $0.02, take it for what you paid for it :D
<re_irc> < (@jamesmunns:beeper.com)> (but you definitely CAN get lost/corrupted data on both serial ports AND TCP w/o TLS)
<re_irc> < (@Ericson2314:matrix.org)> Follow up on my question from before, I am getting https://stackoverflow.com/questions/66723246/how-to-fix-rust-lld-error-sbrel-relocation-to-xxx-without-static-base-with-rwpi from my symbols which are not valid addresses (not contained in any section)
<re_irc> < (@Ericson2314:matrix.org)> I though "OK, I'll just turn of RWPI and go back to ROPI"
<re_irc> < (@Ericson2314:matrix.org)> But that didn't fix it!
<re_irc> < (@Ericson2314:matrix.org)> these are absolutely symbols, I don't care what ABI says what, I don't want them to be relative anything
<re_irc> < (@Ericson2314:matrix.org)> I could get rid of the length ones my doing "end - start" in code, but I also have some physical addr ones
<re_irc> < (@barafael:matrix.org)> : I got no TLS, I got jumper wires.
<re_irc> < (@barafael:matrix.org)> so, I'll take your advice, thanks :)
<re_irc> < (@Ericson2314:matrix.org)> not really sure what to do about the phys attr ones than make some dummy section without a segment so it shuts up
<re_irc> < (@jamesmunns:beeper.com)> : You can also use the experimental max size (https://docs.rs/postcard/latest/postcard/experimental/index.html#max-size-calculation) features, to figure out EXACTLY how large your cobs accumulator value needs to be :D
<re_irc> < (@jamesmunns:beeper.com)> Feel free to ping me if you have any troubles using COBS, the accumulator, etc.
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<re_irc> <Stephen D> As a quick update. I got DMA working with the ADC ( ๐ŸŽ‰) but I'm triggering the ADC directly. I'm having difficulties getting a timer to trigger the ADC
<re_irc> < (@Ericson2314:matrix.org)> ah! there was an "-frwpi" to clang in a build.rs, tsk tsk
<re_irc> < (@Ericson2314:matrix.org)> should be able to get clang to use the same target spec with just a little bit of pre-processing
IlPalazzo-ojiisa has joined #rust-embedded
limpkin has quit [Quit: limpkin]
limpkin has joined #rust-embedded
starblue has quit [Ping timeout: 260 seconds]
<re_irc> <alvela> Following up on this for future Ctrl+F ppl, I reached out to one of the maintainers and they were kind enough to help.
<re_irc> The issue ended up being a private method for a struct in w5500 shadowing the same-named method in the embedded-nal "TcpClientStack" trait. Making "eth" and "socket" mutable and changing the connect method call to "eth.connect(&mut socket, SocketAddr::new(...))" did the trick! More details here:
gordea has joined #rust-embedded
gordea has quit [Client Quit]
gordea has joined #rust-embedded
causal has joined #rust-embedded
emerent has quit [Ping timeout: 260 seconds]
emerent has joined #rust-embedded
starblue has joined #rust-embedded
conplan has quit [Quit: Leaving.]
starblue has quit [Ping timeout: 256 seconds]
starblue has joined #rust-embedded