Sunday, September 9, 2012

The Secret Sauce

Source code is up!
https://github.com/EuphonistiHack/launchpad-freq-analyzer.git

I'm assuming that TI will follow the standard procedure for Stellaris installs for Launchpad, which is to say that when you install StellarisWare, the file structure will be such that you have a root (defaulted to C:/StellarisWare) in which driverlib will be copied.  That root will also contain a  boards directory, which in turn should contain a directory for the lm4f120.  If you do a git clone off of the above address, you'll find a similar file structure.  You should just be able to copy the led_equalizer project into the lm4f120 board directory, and copy dsplib into the stellarisWare root.

In it's current state, the only thing I've verified working is the Code Composer Studio build.  I have included project files that should at least be 95% good for all the other Stellaris supported environments: a makefile for you command line GCC enthusiasts and project files for Keil uVision, IAR Embedded Workbench, and CodeSourcery's IDE.  I'm guessing that if you tried to import and build into any of those as is, you will hit two problems.

For one, there's a config array that the uDMA engine uses that needs to be stored on a 1024 byte boundary.  I have some pragmas in place to handle that for CCS and IAR, but I haven't yet figured out the syntax for handling this in other compilers.  Shouldn't be too hard to figure out, and hopefully I'll have that done soon.

The second issue will be with the CMSIS library.  The current release contains a precompiled .lib and the headers necessary to interface with it.  This was compiled with the tms470 compiler, though, so it won't work with anything other than CCS.  If you download CMSIS for yourself, it should come with precompiled binaries for use with uVision, GCC, and CodeSourcery.  You'll want to add those to dsplib, then edit your project's library include path/list to point to the proper binary.  I am considering including these in dsplib, but I'm not really sure what ARM's policy is on redistributing their binaries, and I'd prefer not get sued out of existence :)

Enjoy!

5 comments:

  1. The uDMA issue can be resolved. Take a look at the udma_demo apps in StellarisWare for other boards. You will find the #ifdefs and #pragmas for the other tool chains for the uDMA buffer/structure thing on the 1024 boundary.

    ReplyDelete
  2. Hello,
    I tried to import into Code Composer Studio the project, but got this error message :

    "Error: Import failed for project 'freq_analyzer' because its compiler definition is not available. Please install the ARMv5.0 compiler before importing this project."

    What does that mean ? My CCS version is 5.2.1.00018, and it is licensed with the free license that is relative to the Stellaris Launchpad LM4F120XL, just bought.

    Thanks,
    Alberto

    ReplyDelete
  3. Alberto, update your CCS install to version 5.3 or higher. The CCS guys renamed the tms470 compiler to the ARMv5 compiler, which causes the error you're seeing.

    ReplyDelete
    Replies
    1. Thanks, will do.
      This would also imply that I have to change in some .h files the pre-processor directives that explicitly check for a TMS470 compiler ? For example, in dsplib there is the arm_math.h file, which contains these instructions :

      #if defined (__TMS470__)
      #if defined ( __TI_TMS470_V7M3__ )
      #define ARM_MATH_CM3
      #else
      #define ARM_MATH_CM4
      #endif
      #endif

      Should I change all the occurences of TMS470 to ARMv5.0 ?

      Thanks again,
      Alberto

      Delete
    2. Hello,

      I just upgraded CCS to Version 5.3.0.00090, which should be the latest. But I still get this error message when trying to build your freq_analyzer project :
      =============
      Buildfile generation error occurred..
      This project was created using a version of compiler that is not currently installed: 5.0.1 [ARM]. Please install the compiler of this version, or migrate the project to one of the available compiler versions by adjusting project properties.
      Build stopped..
      =============

      Is there anything I can do to overcome this error ?

      Thanks,
      Alberto

      Delete