Author Topic: cmsis fft example problem in keil uvision 5.15  (Read 4102 times)

0 Members and 1 Guest are viewing this topic.

Offline aseok

  • Contributor
  • Posts: 14
  • Country: ir
cmsis fft example problem in keil uvision 5.15
« on: June 23, 2015, 06:41:42 pm »
Hello
I 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.
 

Online andersm

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: fi
Re: cmsis fft example problem in keil uvision 5.15
« Reply #1 on: June 23, 2015, 07:53:19 pm »
It would help if you provided some details about what errors you're getting, your environment, what steps you've tried etc.

Offline aseok

  • Contributor
  • Posts: 14
  • Country: ir
Re: cmsis fft example problem in keil uvision 5.15
« Reply #2 on: June 24, 2015, 01:01:58 am »
I tried to compile and run arm_fft_bin_example of the cmsis DSP_Lib package(Ver4.2 or 4.3) but there is a problem.
The problem is in the arm_bitreversal2.s file that can't be compiled by keil.
Some errors:
Code: [Select]
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 Macro
C:\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 line
C:\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 line
C:\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 Macro
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 Macro
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 Macro
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 line
C:\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 start
C:\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 Macro
C:\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 Macro
C:\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
 

Online andersm

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: fi
Re: cmsis fft example problem in keil uvision 5.15
« Reply #3 on: June 24, 2015, 06:55:16 am »
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, or do it manually.

Offline aseok

  • Contributor
  • Posts: 14
  • Country: ir
Re: cmsis fft example problem in keil uvision 5.15
« Reply #4 on: June 24, 2015, 07:48:02 am »
Hello
(cmsis fft example problem in keil uvision 5.15)
Here is the modified and working code for cortex-m4:
Code: [Select]
               AREA    ||.text||, CODE, READONLY, ALIGN=2

               THUMB

;/*
;* @brief  In-place bit reversal function.
;* @param[in, out] *pSrc        points to the in-place buffer of unknown 32-bit data type.
;* @param[in]      bitRevLen    bit reversal table length
;* @param[in]      *pBitRevTab  points to bit reversal table.
;* @return none.
;*/
EXPORT arm_bitreversal_32
EXPORT arm_bitreversal_16




arm_bitreversal_32 PROC
ADDS     r3,r1,#1
CMP      r3,#1
IT       LS
BXLS     lr
PUSH     {r4-r9}
ADDS     r1,r2,#2
LSRS     r3,r3,#2
arm_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,r8
ADD      r9,r0,r9
ADD      r2,r0,r2
ADD      r12,r0,r12
LDR      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,#8
SUBS     r3,r3,#1
BNE      arm_bitreversal_32_0
POP      {r4-r9}
BX       lr
ENDP

arm_bitreversal_16 PROC
ADDS     r3,r1,#1
CMP      r3,#1
IT       LS
BXLS     lr
PUSH     {r4-r9}
ADDS     r1,r2,#2
LSRS     r3,r3,#2
arm_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 #1
ADD      r9,r0,r9,LSR #1
ADD      r2,r0,r2,LSR #1
ADD      r12,r0,r12,LSR #1
LDR      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,#8
SUBS     r3,r3,#1
BNE      arm_bitreversal_16_0
POP      {r4-r9}
BX       lr
ENDP

END
 

Offline aseok

  • Contributor
  • Posts: 14
  • Country: ir
Re: cmsis fft example problem in keil uvision 5.15
« Reply #5 on: June 24, 2015, 08:04:53 am »
Thanks for your help, by defining the following expression in the options for target->Asm->Misc Controls, problem will be solved.
Code: [Select]
--cpreproc
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf