Debugger Problems on Native Install

Firmware/software/electronics/mechanics
Post Reply
dionigi
Beginner
Posts: 6
Joined: Fri Jun 22, 2018 8:10 pm

Debugger Problems on Native Install

Post by dionigi »

Hello,

I'm currently trying to get the debugger working on my native install of the Crazyflie software/firmware. I'm running Ubuntu 16.04 and am able to compile all the firmware normally (meaning not for debugging purposes). I curren't am using the breakout board plus a white ST-Link/v2/ 01-0 with Photon Eclipse using the following guide (https://gnu-mcu-eclipse.github.io/debug/openocd/) to try and get the OpenOCD debugger working since that's what I saw the VM used in it's Eclipse. I also installed OpenOCD using `sudo apt-get install openocd`.

This is the error that I get on `Flash using debugger':

Code: Select all

15:16:02 **** Build of configuration Default for project crazyflie-firmware-cyphy ****
make flash 
openocd -d2 -f interface/stlink-v2.cfg  -f target/stm32f4x_stlink.cfg -c init -c targets -c "reset halt" \
                 -c "flash write_image erase cf2.bin 0x8004000 bin" \
                 -c "verify_image cf2.bin 0x8004000 bin" -c "reset run" -c shutdown
Open On-Chip Debugger 0.9.0 (2018-01-24-01:05)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
WARNING: target/stm32f4x_stlink.cfg is deprecated, please switch to target/stm32f4x.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
in procedure 'init' 
Makefile:370: recipe for target 'flash' failed
in procedure 'ocd_bouncer'

make: *** flash Error 1

15:16:03 Build Failed. 2 errors, 0 warnings. (took 821ms)
And this is the error that I get on trying to debug:

Code: Select all

GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00487-gaf359c18 (2018-05-12-19:25)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Started by GNU ARM Eclipse
Error: couldn't bind tcl to socket on port 6666: Address already in use
Any ideas what could be the cause?

Dionigi-
dionigi
Beginner
Posts: 6
Joined: Fri Jun 22, 2018 8:10 pm

Re: Debugger Problems on Native Install

Post by dionigi »

I ended up figuring it out with some more google-fu.

Referencing viewtopic.php?t=2191, I used `make DEBUG=1 CLOAD=1' and also modified the Makefile to use `OPENOCD_TARGET ?= target/stm32f4x.cfg' instead of `OPENOCD_TARGET ?= target/stm32f4x_stlink.cfg'. Lastly I double-checked my Debug Configuration on Eclipse as it seemed to be using /usr/bin/gdb instead of /usr/bin/arm-none-eabi-gdb.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Debugger Problems on Native Install

Post by kimberly »

Nice job:) Were you also able to debug the crazyflie2 firmware with the RTOSfree threads with breakpoints and such? I'm having problems with that myself.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Debugger Problems on Native Install

Post by kimberly »

I was able to fix my above mentioned problem by adding the following to the config options of the OpenOCD setup :

-c "stm32f4x.cpu configure -rtos auto"
Post Reply