rust-embedded / cortex-m-semihosting

Semihosting for ARM Cortex-M processors
Apache License 2.0
40 stars 19 forks source link

nucleof334 debugging problem #24

Closed soson closed 5 years ago

soson commented 6 years ago

i am following rust tutorial https://rust-embedded.github.io/bookshelf/book/start/hardware.html to start with embedded programming.

my hardware is NUCLEOF334R8 with STM32F334R8T6 i am running into problem with debugging against openocd when running simple "Hello world".

gdb> target remote :3333

results into this error:

cortex_m_semihosting::hio::HStderr::write_all ( self=0x80002eb, buffer=...) at /home/soni/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.1/src/hio.rs:48 48 open(":tt\0", nr::open::W_APPEND).map(|fd| HStderr { fd }

your help would be appreciated

thanks

therealprof commented 6 years ago

@soson This is not really an error. Have you enabled semihosting via monitor arm semihosting enable?

soson commented 6 years ago

thanks for your help. running

gdb> monitor arm semihosting enable

"monitor" command not supported by this target

this is strange, because i have installed ubuntu 16.04 gdb package suggested by tutorial.

anyway thanks, i will investigate further

therealprof commented 6 years ago

Err, you're using an ARM gdb, right? The regular ubuntu gdb will not do.

therealprof commented 6 years ago

Typically you'd start that with arm-none-eabi-gdb, not just gdb.

soson commented 6 years ago

yes, i am using arm-none-eabi-gdb

japaric commented 5 years ago

"monitor" command not supported by this target

As indicated in the book you have to run monitor arm semihosting enable after target remote :3333.

korken89 commented 5 years ago

This is almost 1 year old, closing issue, reopen if needed

ryankurte commented 5 years ago

idk how related but i get the same message from gdb-multiarch with the example project (which is installed in as gdb-arm-none-eabi in buster) :-/

> gdb-multiarch -q target/thumbv7em-none-eabi/debug/test-app 
Reading symbols from target/thumbv7em-none-eabi/debug/test-app ...done.
(gdb) target extended-remote :3333
Remote debugging using :3333
0x08006280 in ?? ()
(gdb) break main
Breakpoint 1 at 0x4d4: file src/main.rs, line 19.
(gdb) 
Note: breakpoint 1 also set at pc 0x4d4.
Breakpoint 2 at 0x4d4: file src/main.rs, line 19.
(gdb) monitor arm semihosting enable
Target does not support this command.

edit: same with arm-none-eabi-gdb

second edit: need to invoke openocd not st-util, fixed now