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.

identifier "SYSCTL_RCGC2 " is undefined

myoled.zipHi,

Im a newbie, I got error as mentioned above in the subject.

I just created a new project.

It seems its looking for a .h file. The code “SYSCTL_RCGC2” seems trying to locate the .h file for its definition but I don’t know how to add/link it. I tried right click on the project and add files to link or copy the .h file which I know where it is located but still same error. I also compared the Property settings from the the sample project “blinky” (which is a sample package/a god running prject) that also used“SYSCTL_RCGC2” and seems the same. Please help me as I need t finish my project in school.

 

Thank you in advance!

CCS5 error.docx

  • Hi,

    From your document the error is "identifier SYSCTL_RCGC2_R is undefined". Copy and paste the rest of your code including #include directives.

    Why do you need to use that system control register? Maybe you can just use a regular variable. What Tiva kit are you using?

    SYSCTL_RCGC2_R can be found at the \\inc\ lm4f232h5qd.h.

    - kel
  • Hi Markel,

    Thanks for the prompt reply.
    I actually copied the code below from the “blinky” sample code of Stellaris.
    I used LM4F232H5QD evauation board.

    .
    .
    volatile unsigned long ulLoop;
    ulLoop = SYSCTL_RCGC2_R;
    .
    .
    .
    for(ulLoop = 0; ulLoop < 200000; ulLoop++)
    {
    }

    I just want to put a delay to my text diplay in the oled and clear it.
    I believe above code is used to put a delay.

    Yes I already find this lm4f232h5qd.h file and tried to copy or link it using “Add Files” by right clicking the project that I made but still doesn’t work.
  • Jerry Maturan said:
    I also compared the Property settings from the the sample project “blinky” (which is a sample package/a god running prject) that also used“SYSCTL_RCGC2” and seems the same.

    Do you mean you get the same error when you simply import and build the example "blinky" project? 

    Can you zip up and attach your project here?

  • @AartiG

    It seems he copied a portion of blinky code and pasted it to another CCS project. I suspect some paths are not setup at CCS that is why he is getting a"identifier SYSCTL_RCGC2_R is undefined" error.

    - kel
  • hi kel, yes you are right. And I don't know where to setup the path as I did not see any difference from my project's Property and the "blinky" project.

    hi aartig, I also edited my question above with the zip file..

    thanks...
  • Jerry Maturan said:
    And I don't know where to setup the path as I did not see any difference from my project's Property and the "blinky" project.

    Your code does not #include several header files that are required. Even from comparing your source file myoled.c with the source file in the blinky example, I noticed that several #includes were missing. 

    As pointed out by Kel, many of these identifiers are defined in lm4f232h5qd.h and although you linked that file to the project, it is not #included in your source file myoled.c.

    I could not immediately build your project because I no longer have the older Stellarisware installed and some of those files/preprocessor defines are different in the newer TivaWare. However, if you make sure you have #included all the necessary header files in your source files, and the paths to all those header files are set up correctly under Compiler Include Path options, then you should be good to go.

  • Hi Aartig,  I run it with no errors now by adding the .h files to #includes. I'm really a newbie. thanks a lot. 

  • thank you kabayan kel for the advice..
  • @Jerry,

    "Verify Answer" AartiG reply to mark this post as "Answered".

    - kel
  • Hi, kel. I want to verify Aasrtig's post but i cannot find the verify button anymore.

  • done verifying..thank you kel and Aartig!