ChibiOS OpenOCD support

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Freddie Chopin
Posts: 36
Joined: Wed Oct 17, 2012 8:57 am

Re: ChibiOS OpenOCD support

Post by Freddie Chopin »

mabl wrote:I'm not yet so much into qtcreator but from what I see it is significantly faster. It has a strong focus on C++ though. I recommend testing latest master if you have time for it.

If speed is the only advantage of Qt Creator than it's not worth bothering (; Eclipse is fast enough in here, additional features (like plugins for viewing peripheral registers) are more important than a 1ms faster response.

4\/3!!
gmb42
Posts: 31
Joined: Tue Oct 02, 2012 8:09 pm

Re: ChibiOS OpenOCD support

Post by gmb42 »

gdb is the pre-built toolchain from https://launchpad.net/gcc-arm-embedded, version 4.6-2012-q2-update

openocd is from git master, I have no idea how the output of --version relates to the git log output. The last entry in git log is:

commit 4a5dc0988ac91d1b5e63a28688edc2c6e890c179
Author: Spencer Oliver <[email protected]>
Date: Wed Oct 10 17:35:39 2012 +0100

And from git status:

# On branch master
nothing to commit (working directory clean)

The configure command I used was "$ ./configure --enable-maintainer-mode --enable-stlink".

I just ran git pull again (no updates) and make again. Now I get this from openocd --version:

Open On-Chip Debugger 0.7.0-dev-00053-g4a5dc09 (2012-10-27-12:57).

The problem occurs exactly the same as before.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

I really do not get your bug. I now have the *identical* setup as you do. And I do not see this bug! You are on x64, right? You just do a

Code: Select all

-> % ~/Programming/ARM/gcc-arm-none-eabi-4_6-2012q2/bin/arm-none-eabi-gdb max31855.elf
GNU gdb (GNU Tools for ARM Embedded Processors) 7.3.1.20120613-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/mabl/Downloads/max31855.elf...done.
(gdb) target remote :3333
Remote debugging using :3333
main () at main.c:153
153     main.c: No such file or directory.
        in main.c


with oocd

Code: Select all

/bin/oocd/bin/openocd    --search ~/bin/oocd/share/openocd/scripts -f board/stm32f4discovery.cfg -c "stm32f4x.cpu configure -rtos auto;"   
Open On-Chip Debugger 0.7.0-dev-00053-g4a5dc09 (2012-10-27-14:29)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
adapter speed: 1000 kHz
srst_only separate srst_nogate srst_open_drain
Info : clock speed 1000 kHz
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection from 3333
Info : stm32f4x errata detected - fixing incorrect MCU_IDCODE
Info : device id = 0x10006413
Info : flash size = 1024kbytes
Warn : acknowledgment received, but no packet pending
undefined debug reason 6 - target needs reset
Auto-detected RTOS: ChibiOS
Error: Memory signature identifier does not contain magic bytes.
Error: Reading the memory signature of ChibiOS/RT failed
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000300 msp: 0x20000400


Do you have any ideas what's different between our setup?
gmb42
Posts: 31
Joined: Tue Oct 02, 2012 8:09 pm

Re: ChibiOS OpenOCD support

Post by gmb42 »

I'm on x86, so that's different.

I'm using those exact same commands, give or take a few path differences.

Edit: I was using "tar ext :3333" in gdb, but using "tar rem :3333" still fails the same way.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Ok, I could successfully provoke the crash in a virtual 32bit machine :twisted: Now off for finding the bug (hopefully) :mrgreen: Thx gmb42 for being so patient with me.
gmb42
Posts: 31
Joined: Tue Oct 02, 2012 8:09 pm

Re: ChibiOS OpenOCD support

Post by gmb42 »

No problem, thanks for all your efforts.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Ok found the bug. It was in the Linux RTOS support code (really ugly code btw). The size of the memory allocation was calculated wrongly - but by chance it worked on 64bit systems.

The patch is currently in review here: http://openocd.zylin.com/#/c/934/
gmb42
Posts: 31
Joined: Tue Oct 02, 2012 8:09 pm

Re: ChibiOS OpenOCD support

Post by gmb42 »

Sorry for being a git noob, but how do I get the patch from your link, and then apply it to my src?
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

There are several possibilities, some are listed directly on the page in the middle. For now, you can just checkout the patch via

Code: Select all

git fetch http://openocd.zylin.com/openocd refs/changes/34/934/4 && git checkout FETCH_HEAD

inside your git directory.

EDIT: Updated the instructions for the latest patch, I forgot some stuff.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

The patch is now upstram. Only known problem is now that stepping and thread support are problematic -> I'm still debugging this one.
Post Reply