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
<re_irc> <imurx> Anyone knows any crates for ble peripheral stacks?
<re_irc> <imurx> Want to use one with esp-wifi
<re_irc> <imurx> bluster which is the only one I know of isn’t no-std. What I mainly need is ble advertising
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<re_irc> < (@9names:matrix.org)> thejpster: > Improvements I’d like to see
<re_irc> oof
<re_irc> > - Mainline releases of esp-idf-hal should not depend on beta versions of embedded-hal
<re_irc> < (@9names:matrix.org)> i guess we're safe since it's only depending on alpha versions? πŸ™ˆ
<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 manual.
<re_irc> The code I wrote works, but I would love to use the board crate. Am I missing sth?
<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)> Seems to have been noticed here: https://github.com/nrf-rs/microbit/issues/92
<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> # which helps debuggers (and IDEs that run them) provide a better debugging experience. Debug binaries
<re_irc> < (@yatekii:matrix.org)> Julia: this is the best you can do. optimizations are all done by the compiler, cargo-embed does not do anything.
<re_irc> < (@yatekii:matrix.org)> also, stripping does not help. debug symbols are not flashed :)
<re_irc> <Julia> Okay, then a followup question, how do I check what the required flash space will be quickly?
<re_irc> <Julia> For instance when I run cargo bloat on the unstripped binary I get this:
<re_irc> julia@julia-ubuntu:~/CLionProjects/nrf51822_blinky_rust$ cargo bloat --release
<re_irc> Finished release [optimized] target(s) in 0.02s
<re_irc> Analyzing target/thumbv6m-none-eabi/release/nrf51822_blinky_rust
<re_irc> < (@jamesmunns:beeper.com)> You can install arm-none-eabi-size or cargo binutils, and call size on the elf file in target/thumb.../release/
<re_irc> < (@jamesmunns:beeper.com)> https://github.com/rust-embedded/cargo-binutils#size
<re_irc> <Julia> Cheers! This is exactly what I was looking for ^-^!
<re_irc> julia@julia-ubuntu:~/CLionProjects/nrf51822_blinky_rust$ cargo size --release
<re_irc> Finished release [optimized] target(s) in 0.03s
<re_irc> text data bss dec hex filename
<re_irc> 1900 0 1088 2988 bac nrf51822_blinky_rust
emerent has quit [Ping timeout: 256 seconds]
emerent has joined #rust-embedded
<re_irc> < (@therealprof:matrix.org)> : πŸ˜„
<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]
emerent has joined #rust-embedded
cr1901 has joined #rust-embedded
<re_irc> < (@jamesmunns:beeper.com)> yeah, likely!
<re_irc> < (@jamesmunns:beeper.com)> : Is there a guide to doing it? or is just "cargo xtask release" or something?
<re_irc> < (@therealprof:matrix.org)> : I'm doing it so rarely, it's trial and error, too. But something like that IIRC.
<re_irc> < (@therealprof:matrix.org)> * error for me,
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<re_irc> <Julia> I am trying to get gdb working, however it seems to not like me passing line numbers. Not even src/main.rs:25 or main.rs:25.
<re_irc> <Julia> * "src/main.rs:25" or "main.rs:25".
<re_irc> < (@jamesmunns:beeper.com)> how are you invoking gdb?
<re_irc> <Julia> "gdb-multiarch target/thumbv6m-none-eabi/debug/nrf51822_blinky_rust"
<re_irc> <Julia> and then "target remote:1337"
<re_irc> < (@jamesmunns:beeper.com)> hmmm, that _should_ work? "b main" doesn't work either?
<re_irc> <Julia> break main works, continue after that works too, I can also monitor reset
<re_irc> <Julia> * "break main" works, "continue" after that works too, I can also "monitor reset"
<re_irc> < (@jamesmunns:beeper.com)> Yeah, I've done "b main.rs:25" or so, what version is "gdb-multiarch"?
<re_irc> <Julia> GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
<re_irc> < (@jamesmunns:beeper.com)> yeah, that's pretty recent
<re_irc> <Julia> Well I installed it yesterday haha
<re_irc> < (@jamesmunns:beeper.com)> :)
<re_irc> < (@jamesmunns:beeper.com)> sometimes OS repos have frightfully old versions of tools like that
<re_irc> < (@jamesmunns:beeper.com)> but yeah, 12.1 seems like the latest, or it's at least what I also have on Arch
<re_irc> < (@jamesmunns:beeper.com)> did you do a "load"?
<re_irc> <Julia> Maybe something is wrong in my Embed.toml? I use gdb as the profile:
<re_irc> [default.probe]
<re_irc> protocol = "Swd"
<re_irc> [default.flashing]
<re_irc> <Julia> : No, what does that do?
<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> load
<re_irc> mon reset halt
<re_irc> <Julia> I assume not
<re_irc> < (@jamesmunns:beeper.com)> as my typical startup step
<re_irc> < (@jamesmunns:beeper.com)> no, but the target could have a different program than the elf you are invoking gdb with
<re_irc> <Julia> (gdb) load
<re_irc> Load failed
<re_irc> Loading section .vector_table, size 0xa8 lma 0x0
<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> julia@julia-ubuntu:~/CLionProjects/nrf51822_blinky_rust$ gdb-multiarch target/thumbv6m-none-eabi/debug/nrf51822_blinky_rust
<re_irc> GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
<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.