AnsweredAssumed Answered

Using CMSIS library in MQX RTOS 4.2, KDS 3.2.0

Question asked by Tak Ming Marco Pang on Oct 5, 2017
Latest reply on Apr 3, 2018 by Xiuli Zhang

Good Evening!
Currently developing on the TWR-K70F120M kit, developing on IDE, KDS 3.2.
I have been having extreme difficulty getting CMSIS library examples to run on MQX 4.2. I have completed the MQX 20 technical sessions and decided to make a new project to test out CMSIS and the variety of examples provided.

 

Initially, I tried using KSDK1.x, KSDK2.x and realised they were incompatible. I also downloaded CMSIS v4.2, v5.
I am mainly interested in using the CMSIS-DSP library, I have followed the guides word for word:
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4489.pdf 
AND
Tutorial: Using the ARM CMSIS Library | MCU on Eclipse 


My steps:
1) Clone Hello2 example from MQX
2) Included Libraries from CMSIS


My understanding is there is a conflict in function names but I am just unsure where to go from here.
However, the errors I am getting are in the screenshot (See Attached Document).

 

Kindest regards,

************************CONSOLE LOG**********************************

15:42:40 **** Incremental Build of configuration int flash sramdata debug for project hello2_CMSIS_LAB ****
Info: Internal Builder is used for build
"C:\\Users\\macro\\Documents\\KDSpersonal\\hello2_CMSIS_LAB\\makedir.bat" "C:/Users/macro/Documents/KDSpersonal/hello2_CMSIS_LAB/int flash sramdata debug"

C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug>set TARGETDIR="C:/Users/macro/Documents/KDSpersonal/hello2_CMSIS_LAB/int flash sramdata debug"

C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug>set TARGETDIR="C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug"

C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug>set TARGETDIR=C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug

C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug>IF NOT EXIST "C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug" mkdir "C:\Users\macro\Documents\KDSpersonal\hello2_CMSIS_LAB\int flash sramdata debug"
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -Wno-missing-braces -g3 -gdwarf-2 -gstrict-dwarf -gstrict-dwarf -gstrict-dwarf -nostdinc -D_AEABI_LC_CTYPE=C -D__FPU_PRESENT -D__STRICT_ANSI__=1 -D_DEBUG=1 "-IC:\\Freescale\\CMSIS_5-develop\\CMSIS/Core/Include" "-IC:\\Freescale\\CMSIS_5-develop\\CMSIS/DSP/Include" "-IC:\\Freescale\\Freescale_MQX_4_2\\lib\\twrk70f120m.kds\\debug" "-IC:\\Freescale\\Freescale_MQX_4_2\\lib\\twrk70f120m.kds\\debug\\bsp" "-IC:\\Freescale\\Freescale_MQX_4_2\\lib\\twrk70f120m.kds\\debug\\bsp\\Generated_Code" "-IC:\\Freescale\\Freescale_MQX_4_2\\lib\\twrk70f120m.kds\\debug\\psp" "-IC:\\Freescale\\Freescale_MQX_4_2\\lib\\twrk70f120m.kds\\debug\\shell" "-IC:\\Freescale\\KDS_v3\\eclipse\\../toolchain/lib/gcc/arm-none-eabi/4.8.4/include" "-IC:\\Freescale\\KDS_v3\\eclipse\\../toolchain/lib/gcc/arm-none-eabi/4.8.4/include-fixed" "-IC:\\Freescale\\KDS_v3\\eclipse\\../toolchain/arm-none-eabi/include" -std=gnu99 -D__VFPV4__=1 -D_DEBUG=1 -c -fmessage-length=0 -c -o "Sources\\arm_sin_cos_example_f32.o" "..\\Sources\\arm_sin_cos_example_f32.c"
In file included from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_compiler.h:48:0,
from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/core_cm4.h:162,
from C:\Freescale\CMSIS_5-develop\CMSIS/DSP/Include/arm_math.h:328,
from ..\Sources\arm_sin_cos_example_f32.c:86:
C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_gcc.h:148:57: error: static declaration of '__get_CONTROL' follows non-static declaration
__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void)
^
In file included from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/psp_cpu.h:49:0,
from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\bsp/mqx.h:1236,
from ..\Sources\main.h:11,
from ..\Sources\arm_sin_cos_example_f32.c:84:
C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/cortex.h:527:25: note: previous declaration of '__get_CONTROL' was here
extern uint32_t __get_CONTROL(void);
^
In file included from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_compiler.h:48:0,
from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/core_cm4.h:162,
from C:\Freescale\CMSIS_5-develop\CMSIS/DSP/Include/arm_math.h:328,
from ..\Sources\arm_sin_cos_example_f32.c:86:
C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_gcc.h:244:57: error: static declaration of '__get_PSP' follows non-static declaration
__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void)
^
In file included from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/psp_cpu.h:49:0,
from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\bsp/mqx.h:1236,
from ..\Sources\main.h:11,
from ..\Sources\arm_sin_cos_example_f32.c:84:
C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/cortex.h:507:25: note: previous declaration of '__get_PSP' was here
extern uint32_t __get_PSP(void);
^
In file included from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_compiler.h:48:0,
from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/core_cm4.h:162,
from C:\Freescale\CMSIS_5-develop\CMSIS/DSP/Include/arm_math.h:328,
from ..\Sources\arm_sin_cos_example_f32.c:86:
C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_gcc.h:298:57: error: static declaration of '__get_MSP' follows non-static declaration
__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void)
^
In file included from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/psp_cpu.h:49:0,
from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\bsp/mqx.h:1236,
from ..\Sources\main.h:11,
from ..\Sources\arm_sin_cos_example_f32.c:84:
C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/cortex.h:511:25: note: previous declaration of '__get_MSP' was here
extern uint32_t __get_MSP(void);
^
In file included from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_compiler.h:48:0,
from C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/core_cm4.h:162,
from C:\Freescale\CMSIS_5-develop\CMSIS/DSP/Include/arm_math.h:328,
from ..\Sources\arm_sin_cos_example_f32.c:86:
C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_gcc.h:328:53: error: static declaration of '__set_MSP' follows non-static declaration
__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
^
In file included from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/psp_cpu.h:49:0,
from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\bsp/mqx.h:1236,
from ..\Sources\main.h:11,
from ..\Sources\arm_sin_cos_example_f32.c:84:
C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/cortex.h:503:25: note: previous declaration of '__set_MSP' was here
extern void __set_MSP(uint32_t);
^
In file included from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/psp_comp.h:34:0,
from C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\bsp/mqx.h:90,
from ..\Sources\main.h:11,
from ..\Sources\arm_sin_cos_example_f32.c:84:
C:\Freescale\Freescale_MQX_4_2\lib\twrk70f120m.kds\debug\psp/comp.h:39:32: error: expected identifier or '(' before '__asm'
#define __set_BASEPRI(basePri) __asm volatile ("msr BASEPRI, %0" : : "r" (basePri))
^
C:\Freescale\CMSIS_5-develop\CMSIS/Core/Include/cmsis_gcc.h:488:53: note: in expansion of macro '__set_BASEPRI'
__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
^

15:42:40 Build Finished (took 285ms)

Outcomes