Port to Tasking on Cortex-M3

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.
kdums
Posts: 13
Joined: Tue Oct 17, 2017 4:06 pm
Has thanked: 1 time

Port to Tasking on Cortex-M3

Postby kdums » Mon Nov 06, 2017 7:51 am

Hi!

Could you please continue with your book?
We need to use a Tasking compiler, which means we need to rewrite all the assembly parts, at least.
It would be very nice to have a guideline that you indicated by the chapters "The ARM Cortex-M Port" and "CMSIS RTOS Implementation".
We would need that in very near future.

Kind regards,
Klaus

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: Port to Tasking on Cortex-M3

Postby Giovanni » Mon Nov 06, 2017 8:58 am

Hi,

You don't need to wait for the book for that, the Cortex-M port already supports 3 compilers and the 3 versions are basically the same, just follow the pattern. The book would guide you to porting to new architectures, your problem is only compiler-related, the port for Cortex-M already exists.

The hardest parts are rewriting the file rules.mk and the linker files.

Giovanni

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: Port to Tasking on Cortex-M3

Postby Giovanni » Tue Nov 07, 2017 10:34 am

Just a note, you don't need to rewrite assembly parts, you just need to translate the .S files to the syntax of the tasking compiler, the asm code itself should be equal 1:1.

Most of differences are handled by the CMSIS headers, so there is little work to do in the port itself.

I have requested a free trial of the compiler.

Giovanni

kdums
Posts: 13
Joined: Tue Oct 17, 2017 4:06 pm
Has thanked: 1 time

Re: Port to Tasking on Cortex-M3

Postby kdums » Tue Nov 07, 2017 3:35 pm

Hi!

Thanks for the advice, but since I am neither familiar with the Cortex M3 nor with the OS, it would be nice to have the basics of the OS with respect to the CPU in a form that is easyly understandable. Finding faults is easier if you know what can be expected.

I have already done tried to port, and it does mostly what I would expect, but I am not sure.
Most problematic was that the assembler does not recognize #define or #include.
Also I missed out on stuff in startup code.

Kind regards,
Klaus Dums

kdums
Posts: 13
Joined: Tue Oct 17, 2017 4:06 pm
Has thanked: 1 time

Re: Port to Tasking on Cortex-M3

Postby kdums » Fri Jan 12, 2018 8:33 am

Hi!

Since the assembler from TASKING cannot preprocess, I had to build c-functions with inline assembler.
But I am therefore dependent on the compiler not to mess up the stack scheme (which it does :evil: ).

Do you think it's possible to split assambler and c-functions cleanly in order not to depend on preprocessor in assembler files?

How can I send files to you for review?

Kind regards,
Klaus Dums

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: Port to Tasking on Cortex-M3

Postby Giovanni » Fri Jan 12, 2018 8:40 am

Hi,

There is a strong assumption about preprocessing of assembler files because dependencies on chconf.h.

Using inline asm is a bad idea because the prologue/epilogue code added by the compiler that cannot be predicted. Have you considered using the GCC preprocessor on Tasking asm modules? you need to add one step to your build process.

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 14 guests