[info] debugging - eclipse toolchain

It's all about the code!
Post Reply
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

debugging - eclipse toolchain

Post by AndreyB »

Setting up debugging with Eclipse toolchain is a nightmare.
We would need
1) Eclipse
2) GDB - TODO an explanation what is the role of GDB
3) OpenOCD - "on chip debugger", the lowest-layer of debugging interface.

Useful links:
http://hertaville.com/2012/09/16/part-3-debugging-openocd-0-6-0/
(sorry this one is in Russian) http://makesystem.net/?p=2146
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: debugging - eclipse toolchain

Post by AndreyB »

Step 1: installation

Download OpenOCD and start stm32f4 configuration like

Code: Select all

openocd -f interface/stlink-v2.cfg -f target/stm32f4x_stlink.cfg -c init -c reset
run_openocd.bat

OpenOCD windows binaries are available here

Configure 'Debug' as on these pictures:

Image
Image
Image
http://i.imgur.com/plS8JMt.png
http://i.imgur.com/K0j34v4.png


http://i.imgur.com/hY5rdKn.png
http://i.imgur.com/pgc00mg.png
http://i.imgur.com/zo6K9DG.png
http://i.imgur.com/Irv4xFZ.png
http://i.imgur.com/kRgapgT.png
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
jedediah_frey
contributor
contributor
Posts: 51
Joined: Tue Nov 05, 2013 1:43 pm

Re: debugging - eclipse toolchain

Post by jedediah_frey »

Checkout ChibiStudio. It's a very nice packaged Eclipse setup for ChibiOS, GDB, OpenOCD and GCC.
User avatar
acab
provoker
provoker
Posts: 263
Joined: Wed Dec 18, 2013 7:27 pm
Location: Minsk, BY

Re: debugging - eclipse toolchain

Post by acab »

if somebody use J-Link Debugger see that - http://gnuarmeclipse.livius.net/blog/jlink-debugging/
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: debugging - eclipse toolchain

Post by AndreyB »

Just a note for myself: debugging works fine with 5.4_2016q3 version of everything and open OCD 0.9.0 as long as I point at the correct version of arm-none-eabi-gdb.exe

Using arm-none-eabi-gdb.exe from the wrong version does not help things :)

Also just tested and 7 2018-q2-update works as well.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: debugging - eclipse toolchain

Post by AndreyB »

One little annoying issue with some F7 chips - they have silicon errors causing default software breakpoints to not work. OpenOCD is kind enough to show relevant error message "Warn : Silicon bug: single stepping will enter pending exception handler!"

In order to use openocd and debug F7 you need to change break point breakpoint type from default to "hardware"

See also http://www.chibios.com/forum/viewtopic.php?f=16&t=4912
Attachments
hardware.png
hardware.png (28.65 KiB) Viewed 5066 times
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Post Reply