Page 18 of 18
Re: ChibiOS OpenOCD support
Posted: Tue Nov 13, 2012 4:23 pm
by mabl
Hi Prof.
did you try out the Windows build? Or are using Linux?
Prof. Dr. YoMan wrote:Will this be backported to 2.4.3 (which is due to release?)?
It's up to Giovanni, the impact will limited - i see no issue with back-porting.
Prof. Dr. YoMan wrote:And what about M4-F enabled? Where is the problem with the FPU?
With FPU enabled, the FPU registers will alsp be saved on the stack on context switch. OpenOCD will have to know about the changed stack as well. I've already added FPU detection to ChibiOS - so there is no problem here. But the floating point register stuff is not yet final in OpenOCD itself - so i just decided to skip it for now.
What i *could do* is to at faux stacking information for the FPU registers - basically the content of your floating point variables might be messed up in that case - but at least you would get backtraces...
Re: ChibiOS OpenOCD support
Posted: Tue Nov 13, 2012 4:37 pm
by Giovanni
I can release 2.4.3 in any moment, the branch has been just collecting bug fixes for a while now (and I can backport the feature).
Giovanni
Re: ChibiOS OpenOCD support
Posted: Tue Nov 13, 2012 6:18 pm
by Prof. Dr. YoMan
Mabl, I am on windows. But I never tried anything but 2.4.2.
If the openocd-thread support would be in 2.4.3 I will use an test it for sure.
Right now I am in "playing" time with ChibiOS. Lots of other stuff to do with other projects.
BUT, it would be much easier to get ChibiOS as "default" for most if not all of our pending CortexM3/M4 projects if I could point out the ease of debugging the threaded environment.
Right now we are using some FreeRTOS but most of our software is IRQ-driven with "one" statemaschine. It "sucks"

I did not find any showstoppers with 2.4.2 with what I have tested and tried right now, but I have seen the bug- and changeslist pretty long.
Re: ChibiOS OpenOCD support
Posted: Tue Nov 13, 2012 6:46 pm
by Giovanni
Duh, most of them are marginal fixes in the HAL, there is nothing compromising stability except for the stated defect. The kernel hasn't seen a serious bug in years.
If there was anything serious 2.4.3 would have already been released.
Giovanni
Re: ChibiOS OpenOCD support
Posted: Tue Nov 13, 2012 7:50 pm
by Prof. Dr. YoMan
No offence.

I stand corrected: The changes ans feature list is long.

Re: ChibiOS OpenOCD support
Posted: Tue Nov 13, 2012 8:08 pm
by mabl
Prof. Dr. YoMan wrote:BUT, it would be much easier to get ChibiOS as "default" for most if not all of our pending CortexM3/M4 projects if I could point out the ease of debugging the threaded environment.
To be fair, tough: openocd supports thread view for ChibiOS, FreeRTOS, ThreadX, eCos and Linux - no guarantee that these work though

The code looks unreliable

Re: ChibiOS OpenOCD support
Posted: Thu Dec 24, 2015 4:26 pm
by szkkteam
Hello. I'm relativly new with Chibios. I've downloaded the Chibios 3.0. from the site, and I'm developing my custom application. My code works fine, but when I try to debug it, the openocd cannot detect ChibiOS, and when I set a breakpoint into a task, the software running does not stop, when hit the breakpoint.
I'm running Ubuntu with Eclipse Mars ide.
I configured the openocd, and the Eclipse by this tutorial:
http://vedder.se/2012/12/debugging-the- ... d-eclipse/My openocd config file is the following
Code: Select all
source [find interface/stlink-v2.cfg]
source [find target/stm32f4x.cfg]
$_TARGETNAME configure -rtos ChibiOS
reset_config srst_only srst_nogate
The openocd works fine with a non chibios based software, but when i connect to the openocd it show the following:
Code: Select all
GNU ARM Eclipse 32-bits Open On-Chip Debugger 0.10.0-dev-00141-g09aeb96-dirty (2015-10-28-12:05)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v14 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.897285
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x10076413
Info : flash size = 1024kbytes
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080001f0 msp: 0x20000400
Warn : RTOS ChibiOS not detected. (GDB could not find symbol 'ch_debug')
Warn : RTOS ChibiOS not detected. (GDB could not find symbol 'ch_debug')
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080001f0 msp: 0x20000400
Error: Memory signature identifier does not contain magic bytes.
Error: Reading the memory signature of ChibiOS/RT failed
I've tried to set the config file to -rtos auto but doesnt helped. I also triple checked my .elf file contains the ch_debug symbol!!!
But my main problem is, why does not stop the software running, when i set a breakpoint inside a thread? Until i put it into the main sequnce (initialisaion) it works, but noting in the thread.
I put here my main.c code, the main loop does nothing, just sleep.
Code: Select all
/*
* Application entry point.
*/
int main(void) {
/******************************************************************************/
/* @Description : Initialization of Chibios subsystems. */
/******************************************************************************/
vidInitSubSys();
chThdSleepMilliseconds(1000);
/******************************************************************************/
/* @Description : Initialization of user applications. */
/******************************************************************************/
vidInitApplications();
/*
* Normal main() thread activity, in this demo it does nothing except
* sleeping in a loop and check the button state.
*/
while (true) {
chThdSleepMilliseconds(500);
}
}
Any idea??
Re: ChibiOS OpenOCD support
Posted: Thu Dec 24, 2015 4:33 pm
by Giovanni
Hi
Try to compile using -O0 instead of -O2 (default).
Giovanni
Re: ChibiOS OpenOCD support
Posted: Thu Dec 24, 2015 5:03 pm
by szkkteam
Thank you Giovanni now it's working.
Merry Xmas
Re: ChibiOS OpenOCD support
Posted: Sun Jan 03, 2016 11:10 pm
by nikhil
Hi
I believe FPU support has been added to openocd for chibios/rt. (
https://github.com/ntfreak/openocd/comm ... 9e0762a2c1)
When I tried to use chibios plugin within eclipse (with use_fpu=hard, -O0, all debug option enabled in chconf), I can see the thread list in eclipse debug window when pause the program. However when I try to refresh plugin, I get error that says 'Failed to read memory at 0x55555556' with following message in oocd console.
Code: Select all
Info : Successfully loaded memory map of ChibiOS/RT target running version 2.6.5
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x55555556
Error: Failed to read memory at 0x55555556
Error: JTAG-DP STICKY ERROR
Error: MEM_AP_CSW 0x23000050, MEM_AP_TAR 0x55555556
Error: Failed to read memory at 0x55555556
Please let me know if there is any way to get it work with plugin. Is there any other method to check stack usage of individual threads with FPU on?
--
nikhil