discovery icon indicating copy to clipboard operation
discovery copied to clipboard

05-led-roulette | cargo embed crashes on (gdb) target remote :1337 with During the execution of GDB an error was encountered: failed to fill whole buffer

Open bcpeinhardt opened this issue 2 years ago • 6 comments

05-led-roulette | cargo embed crashes on (gdb) target remote :1337 with During the execution of GDB an error was encountered: failed to fill whole buffer. Coming at this with zero domain knowledge (never even used GDB) so could use some help. Running Ubuntu 22 and following along with Microbit v2.

bcpeinhardt avatar Feb 13 '23 21:02 bcpeinhardt

Oh and on gdb's side of thing:

(gdb) target remote :1337
Remote debugging using :1337
warning: while parsing target description (at line 4): Target description specified unknown architecture "armv7"
warning: Could not load XML target description; ignoring
Truncated register 16 in remote 'g' packet

bcpeinhardt avatar Feb 13 '23 22:02 bcpeinhardt

Oh and on gdb's side of thing:

(gdb) target remote :1337
Remote debugging using :1337
warning: while parsing target description (at line 4): Target description specified unknown architecture "armv7"
warning: Could not load XML target description; ignoring
Truncated register 16 in remote 'g' packet

Yes! This has to do with the compiler and gdb. gdb on your system works for probably x86 architecture but you are trying to run it on a program compiled and running on ARM. If you followed all the installing instructions in this tutorial so far, you should have a specific version of gdb installed. In your terminal do ls /bin | grep "gdb". This should return you all gdb related binaries. For me on arch it is arm-none-eabi-gdb and on ubuntu it should be something like gdb-arm-none-eabi. If there is nothing of the sort, you should install it via apt-get. Then run gdb-arm-none-eabi target/thumbv7em-none-eabihf/debug/led-roulette, assuming that this is the correct binary for ubuntu. Hope that helps.

SHA256man avatar Feb 18 '23 14:02 SHA256man

I am using Kubuntu as my Linux distro with a micro:bit 2.21 I am now in discovery/microbit/src/05-led-roulette/ This is how i solved it:

  1. Run sudo apt install gdb-arm-none-eabi
  2. Run cargo embed --features v2 --target thumbv7em-none-eabihf and do not terminate the process. Also I noticed that cargo-embed is using too much CPU (nearly 25%) and i don't know why
  3. Go back 2 directories to microbit/ and run gdb-multiarch target/thumbv7em-none-eabihf/debug/led-roulette
  4. Inside gdb, run target remote :1337

ghost avatar Mar 17 '23 19:03 ghost

I had the same problem on Arch (Manjaro). I roughly followed the steps above, the arch package is: https://archlinux.org/packages/community/x86_64/arm-none-eabi-gdb/

sudo pacman -S arm-none-eabi-gdb
arm-none-eabi-gdb target/thumbv7em-none-eabihf/debug/led-roulette

umatbro avatar May 19 '23 19:05 umatbro

yeah, the key is to run gdb-multiarch instead of just gdb

smidkristian avatar Dec 28 '23 17:12 smidkristian

I can additionaly add If someone working on Windows then the key is to run arm-none-eabi-gdb instead of gdb, which you should have installed as dependency and add to Path in 3.2 Chapter of the Discovery book

zhenyakornilov avatar Jul 25 '24 17:07 zhenyakornilov