Olimex Support Forum

ARM => ST => Topic started by: HesseLABP on May 26, 2015, 01:42:01 pm

Title: [solved] Debugging in Ubuntu, Eclipse, STM32-P152, ARM-USB-TINY-H does not work
Post by: HesseLABP on May 26, 2015, 01:42:01 pm
Hello Olimex-Board!

I have a Problem with debugging my
• Olimex-Board (STM32-P152) with a
• Olimex-Debugger (ARM-USB-TINY-H) and
• Eclipse (Kepler) in
• Ubuntu (14.10).

I used the following post to configure everything: https://balau82.wordpress.com/2014/02/23/stm32-p152-development-with-eclipse-on-linux/

Unfortunately it's not really Working. It is possible to flash the code to the board but it can't be debugged. I use Balaus example-code as well.

In the following pictures you can have a look to my eclipse-settings.
https://www.dropbox.com/sh/tsj2h8ekptvl7bc/AABJvzwHn4e9VuenVoTr85CJa?dl=0 (https://www.dropbox.com/sh/tsj2h8ekptvl7bc/AABJvzwHn4e9VuenVoTr85CJa?dl=0)
(https://www.dropbox.com/s/rdoivdfltcrb756/eclipse1-build.png)
(https://www.dropbox.com/s/2sr4s9ljcu2y4y0/eclipse2-external_tools.png?dl=0)
(https://www.dropbox.com/s/rsim7dgj2twnjby/eclipse3-gdb_main.png)
(https://www.dropbox.com/s/xog8zj6tgnpwdf4/eclipse4-gdb_debugger.png?dl=0)
(https://www.dropbox.com/s/r1xhfci17umnctx/eclipse5-flashing_Board_console.png?dl=0)
(https://www.dropbox.com/s/lvp1dw53idhfj9v/eclipse6-debugging_error.png?dl=0)
(https://www.dropbox.com/s/3028hr7o7sjpc0a/eclipse7-debugging_console.png?dl=0)

Please Help, I searched nearly everywhere to solve the problem.

Hint: In Balaus post is just one thing i couldn't find. Its an option in the debugging settings (Chapter:Attach debugger). The line is "Tick option Connect to running target". I can't find that point in Eclipse-Kepler - does this matter?
Title: Re: Debugging in Ubuntu with Eclipse, STM32-P152 and ARM-USB-TINY-H does not work
Post by: JohnS on May 26, 2015, 03:55:01 pm
Maybe try OpenOCD on its own to figure out where the fault lies.

John
Title: Re: Debugging in Ubuntu with Eclipse, STM32-P152 and ARM-USB-TINY-H does not work
Post by: HesseLABP on May 26, 2015, 04:38:17 pm

user@machine:/usr/share/openocd/scripts$ openocd -f ../scripts/interface/ftdi/olimex-arm-usb-tiny-h.cfg -f ../scripts/target/stm32l.cfg
Open On-Chip Debugger 0.8.0 (2015-04-09-15:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 100 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
Info : clock speed 100 kHz
Info : JTAG tap: stm32l.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32l.bs tap/device found: 0x06416041 (mfg: 0x020, part: 0x6416, ver: 0x0)
Info : stm32l.cpu: hardware has 6 breakpoints, 4 watchpoints


Thats what I get in a Terminal by using OpenOCD. Looks fine for me...

@JohnS: What should I try else? I'm new to OpenOCD...
Title: Re: Debugging in Ubuntu with Eclipse, STM32-P152 and ARM-USB-TINY-H does not work
Post by: HesseLABP on May 26, 2015, 04:53:10 pm
If I try to flash in Terminal there is success. Just debugging is not possible.

Thats what I get by flashing in Terminal:

user@machine:/$ openocd -f usr/share/openocd/scripts/interface/ftdi/olimex-arm-usb-tiny-h.cfg -f usr/share
/openocd/scripts/target/stm32l.cfg -f home/hesse/Schreibtisch/flash_blink.cfg
Open On-Chip Debugger 0.8.0 (2015-04-09-15:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 100 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
Info : clock speed 100 kHz
Info : JTAG tap: stm32l.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32l.bs tap/device found: 0x06416041 (mfg: 0x020, part: 0x6416, ver: 0x0)
Info : stm32l.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : JTAG tap: stm32l.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : JTAG tap: stm32l.bs tap/device found: 0x06416041 (mfg: 0x020, part: 0x6416, ver: 0x0)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000158 msp: 0x20004000
STM32L: Enabling HSI
adapter speed: 2000 kHz
auto erase enabled
Info : STM32L flash size is 128kb, base address is 0x8000000
wrote 4096 bytes from file home/hesse/Schreibtisch/Test7-blink-152.bin in 0.226903s (17.629 KiB/s)
shutdown command invoked

Title: Re: Debugging in Ubuntu with Eclipse, STM32-P152 and ARM-USB-TINY-H does not work
Post by: JohnS on May 26, 2015, 09:00:34 pm
Maybe gdb with OpenOCD.

John
Title: Re: Debugging in Ubuntu with Eclipse, STM32-P152 and ARM-USB-TINY-H does not work
Post by: HesseLABP on May 28, 2015, 11:11:10 am
Hello John,

thank you for your reply. I tried to use openocd together with gdb in eclipse. Flashing the Chip works, but debugging is not possible.

May you can figure out the major problem by whatching my Screenshoots?
https://www.dropbox.com/sh/tsj2h8ekptvl7bc/AABJvzwHn4e9VuenVoTr85CJa?dl=0

Do you think it is just a configuration error or could it be something else?
Title: Re: Debugging in Ubuntu with Eclipse, STM32-P152 and ARM-USB-TINY-H does not work
Post by: JohnS on May 28, 2015, 01:51:32 pm
I don't use Eclipse.

John
Title: Re: Debugging in Ubuntu with Eclipse, STM32-P152 and ARM-USB-TINY-H does not work
Post by: HesseLABP on May 28, 2015, 06:32:43 pm
Thanks for your help.
Now I fixed the problem by using "Zylin Embedded debug" instead "GDB OpenOCD Debugging" or "GDB Hardware Debugging".

Everything I did is described on this page:
http://vedder.se/2012/12/debugging-the-stm32f4-using-openocd-gdb-and-eclipse/
Title: Re: [solved] Debugging in Ubuntu, Eclipse, STM32-P152, ARM-USB-TINY-H does not work
Post by: HesseLABP on March 24, 2016, 01:27:59 am
Behind the following link I describe my problem solution for STM32-P152 EvalBoard and Eclipse in detail. Just in case somebody gets the same Problems as I had.

http://aetzenloetenprogrammieren.blogspot.de/2016/03/eclipse-fur-stm32-unter-ubuntu.html (http://aetzenloetenprogrammieren.blogspot.de/2016/03/eclipse-fur-stm32-unter-ubuntu.html)

In the moment the solution is only available in german, but I hope to write also an english version in the future...

Greetings
HesseLABP