CLion IAR Example Project Failed To Compile arm_bitreversal2.S

CLion 2022.2.3

IAR 9.30.1

I am a long time user of CLion for my personal projects and am thrilled to see the continued work on supporting embedded development including some integration with stm32 and IAR. I am currently evaluating using CLion at our company with stm32 and IAR. Both the JetBrains and IAR help pages link to this example repository:
https://github.com/elmot/clion-iar-stm32f3-stub 

It seems to automatically find the the compiler automatically when I open the project however it cant compile arm_bitreversal2.S and startup_stm32f303xc.s which are both auto generated files by STM32Cube. I do not see any headers that would be related to these files and I am unsure as to why they will not compile. I have attached the compile log below please let me know if there is anything I have missed.

Your help is greatly appreciated,

Michael

====================[ Build | clion_iar_stm32f3_stub | Default ]================
C:\Users\mwagner\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\222.4167.35\bin\cmake\win\bin\cmake.exe --build C:\Projects\git\clion-iar-stm32f3-stub-master\cmake-build-default --target clion_iar_stm32f3_stub -- -j 3
Scanning dependencies of target clion_iar_stm32f3_stub
[  3%] Building ASM object CMakeFiles/clion_iar_stm32f3_stub.dir/Core/Src/arm_bitreversal2.S.obj
[  7%] Building CXX object CMakeFiles/clion_iar_stm32f3_stub.dir/Core/Src/cppmain.cpp.o
[ 10%] Building C object CMakeFiles/clion_iar_stm32f3_stub.dir/Core/Src/main.c.o

   IAR ANSI C/C++ Compiler V9.30.1.335/W64 for ARM
   Copyright 1999-2022 IAR Systems AB.
   Network license: MXAZPIARLSM2-VM (CM)

      CODESECT
      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",68  Error[Pe020]: 
          identifier "CODESECT" is undefined

      EXPORT arm_bitreversal_32
      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",78  Error[Pe020]: 
          identifier "EXPORT" is undefined

      EXPORT arm_bitreversal_16
      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",79  Error[Pe065]: 
          expected a ";"

      ADDS     r3,r1,#1
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",143  Error[Pe010]: 
          "#" not expected here

      CMP      r3,#1
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",144  Error[Pe010]: 
          "#" not expected here

      ADDS     r1,r2,#2
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",148  Error[Pe010]: 
          "#" not expected here

      LSRS     r3,r3,#2
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",149  Error[Pe010]: 
          "#" not expected here

  arm_bitreversal_32_0 LABEL       ;/* loop unrolled by 2 */
                                   ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",150  Warning[Pe012]: 
          parsing restarts here after previous syntax error

      LDRH     r8,[r1,#4]
      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",151  Error[Pe020]: 
          identifier "LDRH" is undefined

      LDRH     r8,[r1,#4]
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",151  Error[Pe040]: 
          expected an identifier

      LDRH     r8,[r1,#4]
                   ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",151  Error[Pe020]: 
          identifier "r1" is undefined

      LDRH     r8,[r1,#4]
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",151  Error[Pe017]: 
          expected a "]"

      LDRH     r8,[r1,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",151  Error[Pe010]: 
          "#" not expected here

      LDRH     r8,[r1,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",151  Error[Pe040]: 
          expected an identifier

      LDRH     r9,[r1,#2]
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",152  Error[Pe040]: 
          expected an identifier

      LDRH     r9,[r1,#2]
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",152  Error[Pe017]: 
          expected a "]"

      LDRH     r9,[r1,#2]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",152  Error[Pe010]: 
          "#" not expected here

      LDRH     r9,[r1,#2]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",152  Error[Pe040]: 
          expected an identifier

      LDRH     r2,[r1,#0]
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",153  Error[Pe040]: 
          expected an identifier

      LDRH     r2,[r1,#0]
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",153  Error[Pe017]: 
          expected a "]"

      LDRH     r2,[r1,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",153  Error[Pe010]: 
          "#" not expected here

      LDRH     r2,[r1,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",153  Error[Pe040]: 
          expected an identifier

      LDRH     r12,[r1,#-2]
                   ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",154  Error[Pe040]: 
          expected an identifier

      LDRH     r12,[r1,#-2]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",154  Error[Pe017]: 
          expected a "]"

      LDRH     r12,[r1,#-2]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",154  Error[Pe010]: 
          "#" not expected here

      LDRH     r12,[r1,#-2]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",154  Error[Pe040]: 
          expected an identifier

      ADD      r9,r0,r9
      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",156  Error[Pe065]: 
          expected a ";"

      LDR      r7,[r9,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",159  Error[Pe010]: 
          "#" not expected here

      LDR      r6,[r8,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",160  Error[Pe010]: 
          "#" not expected here

      LDR      r5,[r2,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",161  Error[Pe010]: 
          "#" not expected here

      LDR      r4,[r12,#0]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",162  Error[Pe010]: 
          "#" not expected here

      STR      r6,[r9,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",163  Error[Pe010]: 
          "#" not expected here

      STR      r7,[r8,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",164  Error[Pe010]: 
          "#" not expected here

      STR      r5,[r12,#0]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",165  Error[Pe010]: 
          "#" not expected here

      STR      r4,[r2,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",166  Error[Pe010]: 
          "#" not expected here

      LDR      r7,[r9,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",167  Error[Pe010]: 
          "#" not expected here

      LDR      r6,[r8,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",168  Error[Pe010]: 
          "#" not expected here

      LDR      r5,[r2,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",169  Error[Pe010]: 
          "#" not expected here

      LDR      r4,[r12,#4]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",170  Error[Pe010]: 
          "#" not expected here

      STR      r6,[r9,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",171  Error[Pe010]: 
          "#" not expected here

      STR      r7,[r8,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",172  Error[Pe010]: 
          "#" not expected here

      STR      r5,[r12,#4]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",173  Error[Pe010]: 
          "#" not expected here

      STR      r4,[r2,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",174  Error[Pe010]: 
          "#" not expected here

      ADDS     r1,r1,#8
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",175  Error[Pe010]: 
          "#" not expected here

      SUBS     r3,r3,#1
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",176  Error[Pe010]: 
          "#" not expected here

      ADDS     r3,r1,#1
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",183  Error[Pe010]: 
          "#" not expected here

      CMP      r3,#1
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",184  Error[Pe010]: 
          "#" not expected here

      ADDS     r1,r2,#2
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",188  Error[Pe010]: 
          "#" not expected here

      LSRS     r3,r3,#2
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",189  Error[Pe010]: 
          "#" not expected here

  arm_bitreversal_16_0 LABEL       ;/* loop unrolled by 2 */
                                   ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",190  Warning[Pe012]: 
          parsing restarts here after previous syntax error

      LDRH     r8,[r1,#4]
      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",191  Error[Pe020]: 
          identifier "LDRH" is undefined

      LDRH     r8,[r1,#4]
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",191  Error[Pe040]: 
          expected an identifier

      LDRH     r8,[r1,#4]
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",191  Error[Pe017]: 
          expected a "]"

      LDRH     r8,[r1,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",191  Error[Pe010]: 
          "#" not expected here

      LDRH     r8,[r1,#4]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",191  Error[Pe040]: 
          expected an identifier

      LDRH     r9,[r1,#2]
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",192  Error[Pe040]: 
          expected an identifier

      LDRH     r9,[r1,#2]
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",192  Error[Pe017]: 
          expected a "]"

      LDRH     r9,[r1,#2]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",192  Error[Pe010]: 
          "#" not expected here

      LDRH     r9,[r1,#2]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",192  Error[Pe040]: 
          expected an identifier

      LDRH     r2,[r1,#0]
                  ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",193  Error[Pe040]: 
          expected an identifier

      LDRH     r2,[r1,#0]
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",193  Error[Pe017]: 
          expected a "]"

      LDRH     r2,[r1,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",193  Error[Pe010]: 
          "#" not expected here

      LDRH     r2,[r1,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",193  Error[Pe040]: 
          expected an identifier

      LDRH     r12,[r1,#-2]
                   ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",194  Error[Pe040]: 
          expected an identifier

      LDRH     r12,[r1,#-2]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",194  Error[Pe017]: 
          expected a "]"

      LDRH     r12,[r1,#-2]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",194  Error[Pe010]: 
          "#" not expected here

      LDRH     r12,[r1,#-2]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",194  Error[Pe040]: 
          expected an identifier

      ADD      r8,r0,r8,LSR #1
                            ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",195  Error[Pe010]: 
          "#" not expected here

      ADD      r8,r0,r8,LSR #1
                            ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",195  Error[Pe065]: 
          expected a ";"

      ADD      r9,r0,r9,LSR #1
                            ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",196  Error[Pe010]: 
          "#" not expected here

      ADD      r2,r0,r2,LSR #1
                            ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",197  Error[Pe010]: 
          "#" not expected here

      ADD      r12,r0,r12,LSR #1
                              ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",198  Error[Pe010]: 
          "#" not expected here

      LDR      r7,[r9,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",199  Error[Pe010]: 
          "#" not expected here

      LDR      r6,[r8,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",200  Error[Pe010]: 
          "#" not expected here

      LDR      r5,[r2,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",201  Error[Pe010]: 
          "#" not expected here

      LDR      r4,[r12,#0]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",202  Error[Pe010]: 
          "#" not expected here

      STR      r6,[r9,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",203  Error[Pe010]: 
          "#" not expected here

      STR      r7,[r8,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",204  Error[Pe010]: 
          "#" not expected here

      STR      r5,[r12,#0]
                       ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",205  Error[Pe010]: 
          "#" not expected here

      STR      r4,[r2,#0]
                      ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",206  Error[Pe010]: 
          "#" not expected here

      ADDS     r1,r1,#8
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",207  Error[Pe010]: 
          "#" not expected here

      SUBS     r3,r3,#1
                     ^
"C:\Projects\git\clion-iar-stm32f3-stub-master\Core\Src\arm_bitreversal2.S",208  Error[Pe010]: 
          "#" not expected here
At end of source  Warning[Pe012]: parsing restarts here after previous syntax
          error

Errors: 80
Warnings: 3
mingw32-make[3]: *** [CMakeFiles\clion_iar_stm32f3_stub.dir\build.make:74: CMakeFiles/clion_iar_stm32f3_stub.dir/Core/Src/arm_bitreversal2.S.obj] Error 2
mingw32-make[3]: *** Waiting for unfinished jobs....
mingw32-make[2]: *** [CMakeFiles\Makefile2:82: CMakeFiles/clion_iar_stm32f3_stub.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:89: CMakeFiles/clion_iar_stm32f3_stub.dir/rule] Error 2
mingw32-make: *** [Makefile:123: clion_iar_stm32f3_stub] Error 2
评论操作 固定链接

I resolved the issue CLion was not using the correct toolchain file and was trying to compile the asm files as cpp files.

I made a pull request clarifying some of the documentation I misunderstood here.

https://github.com/elmot/clion-iar-stm32f3-stub/pull/4

0

请先登录再写评论。