<re_irc>
<vortoman> Trying out the microbit. I wanna use a pin as analog input. The board crate doesn't seem to give access to the analog stuff.
<re_irc>
So I have to ignore the board crate for the entire project, because I have to take ownership of the peripherals manually.
<re_irc>
The code I wrote works, but I would love to use the board crate. Am I missing sth?
<re_irc>
< (@jamesmunns:beeper.com)> Not too familiar with the microbit, it looks like an oversight that the ADC peripheral wasn't included in the unused stuff.
<re_irc>
< (@jamesmunns:beeper.com)> Lemme see if I can get that merged.
<re_irc>
< (@jamesmunns:beeper.com)> hey , any chance you're around?
<re_irc>
< (@jamesmunns:beeper.com)> vortoman, I just got https://github.com/nrf-rs/microbit/pull/101 merged, which includes analog support. For now, you can use the "main" branch of the microbit repo instead, hopefully it should get released soon-ish?
<re_irc>
< (@jamesmunns:beeper.com)> I uh, already made a bit of a mess in getting this merged, so I won't attempt to do a release and mess things up :D
IlPalazzo-ojiisa has joined #rust-embedded
<re_irc>
<vortoman> Thank you very much!
<re_irc>
A quick test worked on my microbit :)
cr1901 has quit [Ping timeout: 252 seconds]
<re_irc>
< (@omar_u8:matrix.org)> Getting the following when doing a build after running bindgen on a bunch of embedded C libs:
<re_irc>
"warning: couldn't execute `llvm-config --prefix` (error: No such file or directory (os error 2)) warning: set the LLVM_CONFIG_PATH environment variable to the full path to a valid `llvm-config` executable (including the executable itself)"
<re_irc>
I figure there is something I need to do in my build script but not really clear as to what I need to do.
<re_irc>
<Julia> Does Cargo-embed perform some binary size optimizations? Like stripping symbols for instance? Right now my .toml file looks like this and I'm wondering if I can reduce the binary size even further:
<re_irc>
# By default, Cargo build builds the Rust binary in debug mode. Debug mode disables many optimizations,
<re_irc>
# can be 30% or more larger than release binaries. To minimize binary size, build in release mode.
<re_irc>
< (@therealprof:matrix.org)> Feel free to do a release. I was hoping to get to it the last few days but couldn't find the time. Can't do it now because IIRC I can't use the xtask due to an example failing to compile on my Mac and I don't have a Linux machine nearby.
<re_irc>
<vortoman> : followup question: I have to import the "embedded_hal::adc::OneShot" Trait to use the read function of the Adc struct. Is that intended?
emerent has quit [Read error: Connection reset by peer]
<re_irc>
< (@jamesmunns:beeper.com)> load flashes the elf to the target. It might not be necessary with cargo embed - I've only ever used gdb with something like openocd or jlinkgdbserver
<re_irc>
<Julia> Is flashing required though for starting gdb?
<re_irc>
target remote :1337
<re_irc>
< (@jamesmunns:beeper.com)> like I usually do something like:
<re_irc>
< (@jamesmunns:beeper.com)> Hmm, not sure I can help then. might be good to ping in the #probe-rs:matrix.org (https://matrix.to/#/#probe-rs:matrix.org) room since you're using that gdbserver
<re_irc>
< (@adamgreig:matrix.org)> what error do you get from gdb when you try "b main.rs:25" sort of thing?
<re_irc>
<Julia> I use "cargo embed gdb" and then in another terminal I did this:
<re_irc>
Copyright (C) 2022 Free Software Foundation, Inc.
<re_irc>
< (@yatekii:matrix.org)> Julia: load is not implemented
<re_irc>
< (@yatekii:matrix.org)> you have to flash beforehand
<re_irc>
<Julia> Yeah I have flashed it. I just reflashed but the same issue persists.
<re_irc>
< (@adamgreig:matrix.org)> yea, that all seems right...
<re_irc>
< (@jamesmunns:beeper.com)> Any chance you're debugging release mode?
<re_irc>
< (@adamgreig:matrix.org)> "cargo embed gbd" (no "--release") plus "gdb-multiarch target/thumb../debug/nrf.." seems to line up with debug mode build and gdb
<re_irc>
< (@jamesmunns:beeper.com)> Ah, good catch
<re_irc>
< (@adamgreig:matrix.org)> weird that it's saying "no line 25 in file", not "no source file named main.rs", though
<re_irc>
<Julia> I did a cargo clean as a sanity check, didn't help.