Deugging ChibiOS application

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

ptihanyi
Posts: 2
Joined: Sun Mar 19, 2023 10:23 am

Deugging ChibiOS application

Postby ptihanyi » Sun Mar 19, 2023 10:46 am

Hi all!
I have been developing for STM32F4, -L4 and -F7 microcontrollers for a few years, mainly based on FreeRTOS. Currently I am getting familiar with ChibiOS.
I use STM32CubeIDE for development, I also use it for ChibiOS (although ChibiStudio is great!).
I have some questions about debugging:
- I use Segger Ozone primarily. Has anyone managed to get the ChibiOS plugin to work? This would be the most important for me...
- When debugging in ChibiStudio, why is there only one thread in the "Debug" window?
- Is it possible in ChibiStudio to switch between threads when debugging (after pause)? With FreeRTOS, I can look at the call stack of each thread and step through it.

For debug probe I have Segger J-Link EDU, ST-LINK/V2 and ST-LINK/V3.
As I am not yet very confident with ChibiOS/RT, it would be really important for me to do the in-depth debugging that I am used to with FreeRTOS.

Thank you in advance for your answers and advice!

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Deugging ChibiOS application

Postby Giovanni » Sun Mar 19, 2023 12:41 pm

Hi,

ChibiStudio includes a debug plugin specific for ChibiOS, it allows to inspect threads, timers, statistics, traces and other things. The plugin can be installed in other Eclipse-based environments too.

OpenOCD also implements ChibiOS support but it is stuck to RT6 support, RT7 has still to be implemented.

Try the various guides on playembedded.org, there is a lot of informative material there.

Giovanni

User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Location: Munich (Germany)
Has thanked: 83 times
Been thanked: 67 times
Contact:

Re: Deugging ChibiOS application

Postby RoccoMarco » Sun Mar 19, 2023 1:26 pm

Hi Ptihanyi,
as Giovanni mentioned, I wrote a guide on PLAY Embedded. I am planning to update it but it still provides a great reference
Debuggin on STM32 with ChibiStudio

If you end to read it, please provide feedback so that I can revise it for the better.
Ciao,
RM

steved
Posts: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Deugging ChibiOS application

Postby steved » Sun Mar 19, 2023 6:19 pm

One optimisation option I rarely see mentioned is -Og. This provide some optimisation over -O0, but in a manner which doesn't confuse debugging in the same way as -O2. For me, it reduces code size by 15-20%, which is a very worthwhile saving in download time on a 1MB program.

ptihanyi
Posts: 2
Joined: Sun Mar 19, 2023 10:23 am

Re: Deugging ChibiOS application

Postby ptihanyi » Sun Mar 19, 2023 8:59 pm

Thanks for the advice!
In the meantime, I did some more research: the javascript OS-awareness plugin used in Segger Ozone supports ChibiOS/RT 6.x.
The J-Link RTOSPlugin_ChibiOS.dll also only supports 6.x.
In theory, the Ozone js plugin could be modified to work with 7.x. I might give it a try, it might be good for a challenge.
I read the recommended article, very thorough description! I really like the whole PLAY Embedded thing! It's rare to find such a comprehensive knowledge base on MCU. You can see that a lot of work has gone into it.
ChibiStudio is a really well put together Eclipse distribution, but if possible I would stick with STM32CubeIDE. There are a few plugins I like to use (Static stack analyzer, SWO plugins, FreeRTOS-aware plugins). These would be missing. I will try to install the plugins from ChibiStudio.

User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Location: Munich (Germany)
Has thanked: 83 times
Been thanked: 67 times
Contact:

Re: Deugging ChibiOS application

Postby RoccoMarco » Sat Mar 25, 2023 9:32 am

Hi steved, thanks for mentioning Og. I did not look into these options thoroughly. I will do this when I will rework the debugging guide.

Thanks ptihanyi, I can assure indeed that PLAY Embedded takes a lot of my time but is a very rewarding activity. I am very open to ideas an suggestions

Connect with me on LinkedIN and if you want to get an email when a new article comes out subscribe to the newletter or follow PLAY Embedded on Linkedin

About the newsletter do be afraid of spam. I write the newsletter manually and I hate spam
Ciao,
RM


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 10 guests