cmsis fft example problem in keil uvision 5.15 - Page 1
Forum section: electronics / general

author: aseok
author_rank: Contributor
timestamp: June 23, 2015, 06:41:42 pm
content: HelloI tried to compile and run arm_fft_bin_example of the cmsis package but there is a problem.The problem is in the arm_bitreversal2.s file that can't be compiled by keil.Is there any workaround and solution?Thanks.

author: andersm
author_rank: Super Contributor
timestamp: June 23, 2015, 07:53:19 pm
content: It would help if you provided some details about what errors you're getting, your environment, what steps you've tried etc.

author: aseok
author_rank: Contributor
timestamp: June 24, 2015, 01:01:58 am
content: I tried to compile and runarm_fft_bin_exampleof the cmsisDSP_Libpackage(Ver4.2 or 4.3) but there is a problem.The problem is in thearm_bitreversal2.sfile that can't be compiled bykeil.Some errors:Code:C:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(43): error: A1163E: Unknown opcode defined(__CC_ARM) , expecting opcode or MacroC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(44): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(45): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(46): error: A1163E: Unknown opcode defined(__IASMARM__) , expecting opcode or MacroC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(47): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(48): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(49): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(50): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(51): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(52): error: A1163E: Unknown opcode defined(__CSMC__) , expecting opcode or MacroC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(53): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(54): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(55): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(56): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(57): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(58): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(59): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(60): error: A1163E: Unknown opcode defined , expecting opcode or MacroC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(61): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(62): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(63): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(64): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(65): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(66): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(67): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(69): error: A1137E: Unexpected characters at end of lineC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(70): error: A1167E: Invalid line startC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(72): error: A1163E: Unknown opcode CODESECT , expecting opcode or MacroC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(85): error: A1163E: Unknown opcode defined(ARM_MATH_CM0) , expecting opcode or MacroC:\Users\armin\Desktop\stm_discovery\stm32cube\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Source\TransformFunctions\arm_bitreversal2.S(87): error: A1105E: Area directive missing

author: andersm
author_rank: Super Contributor
timestamp: June 24, 2015, 06:55:16 am
content: Which version of Keil? Based on the error messages, the source file hasn't been processed by the C preprocessor, so the assembler chokes on the #defines etc. See if there's an option in the IDE for passing assembly files via the preprocessor, ordo it manually.

author: aseok
author_rank: Contributor
timestamp: June 24, 2015, 07:48:02 am
content: Hello(cmsis fft example problem in keil uvision5.15)Here is the modified and working code for cortex-m4:Code:AREA ||.text||, CODE, READONLY, ALIGN=2THUMB;/*;* @brief In-place bit reversal function.;* @param[in, out] *pSrc points to the in-place buffer of unknown 32-bit data type.;* @param bitRevLen bit reversal table length;* @param *pBitRevTab points to bit reversal table.;* @return none.;*/EXPORT arm_bitreversal_32EXPORT arm_bitreversal_16arm_bitreversal_32 PROCADDS r3,r1,#1CMP r3,#1IT LSBXLS lrPUSH {r4-r9}ADDS r1,r2,#2LSRS r3,r3,#2arm_bitreversal_32_0 ;/* loop unrolled by 2 */LDRH r8,[r1,#4]LDRH r9,[r1,#2]LDRH r2,[r1,#0]LDRH r12,[r1,#-2]ADD r8,r0,r8ADD r9,r0,r9ADD r2,r0,r2ADD r12,r0,r12LDR r7,[r9,#0]LDR r6,[r8,#0]LDR r5,[r2,#0]LDR r4,[r12,#0]STR r6,[r9,#0]STR r7,[r8,#0]STR r5,[r12,#0]STR r4,[r2,#0]LDR r7,[r9,#4]LDR r6,[r8,#4]LDR r5,[r2,#4]LDR r4,[r12,#4]STR r6,[r9,#4]STR r7,[r8,#4]STR r5,[r12,#4]STR r4,[r2,#4]ADDS r1,r1,#8SUBS r3,r3,#1BNE arm_bitreversal_32_0POP {r4-r9}BX lrENDParm_bitreversal_16 PROCADDS r3,r1,#1CMP r3,#1IT LSBXLS lrPUSH {r4-r9}ADDS r1,r2,#2LSRS r3,r3,#2arm_bitreversal_16_0 ;/* loop unrolled by 2 */LDRH r8,[r1,#4]LDRH r9,[r1,#2]LDRH r2,[r1,#0]LDRH r12,[r1,#-2]ADD r8,r0,r8,LSR #1ADD r9,r0,r9,LSR #1ADD r2,r0,r2,LSR #1ADD r12,r0,r12,LSR #1LDR r7,[r9,#0]LDR r6,[r8,#0]LDR r5,[r2,#0]LDR r4,[r12,#0]STR r6,[r9,#0]STR r7,[r8,#0]STR r5,[r12,#0]STR r4,[r2,#0]ADDS r1,r1,#8SUBS r3,r3,#1BNE arm_bitreversal_16_0POP {r4-r9}BX lrENDPEND

author: aseok
author_rank: Contributor
timestamp: June 24, 2015, 08:04:53 am
content: Thanks for your help, by defining the following expression in theoptions for target->Asm->Misc Controls, problem will be solved.Code:--cpreproc