undefined reference to assembly

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Hi,

   

 

   

I installed CMSIS, and I want to make a FFT. The FFT bin example is working, now I want to use the FFT with real values. I have exactly the same problem described by another user here

   

I fact, I added the arm_bitreversal2.S file to my project, but GCC still complains about an undefined reference. The 'workaround' in the other topic was to simply use the precompiled CMSIS library instead of the single source files. However, I don't want to use the workaround, I want to know the solution for this problem.

   

Anyone can help here?

   


Regards,

   

 

   

Ralf

0 Likes
1 Solution
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Update:

   

In general, when adding a .S file, you've to set the filetype to GNU assembler file. In my case it was automatically set to RealView assembler file. Since I don't have RV, the .S simply was not used, and PSoC Creator didn't give a warning (took me half a day to figure out).

   

For the arm_bitreversal2.S file itself, setting the filetype to GNU assembler file won't work either, because it contains C preprocessor instructions (#ifdef, etc) and the file is directly passed to the assembler, which interprets those instructions as comments. So, the 'workaround' here is to set the filetype to C file. This will pass the .S file to GCC.exe, which does the preprocessing and then uses the assembler.

   

I informed Cypress about this behaviour and I'll post their feedback here.

   

 

   

Regards,

   

 

   

Ralf

View solution in original post

0 Likes
2 Replies
RaAl_264636
Level 6
Level 6
50 sign-ins 25 sign-ins 10 solutions authored

Update:

   

In general, when adding a .S file, you've to set the filetype to GNU assembler file. In my case it was automatically set to RealView assembler file. Since I don't have RV, the .S simply was not used, and PSoC Creator didn't give a warning (took me half a day to figure out).

   

For the arm_bitreversal2.S file itself, setting the filetype to GNU assembler file won't work either, because it contains C preprocessor instructions (#ifdef, etc) and the file is directly passed to the assembler, which interprets those instructions as comments. So, the 'workaround' here is to set the filetype to C file. This will pass the .S file to GCC.exe, which does the preprocessing and then uses the assembler.

   

I informed Cypress about this behaviour and I'll post their feedback here.

   

 

   

Regards,

   

 

   

Ralf

0 Likes
JoYe_1259141
Level 1
Level 1
First like given Welcome!

Here is a quick step by step for others that are trying to import the CMSIS DSP example into the PSOC6.

1. Follow Ralf's instructions but insert the code into the CM4 core.

     ie. Copy the relevant CMSIS/DSP .c and .h into the project directory and add them to CM4/Source Files and CM4/Header Files.

2. Rename arm_bitreversal2.S to arm_bitreversal2.C and add it as well.

3. Under Project/Build Settings/CM4 ARM GCC.../Compiler/General/Preprocessor Definitions add the following entries.

     ARM_MATH_CM4

     __FPU_PRESENT=1

4. Under Project/Build Settings/CM4 ARM GCC.../Linker/General/Additional Libraries add m.

5. Under CM4/Header Files/ add core_cm4.h from CMSIS/Core/Include.

6. Right click on the newly added arm_bitreversal2.C under CM4/Source Files/Build settings/CM4.../Compiler/Command Line add the following

     -x assembler-with-cpp

CMSIS DSP should build under PSOC6 at this point.

0 Likes