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.

Tiva C Series EK-TM4C123GXL

Other Parts Discussed in Thread: EK-TM4C123GXL, TM4C123GH6PM
Hello.
I am a beginner in ARM microcontrollers programming.
With two months ago I have bought Mr. Jonathan W. Valvano books : Embedded Systems (Introduction to ARM Cortex-M Microcontrollers, Real-Time Interfacing to ARM Cortex Microcontrollers, Real-Time Operating Systems for ARM Cortex-M Microcontrollers). I have bought also Tiva C Series Launch Pad EK-TM4C123GXL. 
On youtube I have seen some tutorials about this development board posted by Miro Samek (http://www.youtube.com/watch?v=3V9eqvkMzHA&list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM).
In this tutorials the programs are developed using IAR Embedded Workbench. So I have followed this tutorials making the same steps like Mr. Miro Samek. The board is ok, the programs are well, but in Lesson 5 : Preprocessor and volatile when Mr. Miro Samek add a header file to the project namely "lm4f120h5qr.h" (see the attache file_1 and file_2),  in my case this header file doesn't exist (see the attache file_3 and file_4).
I have tried this project in Code Composer Studio and I receive the same error (see the attache file_5). 
This header file contain all the adress of all processor registers (see the attache file_6). 
Please, can you give me some advices ?
Thank you.
With respect Mircea.
  • Hi Dragu,

        The lm4f120h5qr.h file does not exist in your Tivaware folders, because your Tivaware is for the Tiva version of the launchpad.

        lm4f120h5qr.h file can only be found at the Tivaware \\inc folder of the LM4F version of the launchpad. What you will find instead at your \\inc folder is tm4c123gh6pm.h, which contains all the address of the processor registers.

       What you can do with regards to Mr. Samek Lesson 5 is add

        #include "tm4c123gh6pm.h"

        instead of 

        #include "lm4f120h5qr.h"

    -kel

  • Hi Markel Robregado.

    Ok, I tried to add    #include "tm4c123gh6pm.h",  but I receive the next error :  

    "../main.c", line 4: fatal error #1965: cannot open source file "tm4c123gh6pm.h".

    I think this is happened because this file doesn't exist, but I dont understand why, because this file "came" with the installation of CCS.

  • Hi Dragu,

        Where in your folders is "tm4c123gh6pm.h" file?

         In my Tivaware for Tiva Launchpad it is at \\EK-TM4C123GXL-KEIL-753\inc\tm4c123gh6pm.h. If you have the file in that similar location try this line below instead. 

         #include "inc/tm4c123gh6pm.h"

        I don't have CCS installed at my PC. So, I can't properly advice you regarding that. 

    -kel

  • Thank you for your help.

    This is the path where is the header file : \ti\TivaWare_C_Series-2.0.1.11577\inc\tm4c123gh6pm.

    If I include this file in this way : #include "\ti\TivaWare_C_Series-2.0.1.11577\inc\tm4c123gh6pm.h", when I compile

    I receive the folowing errors, see attache file.  

  • Hi Dragu,

    You can look at the examples like in the path

    \ti\TivaWare_C_Series-2.0.1.11577\examples\peripherals\

    There are more headers to be included. You can use one of the tests as a starting template

    Amit

  • Hi Dragu,

         If you check at your tm4c123gh6pm.h, there is no SYSTCTL_RCGCGPIO_R. That is why you are getting "SYSTCTL_RCGCGPIO_R is undefined error".

         The correct declaration is

          SYSCTL_RCGCGPIO_R = 0x20;

         You are getting the "uint32_t" is undefined error because your are adding "u" prefix at the end of your HEX value. Like below.

          0x20u

         If you remove all the "u" prefix, the error will probably go away.

         or you can declare PART_TM4C123GH6PM at your preprocesor defines at your project options. That uint32_t is probably dependent on that preprocessor define.  You, can see how that is set at the blinky example program project options.

    @Amit

         What, he is trying to do is from the youtube link below. Starts at 12:20.

         http://www.youtube.com/watch?v=5MzilJ2-MGY&list=SPPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM&index=6

    -kel

  • Hi everybody.

    First of all thank you all for your support. Finally the problem is resolved.

    First solution : i have replaced the data type uint32_t with unsigned long (see attache file_1).

    Second solution is to replace the data type uint32_t with unsigned long in the header file tm4c123gh6pm.h (see attache file_2 and file_3).

  • Hi,

    While this could solve temporarily your issues, this is not recommended practice. It is better to insert this declaration at the beginning of the file, before anything else:

    #include <stdbool.h> 

    #include <stdio.h> 

    since there are declared all types used.

    Another recommendation is to go to Tiva/examples/boards/and read/examine/understand the examples presented.

    Petrei

    Edit:if you use IAR, check the IAR system files to see where types are declared, what i suggested  refers to CCS.

  • @Petrei,

    Dragu, is making his code work base from this youtube link below. The part starts at 12:20. That, is why he is just using this #include below. I verified and what he needs to include in his c file  is stdint.h.

    #include "\ti\TivaWare_C_Series-2.0.1.11577\inc\tm4c123gh6pm.h"

    http://www.youtube.com/watch?v=5MzilJ2-MGY&list=SPPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM&index=6

    @Dragu,

    I think I am wrong with my earlier advice with regards to uint32_t. Replacing uint32_t with unsigned long at tm4c123gh6pm.h is wrong practice.

    Do this below steps.

    1. Put back the uint32_t in place of unsigned long at tm4c123gh6pm.h
    2. At your C file add these two #include below.

    #include <stdint.h>
    #include "inc/tm4c123gh6pm.h"

    uint32_t is declared at stdint.h

    Take a look into the blinky example program at "\\examples\boards\ek-tm4c123gxl\blinky", It is similar to what you are trying to do. 

    Again, I don't have CCS installed at my PC. I am using Keil Uvision to check blinky example program to give you advice.

    Also, at the youtube tutorial Mr. Samek is using 

     #include "lm4f120h5qr.h" 

    at the lm4f120h5qr.h file unsigned long is used instead of uint32_t. See below. 

    #define WATCHDOG0_LOAD_R        (*((volatile unsigned long *)0x40000000))

    That is why he does not need to include in his C file this #include below

     #include <stdint.h>

    -kel

  • Hi,

    Since the Tiva 2.x is used, it is wise to include both lines specified because you don't know what peripherals/functions are used - ( at least does not harm) which will require boolean definitions also. 

    One problem with the path: this one must be specified in compiler's include path properties:

     \ti\TivaWare_C_Series-2.0.1.11577 

    and then all other includes will be as designed by TI ( i.e. #include "inc/hw_xxx.h" or similar).

    Petrei

     

  • hi, i have a question,I'm currently working with Tiva C , when i put #include "inc/tm4c123gh6pm.h" i have a mistake, i checked out the file where is all project but i didn't found neither "inc/tm4c123gh6pm.h" nor "tm4c123gh6pm.h", how do I get to built this project?, can you explain me about "inc/tm4c123gh6pm.h" file? How do i conect "inc/tm4c123gh6pm.h" file with my main.c program?