How can use CMSIS in Chibios?

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

Moderators: RoccoMarco, lbednarz, tfAteba

oattao
Posts: 9
Joined: Mon Dec 03, 2012 5:04 am

How can use CMSIS in Chibios?

Post by oattao »

Hi all.
I've studied ChibiOS for some weeks. I used to work with CMSIS library on STM32 microcontroller. I have a question: Can I use CMSIS library in ChibiOS to work with STM32?
Sorry if my question is stupid.
Thanks in advance.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How can use CMSIS in Chibios?

Post by Giovanni »

Hi,

CMSIS is not usually required but you can use it.

The CMSIS header is already included in ChibiOS when you include hal.h so you can use the definitions immediately. CMSIS C modules can be added to the Makefile and used, I don' foresee problems.

Giovanni
lenh_tap_ket
Posts: 2
Joined: Tue Dec 04, 2012 10:56 am

Re: How can use CMSIS in Chibios?

Post by lenh_tap_ket »

Hi all mem,
I've studied ChibiOS/RT for some week. I want to find examples Semaphores in chibiOS but i didn't find them any where ?
I'm using STM32L-Discovery KIT, I need some examples about Semaphore that KIT. If anyone has, please share to me.
Thanks in Advance !
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How can use CMSIS in Chibios?

Post by Giovanni »

Hi,

Some examples are in this file ./test/testsem.c

For a general introduction to semaphores http://en.wikipedia.org/wiki/Semaphore_ ... ramming%29

Giovanni
ucfreak
Posts: 2
Joined: Sun Dec 16, 2012 6:44 pm

Re: How can use CMSIS in Chibios?

Post by ucfreak »

Giovanni wrote:Hi,

CMSIS is not usually required but you can use it.

The CMSIS header is already included in ChibiOS when you include hal.h so you can use the definitions immediately. CMSIS C modules can be added to the Makefile and used, I don' foresee problems.

Giovanni


Hi Giovanni,

Did you mean that is possible use the CMSIS from ST?
I'm new to ChibiOS and interested in using the CMSIS delivered by ST within the STM32F10x Std Periph Driver package. Somehow I got confused how to integrate the CMSIS from ST without conflicting with the CMSIS integrated in ChibiOS.

I tried to remove the contents of ports/common/ARMCMx/CMSIS and to point to the files of ST's CMSIS. For now compilation is broken.

Any hint or example how to move to CMSIS from ST or how to start? Does it make sens to move to ST's CMSIS?

Regards,
ucfreak
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How can use CMSIS in Chibios?

Post by Giovanni »

Hi,

The headers from the ST CMSIS are already included when you include hal.h, you can use it without having to do anything.

Using CMSIS could be useful in some cases but most drivers are part of ChibiOS so it is not very common.

Giovanni
ucfreak
Posts: 2
Joined: Sun Dec 16, 2012 6:44 pm

Re: How can use CMSIS in Chibios?

Post by ucfreak »

Hi,

thanks for the fast answer. Iĺl keep it as delivered by default, now compilation if fine.

Regards,

ucfreak
ruslanpopov
Posts: 35
Joined: Sun Aug 19, 2012 9:36 pm

Re: How can use CMSIS in Chibios?

Post by ruslanpopov »

Continuing of thread (viewtopic.php?f=2&t=945)...

I have created a repo with ChibiOS project, added there a CMSIS, add INC directories into Makefile and try to run PWM in TIM17.

Repo: https://github.com/RaD/armka_demos

Now I have the following problem:

Code: Select all

rad@n150:~/devel/arm/workplace/armka_demos/apps/ir-tester$ LANG=C make
Linking build/firmware.elf
build/obj/stm32f10x_rcc.o: In function `RCC_APB2PeriphClockCmd':
/home/rad/devel/arm/workplace/armka_demos/apps/ir-tester/../../CMSIS/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c:1098: undefined reference to `assert_param'
/home/rad/devel/arm/workplace/armka_demos/apps/ir-tester/../../CMSIS/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c:1099: undefined reference to `assert_param'
collect2: ld returned 1 exit status
make: *** [build/firmware.elf] Error 1]


Just don't understand what else does it want to link this `assert_param`.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: How can use CMSIS in Chibios?

Post by Giovanni »

Probably it is defined in some other module in the ST library. Alternatively use the macros defined in stm32_rcc.h in order to enable clocks, all ChibiOS drivers do that.

Giovanni
ruslanpopov
Posts: 35
Joined: Sun Aug 19, 2012 9:36 pm

Re: How can use CMSIS in Chibios?

Post by ruslanpopov »

As I see, linker can't link assert_param reference from `stm32f10x_rcc.c`. Does CMSIS need to add some *.so or *.a library to ChibiOS project? Just don't understand what to do next.
Post Reply