Hello,
I am using chibistudio preview 8 with stm32f4 discovery board. I am trying to follow this guide for multithread support while debugging. I am trying with ARMCM4-STM32F407-DISCOVERY-MEMS demo. However I am not able to see threads in debug list nor chibios is being detected by openocd in openocd console I have enabled rtos support for openocd by passing -c "stm32f4x.cpu configure -rtos auto" which starting openocd.
I have checked chconf and found CH_USE_REGISTRY is set TRUE and all debug options are enabled.
Is there any way to make it working?
-nikhil
Multithread debugging with chibistudio and openocd
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Multithread debugging with chibistudio and openocd
Probably you need to go past chSysInit() or the threads list is not yet built in memory.
Giovanni
Giovanni
Re: Multithread debugging with chibistudio and openocd
It would great if you could direct me to verify if this is going beyond chSysInit() or to check if thread list s built in memory.
--
nikhil
--
nikhil
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Multithread debugging with chibistudio and openocd
You need to start the application and then stop it or to put a breakpoint after chSysInit() in your main function.
Giovanni
Giovanni
Re: Multithread debugging with chibistudio and openocd
Just a note that ChibiOS version 3 looks like it's not supported in the current release version of OpenOCD (0.8.0).
But happily it has been committed to the Git development branch:
So if you compile OpenOCD from Git yourself you can get it working with ChibiOS 3. Or you can wait for release 0.9.0.
But happily it has been committed to the Git development branch:
Code: Select all
commit 8b99681346c71b7fa6358bf79becaaecb6151f4a
Author: Christian Gudrian <christian.gudrian@gmx.de>
Date: Tue Oct 21 22:23:40 2014 +0200
rtos: add support for ChibiOS/RT 3.0
In ChibiOS/RT 3.0 the ready list pointer "rlist" is now part of the system
data structure. Since the ready list is the first element in that
structure it can be accessed via the structure's symbol "ch".
So if you compile OpenOCD from Git yourself you can get it working with ChibiOS 3. Or you can wait for release 0.9.0.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Multithread debugging with chibistudio and openocd
Have just got the basics of this working with ChibiOS3/ChibiStudio 10; a few things have changed, so some notes for anyone else:
1. Download the latest version of OpenOCD from http://www.freddiechopin.info/en/downlo ... penocd-dev
Expand it into the tools\openocd directory
2. Identify the openOCD file for your processor in tools\openocd\scripts\target (e.g. stm32f4x.cfg). Open in a text editor.
Find the configuration line (about line 68 for the 32f4) and add the -rtos option:
3. Edit the relevant debug configuration - in the startup tab, insert a line at the top of the initialisation commands:
(If step 3 isn't done, OpenOCD will report: Error: No symbols for ChibiOS)
1. Download the latest version of OpenOCD from http://www.freddiechopin.info/en/downlo ... penocd-dev
Expand it into the tools\openocd directory
2. Identify the openOCD file for your processor in tools\openocd\scripts\target (e.g. stm32f4x.cfg). Open in a text editor.
Find the configuration line (about line 68 for the 32f4) and add the -rtos option:
Code: Select all
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 -rtos ChibiOS
3. Edit the relevant debug configuration - in the startup tab, insert a line at the top of the initialisation commands:
Code: Select all
file C:/ChibiStudio/workspace30/Project_Directory/build/ch.elf
(If step 3 isn't done, OpenOCD will report: Error: No symbols for ChibiOS)
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Multithread debugging with chibistudio and openocd
Hi,
Thanks for the info, I will add the new OpenOCD to the next release.
Is there a way to specify that "-rtos ChibiOS" on the command line? that would allow me to do that from the Eclipse launcher instead of having to manually change OOCD files (if not possible, it would be worth suggesting this to the OOCD team).
Giovanni
Thanks for the info, I will add the new OpenOCD to the next release.
Is there a way to specify that "-rtos ChibiOS" on the command line? that would allow me to do that from the Eclipse launcher instead of having to manually change OOCD files (if not possible, it would be worth suggesting this to the OOCD team).
Giovanni
Who is online
Users browsing this forum: No registered users and 2 guests