This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: Project Compilation Failure in CCS 7 and Keil uVision5

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hello!

I am a student who is relatively new to using C language to program my TM4C123GH6PM board (my previous experience was using assembly).  In class, we use Keil uVision 4, and all the code I have written compiles and loads to the board just fine.  On my personal laptop, I initially downloaded Keil uVision 5 and Code Composer Studio 7, but neither will compile my code (I used code that worked just fine in Keil 4).  I checked to make sure the appropriate startup file was included in each project (as well as a copy of tm4c123gh6pm.h, I wasn't sure if this was included by default or not), but in both program I keep getting the same errors when compiling, which are: 

identifier "SYSCTL" is undefined                   for the line            SYSCTL->RCGCGPIO |= 0x20;

identifier "GPIOF" is undefined                      for the line            GPIOF->DIR = 0x0e;

and then other examples which follow suit.  Commenting these lines out allows the program to compile just fine (because I haven't done anything beyond initializations in my code at this point).  Obviously the problem is that it isn't recognizing the definitions of these in the same way Keil 4 does, I'm just not familiar enough with either the C language or these programs to understand exactly why.  I'd love to get experience coding outside of the classroom on my personal computer, so any help would really be appreciated!

  • Hello Kerry,

    It looks like you are trying to use code based on Direct Register Manipulation (DRM) calls. I would strongly advice against that. You should instead use our TivaWare library which can be downloaded from http://www.ti.com/tool/SW-TM4C

    We do not provide support for DRM firmware as we constructed TivaWare to remove the need for all TM4C users to rely on the complexity of DRM calls. We've already done all the work and effort to invent a wheel suited to our devices, so we do not seek to reinvent what we already have done.

    If your class requires otherwise, all I can do is wish you best of luck and give you a good pointer/hint that the issues you are having are likely due to missing files that need to be #include into your project (so you may want to compare what Keil 4 project uses for includes).

  • "SYSCTL->RCGCGPIO |= 0x20;"

    you are using CMSIS-styled programming approach - which I happen to favor as well.

    Download the support files here: github.com/.../CMSIS-framework-for-TM4-devices

  • Such "Programming Approach" may NOT be exclusive to CMSIS!       Is not poster's failing code,  "SYSCTL->RCGCGPIO |= 0x20;" - a "Pointer-Based" version of  "DRM?"    While poster's code avoids the (usual) "HW_REG macro" (which converts address values to C pointer) - the effect is (exactly) the same.      Note that,  "Each Register referenced must be defined as a pointer."

    Ralph's identification of poster's "DRM" approach - appears likely - as  multiple, special "CMSIS" files must be deployed if CMSIS use proves exclusive.     (it is hoped that poster's instructor would have directed attention to the demands CMSIS imposes!

    Now our firm employs the IAR IDE (highly similar to poster's Keil) - and the addition of  "CMSIS" - is spectacularly eased.      (Presented below - do NOT blink!)

    Is it possible that our poster "missed" a (similar) checkbox - w/in Keil - and (that) - was ALL that was lacking?      We hope!

  • It is expected that  poster's, "in class" success resulted from employing a, "Vendor Provided PROJECT" in conjunction w/"Keil uVision 4."

    The errors you note (I expect that those presented - represent at best - the "tip" of a "very large" iceberg) are just as Vendor's Ralph stated - highly likely to be caused by missing "includes."    (possibly those demanded by CMSIS - and the  "CMSIS Checkbox" (assumed available) - was missed!)

    Often - very often - such results due to user's failure to employ a, "Vendor Provided PROJECT" - instead attempting to, "Create their own."     (I DO smell Smoke!)     NEVER a sound idea - unless "IDE Maven" trumps your desire for "Program Success - THIS Year!"

    Should you have "added your code" to the suggested, "Vendor Provided PROJECT" (ideally one - somewhat close to your needs) - and those errors still land - it is suggested that, "Even a Windows Search" - of all files w/in the current "driverlib" - may  "Pinpoint  the location of "each/every" missing identifier..."

    To best confirm this - return to your older version of Keil - and by  "highlighting" the identifier - you should enable a quick/eased means - to discover,  "Where each resides!"     Armed w/that knowledge - you may  "Search again - this time under the newer Keil version - and determine if that past location - (still) holds "gold."

    [edit]  I've searched both TM4C & LX4F driverlib - and keywords "SYSCTL and GPIOF" fail to appear!      Might they appear under the CMSIS implementation?      Poster must  examine & comment... 

  • here are some examples of using the CMSIS-styled approach in writing code on those devices:

    TM4C123: github.com/.../TM4C_LM4F120
    TM4C129: github.com/.../TM4C129
    LM3S: github.com/.../LM3S

    I think I wrote a set of similarly styled drivers for the MSP432 - the same thing can be done for certain (mostly newer) MSP430 as well.