2 Replies Latest reply on Apr 26, 2018 6:53 AM by JoYe_1259141

    undefined reference to assembly






      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?







        • 1. Re: undefined reference to assembly



          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.









          • 2. Re: undefined reference to assembly

            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.



            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.