7 Replies Latest reply on Aug 12, 2015 9:41 AM by scott.carlson

    using ARM CMSIS assembly file

    scott.carlson

      Hey everybody,

         

      I'm using the ARM CMSIS DSP libraries, one of the functions I'm using is arm_cfft_q15. 

         

      This file keeps triggering an error though:

         

      Build error: undefined reference to `arm_bitreversal_16'.

         

       

         

      The function that it is referring to is an assembly function found in the file arm_bitreversal2.s and I have made sure that file is in the source file.

         

       

         

      I noticed that none of the header files from the CMSIS files reference this assembly file, and as far as I can tell I have included all the proper headers and source files in the project and I have followed the method shown here to set up the CMSIS libraries with the project:  http://www.cypress.com/knowledge-base-article/including-cortex-microcontroller-software-interface-standard-cmsis-library.

         

      any suggestions or help would be very appreciated, I attached my project in case anyone wanted to see it. 

         

       

         

      Thanks in advance,

         

      scarlson

        • 1. Re: using ARM CMSIS assembly file
          user_14586677

          Did you check out the Startup and Linking section of the System Reference guide,

             

          in Creator Help ?

             

           

             

          Regards, Dana.

          • 2. Re: using ARM CMSIS assembly file
            scott.carlson

            Thanks again Dana.

               

            Unfortunately I have, and I could not find anything that I think would be of help regarding this, at least that I was able to understand.

               

            There is talk about linking files, but nothing talks about anything that I seem to be using, or that I haven't already done.  

               

            the CMSIS files don't seem to have any other files that I can tell would be used for linking.

               

             

               

            has anyone else tried to use this cmsis function and had success? or know of any other routes I can take? 

               

            I'm starting to run out of ideas to try and get this working.

               

             

               

            -sCarlson

            • 3. Re: using ARM CMSIS assembly file
              user_116575504

              This weekend I tried something that might have been naive. With Creator 3.2, created a project on a PSoC 5LP (the 'prototyping stick' -059).

                 

              I unpacked CMSIS 4.3 into a directory, and added to 'Project>Build Settings>Linker>General>Additional Library Paths' a path to the ARM-built libraries: ..\..\CMSIS-SP-00300-r4p3-00rel0\CMSIS\Lib\GCC .  I then added to Additional Libraries : arm_cortexM3l_math  and to Command Line options I added -lm . 

                 

              To 'Compiler>General>Additional Include Directories' I added ..\..\CMSIS-SP-00300-r4p3-00rel0\CMSIS\Include and to Preprocessor Definitions I added ARM_MATH_CM3 .

                 

              I then built the ARM FIR example pretty much directly with copying files/adding to the project. The test thinks it passes; tinkering with input and output waveform graphing, it does appear to be working as advertised.

                 

              I then added a simple use of arm_cfft_q15() for a 256-point array - the output appears to be correct on first glance. It took 626uS with the PSoC 5LP master clock at 80MHz, BTW.

                 

              It seems the ARM-built library is directly usable - is there something I'm missing here? I've attached the project bundle.

                 

              Dana

              • 4. Re: using ARM CMSIS assembly file
                scott.carlson

                Dana,

                   

                 

                   

                I know I have tried very similar things but I must not have tried exactly that.  When I get home tonight I will give it a test run but looking at the files now it looks like you may have solved my problem.  The fact that you were even able to compile it using arm_cfft_q15 makes me feel hope.  I had originally just gave up with arm_cfft_q15.c and started to use the depreciated functions for arm_cfft_radix4_q15.c since they do not rely on the assembly functions.  This method would be much better if it works.

                I will post an update when I give it a test run.

                   

                 

                   

                a million thanks for your time and help!

                   

                -sCarlson

                • 5. Re: using ARM CMSIS assembly file
                  scott.carlson

                  Well Dana,

                     

                  I was missing the -lm in custom linker scripts....  of all the things that it could have been.  

                     

                   

                     

                  There are other ways to add the files to the project as is shown in my first post, but this seems to be the simplest and the first time I have made arm_cfft_q15.c work.  So, many thanks to you Dana.  

                     

                  I hope this helps someone else at some point. 

                     

                   

                     

                  A bit of a side note, but when you say waveform graphing are you directly referring to a visual waveform?  I am just reading the data into matlab over a com port and plotting it, but its cumbersome at best, is there a better way you might recommend?

                     

                   

                     

                  -scarlson

                  • 6. Re: using ARM CMSIS assembly file
                    user_116575504

                    I'm glad you sorted out the '-lm' - that's bitten me in the dim past. It is great to hear that this worked for you - and it relatively simple. If there is some reason not to use the prebuilt ARM libraries, I have not found it yet (my initial concern was some ABI differences, such as parameter passing conventions, but that hasn't proven to be the case yet).

                       

                    Waveform graphing - my lame technique, really just to visually confirm the results, was to expand the array in the Creator debugger, copy/paste it into a text file and run it through a simple awk script and then into xplot.

                       

                    Good luck with your project -

                       

                    Dana K6JQ

                    • 7. Re: using ARM CMSIS assembly file
                      scott.carlson

                      Ok thats even simpler than my method haha.  I have a few matlab scripts that read in various data types but they always have some issue or another it seems so I might try going the simpler is better route next time.  Thanks for the info

                         

                       

                         

                      Cheers!

                         

                      scarlson