Page 5 of 18

Re: ChibiOS OpenOCD support

Posted: Tue Oct 02, 2012 7:02 pm
by Giovanni
Well, there is ARM7/9/11 and PowerPC. How the other RTOS supported in OpenOCD solve this problem?

Giovanni

Re: ChibiOS OpenOCD support

Posted: Tue Oct 02, 2012 7:04 pm
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:

Re: ChibiOS OpenOCD support

Posted: Tue Oct 02, 2012 7:07 pm
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.

Re: ChibiOS OpenOCD support

Posted: Tue Oct 02, 2012 7:09 pm
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

Re: ChibiOS OpenOCD support

Posted: Tue Oct 02, 2012 7:13 pm
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.

Re: ChibiOS OpenOCD support

Posted: Wed Oct 03, 2012 10:49 am
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:

Re: ChibiOS OpenOCD support

Posted: Wed Oct 03, 2012 11:10 am
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

Re: ChibiOS OpenOCD support

Posted: Wed Oct 03, 2012 2:55 pm
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

Re: ChibiOS OpenOCD support

Posted: Wed Oct 03, 2012 5:39 pm
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.

Re: ChibiOS OpenOCD support

Posted: Wed Oct 03, 2012 6:36 pm
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