[info] debugging - eclipse toolchain

It's all about the code!
Post Reply
User avatar
russian
Site Admin
Posts: 9770
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

debugging - eclipse toolchain

Post by russian » Mon Nov 18, 2013 2:16 pm

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 ... ocd-0-6-0/
(sorry this one is in Russian) http://makesystem.net/?p=2146
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
russian
Site Admin
Posts: 9770
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: debugging - eclipse toolchain

Post by russian » Mon Nov 18, 2013 2:17 pm

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
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

jedediah_frey
contributor
contributor
Posts: 51
Joined: Tue Nov 05, 2013 1:43 pm

Re: debugging - eclipse toolchain

Post by jedediah_frey » Mon Nov 18, 2013 3:57 pm

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 » Tue Dec 24, 2013 8:12 pm

if somebody use J-Link Debugger see that - http://gnuarmeclipse.livius.net/blog/jlink-debugging/

User avatar
russian
Site Admin
Posts: 9770
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: debugging - eclipse toolchain

Post by russian » Sat Jul 28, 2018 3:46 pm

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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
russian
Site Admin
Posts: 9770
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

Re: debugging - eclipse toolchain

Post by russian » Sun Mar 03, 2019 4:08 pm

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 329 times
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

Post Reply