Can I use RT on Cortex M4 without CMSIS

Discussions and support about ChibiOS/RT, the free embedded RTOS.
ofdouglas
Posts: 3
Joined: Fri Jul 08, 2016 8:07 pm

Can I use RT on Cortex M4 without CMSIS

Postby ofdouglas » Fri Jul 08, 2016 8:21 pm

Hello,

I am interested in using ChibiOS/RT on the TM4C1294 Tiva C microcontroller. I want to program the peripherals using a mix of TI's Tivaware peripheral library and direct register accesses using the Tivaware header files. Unfortunately, it seems that TI's library is not compatible with CMSIS: the naming conventions are largely different, and many 'symbol redefined' errors occur if both headers are included.

The ChibiOS documentation about this confuses me. Under CMSIS RTOS Compatibility it is said that RT offers a 'compatibility layer' for CMSIS, implying that CMSIS is not mandatory. But under ChibiOS/RT Integration Guide it is said that 'the ARM Cortex-M port also requires the vendor-provided CMSIS-compliant registers definition headers'. So, can I use ChibiOS/RT on the TM4C1294 without using the CMSIS header files?

Thanks

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: Can I use RT on Cortex M4 without CMSIS

Postby Marco » Fri Jul 08, 2016 9:19 pm

Hi,

I never tried using TivaWare together with the TM4C microcontrollers. I guess, as you already found out, that they are indeed not compatible. This is mainly caused by TI doing things their own way instead of providing CMSIS files.. A lot of people have been asking for it for a very long time already. Why don't you use ChibiOS/HAL instead of TivaWare?

AFAIK the compatibility layer is only for the CMSIS RTOS api. You can use the CMSIS RTOS api instead of the ChibiOS/RT api, but it is not mandatory.

The 'vendor-provided CMSIS-compliant registers definition headers' for the Tiva port are custom made since TI is not providing up to date official headers.

ChibiOS works with the CMSIS headers so i think you can not use ChibiOS without them.

Marco

ofdouglas
Posts: 3
Joined: Fri Jul 08, 2016 8:07 pm

Re: Can I use RT on Cortex M4 without CMSIS

Postby ofdouglas » Fri Jul 08, 2016 10:30 pm

Marco,

Thanks for your response. I will consider using HAL, although I'm not sure it provides everything I need. That would not be a problem if I could fill in the gaps with Tivaware... but since it seems that even the headers needed for raw register access are incompatible, I may have to create my own headers for any peripherals or peripheral options not covered by HAL. For example, I may need to use the CRC peripheral in the TM4C1294.

If I were already familiar with ChibiOS I would probably find a way to use HAL, but since I am instead new to RTOSes and familiar with Tivaware, I will probably pick an RTOS that can work seamlessly with Tivaware. It's a shame TI didn't make their headers compatible...

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: Can I use RT on Cortex M4 without CMSIS

Postby Marco » Sat Jul 09, 2016 8:48 am

Hi,

You can fill the gap with HAL using the custom CMSIS header for direct register access. It is possible some peripherals are missing in the custom header but they can be added. Which peripherals do you want to use? Maybe i can support you a bit with that.

Note that if a peripheral driver is present in HAL it is much easier to use than TivaWare. The HAL drivers are thread aware and use DMA where possible so you don't have to 'mess' with that. I'm sorry to hear you are considering moving to another RTOS.

ofdouglas
Posts: 3
Joined: Fri Jul 08, 2016 8:07 pm

Re: Can I use RT on Cortex M4 without CMSIS

Postby ofdouglas » Tue Jul 12, 2016 4:19 pm

Hello Marco,

I decided to use a different RTOS for this project, because I have a tight schedule to meet. I think the solution of using HAL + custom CMSIS header (plus learning the HAL API) would cut into my development time, considering that I already have working TivaWare code for many of the peripherals I need. On top of this, ChibiOS looks a bit more complicated to build than some of the competitor RTOSes, although I do think it looks better in terms of features and coding style.

I will probably try to learn ChibiOS/RT and HAL sometime in the future when I am not on a tight schedule (and maybe not using a TI chip), because I suspect that this will be a more powerful and easier to use combination.

For what it's worth, the peripheral that I could not find support for in HAL is the CRC module.

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: Can I use RT on Cortex M4 without CMSIS

Postby Marco » Wed Aug 10, 2016 11:06 am

Hi ofdouglas,

I understand you choose for a different RTOS for your project. Just to let you know, i'm considering to replace the custom CMSIS device headers by the official TivaWare device headers so TivaWare can be used if needed.

The Tiva low level drivers should be partly rewritten to use the new register defines instead of the CMSIS peripheral typedefs.

@Giovanni, what are your thoughts about this?

Marco

User avatar
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: Can I use RT on Cortex M4 without CMSIS

Postby Giovanni » Wed Aug 10, 2016 4:04 pm

Hi,

Port functions don't use much of the CMSIS headers. Consider that up to version 2.6.x CMSIS was not even used by the kernel.

You could just make a "cmparam.h" file that does NOT include the CMSIS header and provides implementations for the few macros required.

The port layer includes "cmparam.h", not directly the CMSIS headers. Just compile the code and when you see something missing add that to cmparam.h.

Note that cmparam.h is also included from asm files, make sure to put C declarations between

Code: Select all

#if !defined(_FROM_ASM_)
#endif


It should be trivial, initially I didn't even want to use CMSIS but nowadays you have to fill that checkbox.

Giovanni

Marco
Posts: 128
Joined: Tue Apr 16, 2013 8:22 pm
Has thanked: 4 times
Been thanked: 11 times

Re: Can I use RT on Cortex M4 without CMSIS

Postby Marco » Wed Aug 10, 2016 4:59 pm

Hi Giovanni,

That is exactly what i was thinking. I will give it a try and see how it goes, it should not be that hard.

After all, the reason I created and use the custom CMSIS device headers for the Tiva port was because the STM32 port is based on CMSIS files. This discussion made me realize this is probably not the best solution for the Tiva port.

ChibiOS/HAL and TivaWare can not be mixed currently but I think this will be possible when all changes are done.

Marco


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 3 guests