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 undefined error

Other Parts Discussed in Thread: TM4C123GH6PZ, TM4C123GH6PM

Hi

Details :

Controller : TM4C123GH6PZ

CCS IDE :  Version: 5.4.0.00091

Compiler : TI v5.0.4  

TivaWare_C_Series-2.0.1.11577

The Issue:

 I am getting these errors when I compile my code: ' #20 identifier "xxxxxxx" is undefined '

It is defined in hw_inits.h

What is causing this error ?

Also i am getting 400+ warnings that particular definition is redefined and does not match.

One definition is in the hw-inits.h and the other is in controller specific header file. i cannot remove either of them,

How can I resolve ?

Please Help

 

  • I have a valid question here:

    Does that error have anything to do with code being ported from STELLARIS to TIVA ?

  • This almost certainly some error in configuring your TivaWare code.  I'll move this thread to the Tiva forum.

    Thanks and regards

    -George

  • George Mock said:

    This almost certainly some error in configuring your TivaWare code.  I'll move this thread to the Tiva forum.

    Thanks and regards

    -George

    Thank you George.

    i commented out the following lines of code :

    //Disable PORTG Peripheral interrupt
    IntDisable(INT_GPIOG);

    IntDisable(INT_GPIOE);

    The above lines removed 2 errors (they were working just fine in Stellaris, i thought may be TIVA doesnt use this method to disable them)

    I am hoping this function does that : GPIOIntDisable();

     

    Only one error remains related to the following line:

    // clear any pending NVIC interrupts

    NVIC_UNPEND0_R = TIMER2_IRQ;

    This line was written to clear some NVIC interrupts( i am not very sure WHAT and WHY), is there some equivalent API for TIVA.

  • Hi Feroze,

         Are you using Tiva Launchpad?

         I suspect, this error is caused by not properly setting Preprocessor Symbols. Here below is what I have from one of the example programs for Tiva Launchpad.

         PART_TM4C123GH6PM TARGET_IS_BLIZZARD_RB1

    -kel

  • Yes i have TIVA Development Board.

    My controller is TM4C123GH6PZ. 

    I removed the hw_ints.h from my project, as the controller header seem to have all definitions, so all warnings are gone.

    Only issues are:

    1. can i remove this IntDisable(INT_GPIOE) (Stellaris Code), if i use this : GPIOIntDisable(PORT,PIN); 

    2. How to resolve the error related to this:

    NVIC_UNPEND0_R = TIMER2_IRQ; // clear any pending NVIC interrupts (Stellaris Code)

     Error :  #20 identifier "NVIC_EN0_INT24" is undefined

    Obviously i didnt understand the code so i could solve it. I took over this project 2 days back and is filled with errors, so i wanted to get rid of the bugs and then understand the code.

    NVIC_EN0_INT24 is defined in the header file 'hw_nvic.h' 

    but this header is available only in demo codes in this path :

    C:\ti\TivaWare_C_Series-2.0.1.11577\third_party\FreeRTOS\Demo\

  • Hi Feroze,

    Is your code originally made for Tiva Development Board? Because, you mentioned "Stellaris Code".

    Feroze Mohamed said:
    1. can i remove this IntDisable(INT_GPIOE) (Stellaris Code), if i use this : GPIOIntDisable(PORT,PIN); 

    I don't see any IntDisable at the Tivaware Peripheral Driver Library Users Guide. I think you can replace that with GPIOIntDisable.

    Feroze Mohamed said:

    NVIC_UNPEND0_R = TIMER2_IRQ; // clear any pending NVIC interrupts (Stellaris Code)

     Error :  #20 identifier "NVIC_EN0_INT24" is undefined

    I don't have this at my Tivaware 1.0. hw_nvic is located at my "\\EK-TM4C123GXL-KEIL-753\inc"

    See, this app note below. 

    Migrating Software Projects from Stellarisware to Tivaware

    -kel

  • I have both TivaWare 1.0 and 2.0, I am currently using v2.0 for the project.

    Following is the search result of the file:

  • Markel Robregado said:

    I don't have this at my Tivaware 1.0. hw_nvic is located at my "\\EK-TM4C123GXL-KEIL-753\inc"

    -kel

    But that path is board specific, and i am writing the code for project that does not use the Eval Board, so i need to have common header file.

  • Hi Feroze,

    From your search results, the files seems to be for LM3S - "Stellaris".

    BTW, I found this API at interrupt.c. See, if using that instead, helps. See, details at the Tivaware Peripheral Driver Library User's Guide

    void IntPendClear(uint32_t ui32Interrupt)

    -kel

  • Markel Robregado said:

    Hi Feroze,

    From your search results, the files seems to be for LM3S - "Stellaris".

    BTW, I found this API at interrupt.c. See, if using that instead, helps. See, details at the Tivaware Peripheral Driver Library User's Guide

    void IntPendClear(uint32_t ui32Interrupt)

    -kel

    Thank you, seems to be the API i needed.

    In the stellaris code, its register level handling of NVIC_EN0 register interrupt 24.

    TIVA also has the same register but NVIC_EN0_INT24 this definition is not there in the TIVA headers.

    How can i use the above mentioned API to unpend the interrupt 24 ?

  • Feroze Mohamed said:

    TIVA also has the same register but NVIC_EN0_INT24 this definition is not there in the TIVA headers.

    How can i use the above mentioned API to unpend the interrupt 24 ?

    I am not familiar with NVIC_EN0_INT24. I will dig deeper when I am a little bit free.

    From your reply earlier, your are trying to clear the pending interrupt for timer. You, can use the C API as below.

    IntPendClear(INT_TIMER2A);

    -kel

  • Thank you very much, i wanted this : 'INT_TIMER2A