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: Globally enable/disable interrupts

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hi, all.

I am trying to globally enable/disable interrupts in a new project. As I understand the functions IntMasterEnable() and IntMasterDisable() to the work. I included the file "interrupt.h" contains the prototype of the function defined in "interrupt.c". I also included the file "hw_types.h" as suggested in the Tivaware user's guide. However, I always get the error 

undefined             first referenced
symbol                        in file
---------                  ----------------
IntMasterDisable     ./hello.obj

What additional step should I perform to be able to use these functions? Or, Is there another method to globally enable/disable interrupts?

Thank you.

Thiago.

  • Hello Thiago,

    If that is the error being reported then the file may not have been added correctly, can you post the code you used to add the file?

    Also do you have the full driverlib library linked to your project?

  • Hi, Ralph.

    I included the files using the #include at the top of main.c and also, right clicked the project folder > Build > ARM compiler > Include Options  and added the locations where the files are stored in "Add dir to #include search paths". I Downloaded the tivaware_c_series_2_1_4_178 file, that contains the driverlib and other libraries.

  • Hello Thiago,

    I appreciate the description but I would like you to copy/paste the exact set of #include statements you have at the top of your .c file. I want to review all of them versus my working TivaWare examples.

  • Hello Thiago,

    I haven't heard back from you, so I’m assuming you were able to resolve your issue.

    I will close this thread now, but if you have not solved this issue then post a reply below (or open a new thread if the thread has locked due to time-out).

  • Sorry for the late response.

    These are the the includes:

    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_ints.h"
    #include "inc/hw_types.h"
    #include "driverlib/interrupt.h"

  • Hi,

      Can you show me your linker search path like below? There is also a ready-to-use TivaWare interrupt example under <TivaWare_Installation>/examples/boards/ek-tm4c123gxl/interrupts. Can you try to compile and run this example.See if you have the same compile issue.  If it works, please compare CCS setting between the two and also compare the example code with your code.

  • Hello.

    I currently added the marked line. The error disappeared and the build was finished.

    But now I'm getting the following warnings:

    Would you know what do they mean and how could I eliminate them?

    I tried building and running the example project "interrupts". It works fine. Should I instead of starting a new project from scratch always write my code on top of the example projects?

  • Hello,

      How did you create your project. I will suggest you start with a known working project and build onto it. There are many TivaWare examples that you can use as a start point. Hello.c is one of them. It seems like you have issue with the linker command file. If you start with a TivaWare project you should not have the warnings. 

     You should have a cmd file in your project as follows. Again, just to reiterate, it is always best to start with a known good project such as one of the TivaWare examples. 

    /******************************************************************************
     *
     * hello_ccs.cmd - CCS linker configuration file for hello.
     *
     * Copyright (c) 2011-2017 Texas Instruments Incorporated.  All rights reserved.
     * Software License Agreement
     * 
     * Texas Instruments (TI) is supplying this software for use solely and
     * exclusively on TI's microcontroller products. The software is owned by
     * TI and/or its suppliers, and is protected under applicable copyright
     * laws. You may not combine this software with "viral" open-source
     * software in order to form a larger program.
     * 
     * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
     * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
     * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
     * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
     * DAMAGES, FOR ANY REASON WHATSOEVER.
     * 
     * This is part of revision 2.1.4.178 of the DK-TM4C123G Firmware Package.
     *
     *****************************************************************************/
    
    --retain=g_pfnVectors
    
    /* The following command line options are set as part of the CCS project.    */
    /* If you are building using the command line, or for some reason want to    */
    /* define them here, you can uncomment and modify these lines as needed.     */
    /* If you are using CCS for building, it is probably better to make any such */
    /* modifications in your CCS project and leave this file alone.              */
    /*                                                                           */
    /* --heap_size=0                                                             */
    /* --stack_size=256                                                          */
    /* --library=rtsv7M3_T_le_eabi.lib                                           */
    
    /* The starting address of the application.  Normally the interrupt vectors  */
    /* must be located at the beginning of the application.                      */
    #define APP_BASE 0x00000000
    #define RAM_BASE 0x20000000
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = 0x00040000
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = 0x20000000, length = 0x00008000
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs:   > APP_BASE
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH
    
        .vtable :   > RAM_BASE
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
        .stack  :   > SRAM
    }
    
    __STACK_TOP = __stack + 512;
    

  • Hi.

    Ok. Then I'll follow your suggestions and base my new projects on the example projects provided. Thank you all for your help.

    Thiago.