Page 8 of 18
Re: ChibiOS OpenOCD support
Posted: Mon Oct 08, 2012 10:28 pm
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.
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 7:56 am
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?
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 8:09 am
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.
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 8:17 am
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.
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 9:33 am
by mobyfab
Using FPU and ST link.
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 9:53 am
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.

feanor: Do you use FPU? If so, could you try without it?
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 10:11 am
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.
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 10:21 am
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
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 11:06 am
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.
Re: ChibiOS OpenOCD support
Posted: Tue Oct 09, 2012 11:13 am
by Giovanni
Yes, I'll fix it, thanks for noticing.
Giovanni