Enable ARM Math and CMSIS Driver Library in SW4STM Integrated Development Environment

System Workbench for STM32 (SW4STM) from OpenSTM32 has been widely used as the tool for developing STM32-based embedded system since this software is free and supported by STMicroelectronics’s STM32CubeMX initialization software. The ARM microprocessor designer company provides special driver for ease the development Cortex-M series optimized functions, namely Cortex Microcontroller Software Interface Standard (CMSIS). CMSIS is provided free of charge by ARM from their Silver Portal , but I had to register first before finally got the download link. After installed on my workspace folder, I have to set several things in the setting of SW4STM projects (project->properties menu).

  1. C/C++ Build -> Build Variables, add CMSIS_LOC variable (type:folder), see figure 1.

    Figure 1. Build Variables

  2. C/C++ Build -> Settings -> Tool Settings ->  MCU GCC Compiler -> Preprocessor, add ARM_MATH_CM3 (figure 2)

    Figure 2. Preprocessor

  3. C/C++ Build -> Settings -> Tool Settings ->  MCU GCC Linker -> Libraries, add arm_cortexM3l_math in the Libraries (-l) edit box, and the paths in the Libraries (-L) edit box (with the value of  your CMSIS installation), see figure 3.

    Figure 3. Linker’s Libraries

 Now you can use #include <arm_math.h> in your main.c to use CMSIS libraries, happy coding and good luck!