You are here

Including CMSIS library to PSoC project | Cypress Semiconductor

Including CMSIS library to PSoC project

Summary: 2 Replies, Latest post by Roberto48 on 09 Sep 2014 04:59 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
lsen's picture
Cypress Employee
22 posts

 1. How to include CMSIS library to the PSoC project?


Here are the steps that needs to be followed to include the CMSIS library in your project:

1. Please copy the CMSIS library into your project's directory.

2. In workspace explorer(in creator), right click your project and select 'Build settings'->compiler->General. In the 'Additional include directories', add the path of the header files(include folder of CMSIS library).

3. In the same window, change 'preprocessor definitions' to 'ARM_MATH_CM3'.

4. In the same window, please go to linker->general and add 'additional libraries' as 'm'. Apply changes and close the window.

5. In arm_math.h file, add this line "include <device.h>".

6. Since PSoC 5 already contains part of the CMSIS library in "Generated_Source\cy_boot", we have to delete the following definitions.

In core_cmInstr.h, remove the definition of following functions:


In core_cmFunc.h, remove

__get_PSP, __set_PSP, __get_MSP, __set_MSP, _get_PRIMASK, _set_PRIMASK, _enable_fault_irq, _disable_fault_irq, __get_BASEPRI, _set_BASEPRI, __get_FAULTMASK, __set_FAULTMASK, _enable_irq, _disable_irq, _get_CONTROL, _set_CONTROL.

7. Right click source files (workspace explorer), select add->existing item->'and add all necessary source files that you are using'.

Now, the project will build.

Note: Step 6 is not needed in creator 3.0.

will9twl's picture
3 posts

Hi there

Why do you need to add "#include <device.h>" in "arm_math.h"?

The method didn't work for me when it ran into a compiler error as it couldn't find the "device.h" file (on PSoC Creator 3.0)

I had to remove that line to make it work




Roberto48's picture
48 posts



I found that you should add  "#include <project.h>"  in stead of device.h   (in Creator 3 and for PSoC5).

After that, no errors



Log in to post new comments.