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
firefrommoonligh has quit [Quit: Idle timeout reached: 172800s]
emerent has quit [Ping timeout: 260 seconds]
emerent has joined #rust-embedded
innegatives has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
starblue has quit [Ping timeout: 272 seconds]
starblue has joined #rust-embedded
jasperw has quit [Ping timeout: 252 seconds]
jasperw has joined #rust-embedded
Rahix has quit [Ping timeout: 272 seconds]
thomas25 has quit [Ping timeout: 272 seconds]
thomas25 has joined #rust-embedded
Rahix has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]
crabbedhaloablut has joined #rust-embedded
Guest7221 has joined #rust-embedded
Guest7221 has left #rust-embedded [Error from remote client]
WSalmon has quit [Quit: No Ping reply in 180 seconds.]
WSalmon has joined #rust-embedded
vrakaslabs[m] has quit [Quit: Idle timeout reached: 172800s]
Guest7221 has joined #rust-embedded
culk has quit [Ping timeout: 272 seconds]
IlPalazzo-ojiisa has joined #rust-embedded
xfbs[m] has quit [Quit: Idle timeout reached: 172800s]
notgull has quit [Ping timeout: 260 seconds]
GenTooMan has quit [Ping timeout: 272 seconds]
notgull has joined #rust-embedded
GenTooMan has joined #rust-embedded
crabbedhaloablut has quit []
crabbedhaloablut has joined #rust-embedded
Guest7221 has left #rust-embedded [Error from remote client]
Guest7221 has joined #rust-embedded
ejpcmac[m] has joined #rust-embedded
<ejpcmac[m]> Hello! Is there any library to easily do RPC from a host to a embeded target? Like anything close or far from:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/jKcDvnteArzKnxBZpEvDjIpx>)
<JamesMunns[m]> Not totally that out of the box, but I've built this shape a bunch before using postcard and a shared serde type
<JamesMunns[m]> https://github.com/jamesmunns/pretty-hal-machine is an example of that design (over USB)
<ejpcmac[m]> Yeah, indeed anything going into that direction is what I’m looking for :)
<ejpcmac[m]> Basically what I’d like to use this is to test a HAL.
<ejpcmac[m]> To write tests on the host, so that I could as well control a counterpart.
<JamesMunns[m]> I am working on something a lot closer to being a "whole package" instead of "building blocks" right now, but it's still a WIP.
<ejpcmac[m]> If you have some ideas, or some place to organise I’d be willing to contribute.
<ejpcmac[m]> I don’t have a big badwidth currently, but I’m craving a bit embedded development at home, so I’d have a few hours here and there.
Farooq has quit [Quit: Idle timeout reached: 172800s]
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
corecode has quit [Quit: ZNC - http://znc.in]
crabbedhaloablut has quit []
Jonas[m]1 has joined #rust-embedded
<Jonas[m]1> I now have an Adafruit SWD breakout board, that I want to use to program an Adafruit nRF52840 feather express. I already have an Raspberry Pi Pico board that I used to program another Raspberry Pi Pico using probe-rs run. From the Pico I had three jumper wires to SWD: SWDIO, SWCLK and RESET. As how I have understood it now, I can use this Pico and connect the jumper wires to the SWD breakout board instead. But how should I connect
<Jonas[m]1> the jumper wires? The breakout board has pins for SWIO, SWO, CLK, RESET, and I should probably also connect GND and Vcc. What pins do I need to connect on the breakout board and how? Perhaps I have totally misunderstood something? :D https://www.adafruit.com/product/2743
<Jonas[m]1> Jonas[m]1: found a PDF guide here, looks like they only use the pins for SWDIO, SWCLK, RESET, GND and Vcc. https://cdn-learn.adafruit.com/downloads/pdf/programming-an-m0-using-an-arduino.pdf
<dirbaio[m]> Jonas[m]1: bare minimum is swdio, swclk, gnd
<dirbaio[m]> dirbaio[m]: you only need reset if you want to do pin resets. probe-rs doesn't use it, it resets via swd instead
<dirbaio[m]> dirbaio[m]: you only need vcc if you want to power the target from the probe.
<dirbaio[m]> dirbaio[m]: if you're already powering the target independently you should *not* connect it
JonathanDickinso has joined #rust-embedded
<JonathanDickinso> I noticed that the I2C is not resetting between write and read for write_read (it really should according to spec), or am I reading the code incorrectly?
<Jonas[m]1> <dirbaio[m]> "if you're already powering the..." <- I clearly did something very wrong 🤣 When doing `cargo run` I got this message `Error: No loadable ELF sections were found.` and I could smell something burned, the nrf board become very hot, and I disconnected 😢
crabbedhaloablut has joined #rust-embedded
<Jonas[m]1> <Jonas[m]1> "I clearly did something very..." <- I should probably not power the board over the breakout board. But it is hard to understand what I did so wrong so that it get very hot 🔥
<Jonas[m]1> Jonas[m]1: Ah, maybe.... Pico VBUS is probably 5V, and I should probably power only with 3V over the SWD. My mistake. But now I understand.
<dirbaio[m]> Jonas[m]1: oof
crabbedhaloablut has quit [Client Quit]
<Jonas[m]1> dirbaio[m]: I now only changed to 3V ... things look Ok and no smoke. But I get the same error from probe-run. I need to double check my memory.x file, I think.
<Jonas[m]1> Jonas[m]1: The board is blinking, because it runs what was loaded from factory. So the chip should have survived, I hope.
<Jonas[m]1> This is my memory.x now: MEMORY { FLASH : ORIGIN = 0x26000, LENGTH = 796K RAM : ORIGIN = 0x20000008, LENGTH = 256K }
<Jonas[m]1> s///, s///
<Jonas[m]1> Jonas[m]1: we got the flash address for nrf52840 from https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/hathach-memory-map
<Jonas[m]1> Jonas[m]1: Perhaps 796K is wrong for flash length?
<dirbaio[m]> Jonas[m]1: do you have `-Tlink.x`? in either `build.rs` or `.cargo/config.toml`?
<JonathanDickinso> <ejpcmac[m]> "Hello! Is there any library to..." <- > <@jpc:ejpcmac.net> Hello! Is there any library to easily do RPC from a host to a embeded target? Like anything close or far from:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/IdQQhrJHAjOkVApYEfZIPOQu>)
<Jonas[m]1> dirbaio[m]: nope, I have never heard about that file. I have only done rp2040 work before.
<Jonas[m]1> Jonas[m]1: What is `build.rs` is that some alternative to cargo?
<Jonas[m]1> Jonas[m]1: My `.cargo/config.toml` only has "target" and "runner".
<Jonas[m]1> Jonas[m]1: This is the initial tutorial that I followed, because there is not much tutorials/documentations for Rust + nRF52840.... and then I learned that the HAL was stale, so I tried the HAL in embassy that seem to have little to no documentation for non-async things. https://nitschinger.at/Getting-Started-with-the-nRF52840-in-Rust/
<Jonas[m]1> <Jonas[m]1> "This is the initial tutorial..." <- By reading your link dirbaio it looks like I should create a `build.rs` file when working with Embassy. But from where should I get the files?
<dirbaio[m]> Jonas[m]1: the `build.rs` way is not embassy-specific, it applies to all embedded rust
<dirbaio[m]> dirbaio[m]: the generic cortex-m quickstart also uses it
<dirbaio[m]> dirbaio[m]: the build.rs way is the newer way
<dirbaio[m]> dirbaio[m]: there's also the older way which was adding it to `.cargo/config.toml`
<dirbaio[m]> dirbaio[m]: maybe you have that
<dirbaio[m]> dirbaio[m]: if you have neither, build will output an empty binary
<dirbaio[m]> dirbaio[m]: causing the "No loadable ELF sections were found" error
<Jonas[m]1> dirbaio[m]: true, all rp2040 from the "template" use info in `.cargo/config.toml`. I was not aware about it. https://github.com/rp-rs/rp2040-project-template/blob/main/.cargo/config.toml
<dirbaio[m]> * there's also the older way which was adding it to `.cargo/config.toml`
<dirbaio[m]> for example from the tutorial you linked: https://github.com/daschl/nrf52840dk-sample/blob/main/.cargo/config.toml#L4
<dirbaio[m]> Jonas[m]1: yup
<Jonas[m]1> dirbaio[m]: that explains everything. Thanks!
<Jonas[m]1> <Jonas[m]1> "that explains everything. Thanks..." <- I copy pasted the `build.rs` and put it outside the `src` directory. Then `cargo run` and now I get linking errors instead. So it is a step further.
<Jonas[m]1> `note: rust-lld: warning: section type mismatch for .uninit.defmt-rtt.BUFFER`
<Jonas[m]1> Jonas[m]1: Perhaps there are any docs or tutorials I can follow for this?
<Jonas[m]1> Jonas[m]1: > <@jlpettersson:matrix.org> I copy pasted the `build.rs` and put it outside the `src` directory. Then `cargo run` and now I get linking errors instead. So it is a step further.
<Jonas[m]1> > `note: rust-lld: warning: section type mismatch for .uninit.defmt-rtt.BUFFER`
<Jonas[m]1> the linking error message is big. It is also about "critical-section thing".
<dirbaio[m]> Jonas[m]1: > <@jlpettersson:matrix.org> I copy pasted the `build.rs` and put it outside the `src` directory. Then `cargo run` and now I get linking errors instead. So it is a step further.
<dirbaio[m]> these are warnings, you can ignore them
<dirbaio[m]> > `note: rust-lld: warning: section type mismatch for .uninit.defmt-rtt.BUFFER`
<dirbaio[m]> dirbaio[m]: to fix the critical-section stuff, enable feature `critical-section-single-core` for `cortex-m` in your `Cargo.toml`
<Jonas[m]1> dirbaio[m]: Thanks. Now it flashes the program!!
<Jonas[m]1> But I have probably configured wrong address for RAM, I got (HOST) WARN no RAM region appears to contain the stack; probe-run can't determine if this was a stack overflow stack backtrace: 0: HardFaultTrampoline
<dirbaio[m]> Jonas[m]1: `RAM : ORIGIN = 0x20000008, LENGTH = 256K }`
<dirbaio[m]> dirbaio[m]: len must be `256K - 8`
<dirbaio[m]> dirbaio[m]: or stack starts 8 bytes past the end of ram
<Jonas[m]1> dirbaio[m]: right, but what is the syntax for that ?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/ovTVXFDzVQlWLMjAPtOxybYt>)
<Jonas[m]1> Jonas[m]1: sorry, my mistake...
<Jonas[m]1> Jonas[m]1: Got it flashing!!
<Jonas[m]1> Jonas[m]1: but it does not blink, I need to check my source code 😀 Thanks a lot so far!
<Jonas[m]1> Jonas[m]1: My program starts with ` defmt::info!("Hello, World!");` ....but I see no logs. Hmm.
<Jonas[m]1> Jonas[m]1: I have this line in my program, but it does not seem to help: `use defmt_rtt as _; // global logger`
<Jonas[m]1> Jonas[m]1: and two related deps `defmt = "0.3.5"
<Jonas[m]1> defmt-rtt = "0.4.0"`
<Jonas[m]1> <Jonas[m]1> "and two related deps `defmt = "0..." <- I now added `[env]
<Jonas[m]1> DEFMT_LOG = "debug"` to my `.cargo/config.toml` but it did not help.
vancz has quit []
vancz has joined #rust-embedded
<dirbaio[m]> <Jonas[m]1> "I now added `[env]..." <- > <@jlpettersson:matrix.org> I now added `[env]
<dirbaio[m]> Cargo has a bug where `[env]` doesn't trigger rebuild when it should
<dirbaio[m]> > DEFMT_LOG = "debug"` to my `.cargo/config.toml` but it did not help.
<dirbaio[m]> dirbaio[m]: do `rm -rf target` and try AGAIN
<dirbaio[m]> s/AGAIN/again/
<Jonas[m]1> <dirbaio[m]> "do `rm -rf target` and try AGAIN" <- Thanks! That fixed it!! I now get logging when running! I am just missing the blinking, but I need to double check my pins, will do that tomorrow! Thanks a lot!
<Jonas[m]1> <Jonas[m]1> "Thanks! That fixed it!! I now..." <- I changed the pin in my code to `p.P1_10` and now it is also blinking! So finally a successful blink-program :)
Guest7221 has left #rust-embedded [Error from remote client]
agg has quit [Ping timeout: 272 seconds]
agg has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]