STM32F3Discovery: Architecture rejected target-supplied description

I'm reading and the "The discovery book". I'm using the STM32F3DISCOVERY board and things go fine until the (gdb) target remote:3333 command. See below.

wouter@wouter-P5KC:~/rust/discovery-master/src/05-led-roulette$ gdb -q target/thumbv7em-none-eabihf/debug/led-roulette
Reading symbols from target/thumbv7em-none-eabihf/debug/led-roulette...done.
(gdb) target remote :3333
Remote debugging using :3333
warning: Architecture rejected target-supplied description
Truncated register 16 in remote 'g' packet
(gdb) load
You can't do that when your target is `exec'
(gdb) quit
wouter@wouter-P5KC:~/rust/discovery-master/src/05-led-roulette$ cargo build --target thumbv7em-none-eabihf
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
wouter@wouter-P5KC:~/rust/discovery-master/src/05-led-roulette$ readelf -h target/thumbv7em-none-eabihf/debug/led-roulette
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x8000197
  Start of program headers:          52 (bytes into file)
  Start of section headers:          560472 (bytes into file)
  Flags:                             0x5000400, Version5 EABI, hard-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         2
  Size of section headers:           40 (bytes)
  Number of section headers:         20
  Section header string table index: 18
wouter@wouter-P5KC:~/rust/discovery-master/src/05-led-roulette$ 

what could be wrong?

1 Like

How have you started openocd? What is the debug-output on openocd?
Which gdb are you using? Is it one of the following:

  • gdb-multiarch
  • arm-none-eabi-gdb
  • gdb-arm-none-eabi

If it is none of them, download the corresponding and it should work. It depends on your Operating System which one you need.
For more informations take a look here:
https://rust-embedded.github.io/book/intro/install/linux.html

wouter@wouter-P5KC:/tmp$ openocd -f interface/stlink-v2-1.cfg -f target/stm32f3x.cfg
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.

adapter speed: 1000 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 2.896748
Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x10036422
Info : flash size = 256kbytes
undefined debug reason 7 - target needs reset
Info : dropped 'gdb' connection

And the debugger is:

wouter@wouter-P5KC:~/rust/discovery-master/src/05-led-roulette$ gdb-multiarch
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) quit
wouter@wouter-P5KC:~/rust/discovery-master/src/05-led-roulette$ gdb
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) quit

1 Like

For me it seems like you have installed two different gdb: One for debugging software for your computer, and one for the arm target. Try exchanging
gdb -q target/thumbv7em-none-eabihf/debug/led-roulette
with
gdb-multiarch -q target/thumbv7em-none-eabihf/debug/led-roulette

2 Likes

@trembel You are right gdb-multiarch as command did work. Thanks for all your help :grinning: I'm happy!

kind regards,
Dick barends

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.