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.
Post Reply
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 »

Well, there is ARM7/9/11 and PowerPC. How the other RTOS supported in OpenOCD solve this problem?

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

Re: ChibiOS OpenOCD support

Post by mabl »

Abhishek wrote:Looking forward to see it up very soon. However there is OpenOCD v0.6.1 - Right now they are planning a maintenance bugfix release. If you complete it soon, I hope you could send on to the OpenOCD mailing list. At least an announcement should be sufficient.


Hi Abhishek,
I've written an email to Evan Hunter @ broadcom who is the initial author of openocd rtos support. Judging from his mailing list posts he is very enthusiastic about adding new operating systems. I hope to get some feedback from him and how best to continue pushing it upstream.

But before pushing it, I'd very much like to get feedback from my fellow chibios users. :mrgreen: Once giovanni has figured out the garbage collection problems (hint hint) I think it is ready for general consumption.

Hopefully tomorrow I finish the guide and you all have to give it some testing :twisted:
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Giovanni wrote:Well, there is ARM7/9/11 and PowerPC. How the other RTOS supported in OpenOCD solve this problem?

Giovanni


The register maping from stack is automatically selected depending on the target platform. All one has to do is provide an appropriated definition in the openocd source. Currently there is only cortex-m defined for all other rtos'es. But it's just a matter of adding those mappings to the struct definitions. If you would like to test them I can add those too.
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 »

You may just create the required abstractions in the code, the actual support may come at a later point.

The fact is that nowadays it is mostly Cortex-M even if I have high hopes for e200z Power cores for some reason :-)

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

Re: ChibiOS OpenOCD support

Post by mabl »

Giovanni wrote:You may just create the required abstractions in the code, the actual support may come at a later point.

The fact is that nowadays it is mostly Cortex-M even if I have high hopes for e200z Power cores for some reason :-)

The abstraction is already there. All what's needed is the sequence with which the registers are saved on the stack.

Have a look at https://github.com/mabl/openocd_chibios/blob/rtos_chibios/src/rtos/ChibiOS.c#L90 and https://github.com/mabl/openocd_chibios/blob/rtos_chibios/src/rtos/rtos_chibios_stackings.c for the stack definitions. All is very generic.
mabl
Posts: 417
Joined: Tue Dec 21, 2010 10:19 am
Been thanked: 1 time

Re: ChibiOS OpenOCD support

Post by mabl »

Giovanni wrote:
mabl wrote:I'm back from holidays and looking at OpenOCD support again. Have you found a solution to the dropping of ch_root? If so, it is not included in the most recent SVN, right?

I forgot about that :) I will do something in the evening.


Hi Giovanni,
I do not want to annoy you - but I'm really eager to get this into a usable state. Any progress on this front? :mrgreen:
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 »

I'll try in the evening, I am very busy with a secret project that will affect ChibiOS and change the destiny of humanity :)

Giovanni
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 »

OK, the destiny can wait for a little bit, I added persistence to the object, note now it is named ch_debug instead of ch_root.

About the FPU flag, can you detect it at runtime by looking at the SCB_FPCCR or SCB_FPCCR registers? see crt0.c for an example.

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

Re: ChibiOS OpenOCD support

Post by mabl »

Giovanni, are you sure your code works?

With disabled GC, I see the symbol:

Code: Select all

# arm-none-eabi-nm build/ch.elf | grep ch_debug | wc -l
1


but not without it:

Code: Select all

# arm-none-eabi-nm build/ch.elf | grep ch_debug | wc -l
0


I'll look into the FPU stuff.
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 »

I saw the symbol in the map file, I'll check again. I'd hate to have to waste a pointer to point there.

Giovanni
Post Reply