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.
feanor
Posts: 15
Joined: Sat Sep 29, 2012 9:31 am

Re: ChibiOS OpenOCD support

Post by feanor »

Hi mabl,
I'm seeing this error also with the official release of openocd.exe. This error seems to be related with stack trace inside an exception handler (Link) What are the gdb-startup commands you use?

EDIT:
Removing "jump ResetHandler" in "Run Commands" helped a bit. Now I can see the threads showed in gdb and eclipse, but the have no content, see screenshot.
Attachments
Screenshot.PNG
Screenshot.PNG (26.36 KiB) Viewed 6632 times
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Hi feanor,

this is a strange error. I very much like to have it understood and fixed. I think you need "jump ResetHandler" otherwise your program might be in an undefined state - and the remaining memory is enough to detect threads.

feanor wrote:Hi mabl,
thanks for the hint. Now openocd tells me

Code: Select all

Auto-detected RTOS: ChibiOS

Info : Successfully loaded memory map of ChibiOS/RT target running version 2.5.1
Error: address + size wrapped(0xffffffff, 0x00000004)
Error: ChibiOS registry integrity check failed, double linked list violation
Info : Only showing current execution because of a broken ChibiOS thread registry.

Where did you set your break point? Ofcourse it has to be after chSysInit, since only then the system is correctly initialized. You will get the exact same error message (minos the first error) if you break on main(). Are you using ChibiOS with enabled Hardware floating point?
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: ChibiOS OpenOCD support

Post by mobyfab »

I get the exact same results.

Basically when openOCD does not detect Chibi it works fine but I see only one thread.
Else it is the same as feanor.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Mobyfab: You are also using oocd on windows with stlink, right? Are you using the FPU?

I'm still trying to figure out how to best tackle this error. Given that the stack pointer seems to point to zero and stupid stuff - I guess it is no eclipse setup error.
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: ChibiOS OpenOCD support

Post by mobyfab »

Using FPU and ST link.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Ok, FPU is currently not supported. I have to check CPU registers in OOCD and it is not so simple because the infrastructure is not yet in oocd. Quicker workaround would be a flag in the chibios memory signature. :mrgreen:

feanor: Do you use FPU? If so, could you try without it?
feanor
Posts: 15
Joined: Sat Sep 29, 2012 9:31 am

Re: ChibiOS OpenOCD support

Post by feanor »

I do not intentially use FPU. The only switch i see is DDEFS += -DCORTEX_USE_FPU=TRUE in Makefile. This evening i will try a build with DDEFS += -DCORTEX_USE_FPU=FALSE.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS OpenOCD support

Post by Giovanni »

The FPU is enabled or disabled using an option in the Makefile header, there is no need to add the "-D........" manually.

Giovanni
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Giovanni is right, just make sure that your project makefile contains

Code: Select all

# Enables the use of FPU on Cortex-M4.
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FPU),)
  USE_FPU = no
endif


@Giovanni: I think the comment is not correct and it's a c&p error from the definition below.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS OpenOCD support

Post by Giovanni »

Yes, I'll fix it, thanks for noticing.

Giovanni
Post Reply