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.

Compiler/EK-TM4C129EXL: #1965 cannot open source file "inc/hw_memmap.h"

Part Number: EK-TM4C129EXL
Other Parts Discussed in Thread: TM4C129ENCPDT

Tool/software: TI C/C++ Compiler

I have tried importing the .c file on C:\ti\TivaWare_C_Series-2.1.3.156\examples\peripherals\ssi.   I have included the header files through Project properties -->  ARM Compiler --> Include options but still i couldn't able to fix the following error. 

 

#1965 cannot open source file "inc/hw_memmap.h"

 

  • Hello Naveen,

    A) Please upgrade to the latest TivaWare, version 2.1.4.178

    B) Please post screenshots of your CCS project properties settings so I can see how you have included the files.
  • Hi Ralph,

              I had installed latest version of Tivaware 2.1.4.178 and tried debugging the code still found some issues with the code.Theses are those errors...

    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_memmap.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/ssi.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"
    
    //*****************************************************************************
    //
    //! \addtogroup ssi_examples_list
    //! <h1>SPI Master (spi_master)</h1>
    //!
    //! This example shows how to configure the SSI0 as SPI Master. The code will
    //! send three characters on the master Tx then polls the receive FIFO until
    //! 3 characters are received on the master Rx.
    //!
    //! This example uses the following peripherals and I/O signals. You must
    //! review these and change as needed for your own board:
    //! - SSI0 peripheral
    //! - GPIO Port A peripheral (for SSI0 pins)
    //! - SSI0Clk - PA2
    //! - SSI0Fss - PA3
    //! - SSI0Rx - PA4
    //! - SSI0Tx - PA5
    //!
    //! The following UART signals are configured only for displaying console
    //! messages for this example. These are not required for operation of SSI0.
    //! - UART0 peripheral
    //! - GPIO Port A peripheral (for UART0 pins)
    //! - UART0RX - PA0
    //! - UART0TX - PA1
    //!
    //! This example uses the following interrupt handlers. To use this example
    //! in your own application you must add these interrupt handlers to your
    //! vector table.
    //! - None.
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    // Number of bytes to send and receive.
    //
    //*****************************************************************************
    #define NUM_SSI_DATA 3
    
    //*****************************************************************************
    //
    // This function sets up UART0 to be used for a console to display information
    // as the example is running.
    //
    //*****************************************************************************
    void
    InitConsole(void)
    {
    //
    // Enable GPIO port A which is used for UART0 pins.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    
    //
    // Configure the pin muxing for UART0 functions on port A0 and A1.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    
    //
    // Enable UART0 so that we can configure the clock.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    
    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
    
    //
    // Select the alternate (UART) function for these pins.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    
    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, 16000000);
    }
    
    //*****************************************************************************
    //
    // Configure SSI0 in master Freescale (SPI) mode. This example will send out
    // 3 bytes of data, then wait for 3 bytes of data to come in. This will all be
    // done using the polling method.
    //
    //*****************************************************************************
    int
    main(void)
    {
    #if defined(TARGET_IS_TM4C129_RA0) || \
    defined(TARGET_IS_TM4C129_RA1) || \
    defined(TARGET_IS_TM4C129_RA2)
    uint32_t ui32SysClock;
    #endif
    
    uint32_t pui32DataTx[NUM_SSI_DATA];
    uint32_t pui32DataRx[NUM_SSI_DATA];
    uint32_t ui32Index;
    
    //
    // Set the clocking to run directly from the external crystal/oscillator.
    // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
    // crystal on your board.
    //
    #if defined(TARGET_IS_TM4C129_RA0) || \
    defined(TARGET_IS_TM4C129_RA1) || \
    defined(TARGET_IS_TM4C129_RA2)
    ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN |
    SYSCTL_USE_OSC), 25000000);
    #else
    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
    SYSCTL_XTAL_16MHZ);
    #endif
    
    //
    // Set up the serial console to use for displaying messages. This is
    // just for this example program and is not needed for SSI operation.
    //
    InitConsole();
    
    //
    // Display the setup on the console.
    //
    UARTprintf("SSI ->\n");
    UARTprintf(" Mode: SPI\n");
    UARTprintf(" Data: 8-bit\n\n");
    
    //
    // The SSI0 peripheral must be enabled for use.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
    
    //
    // For this example SSI0 is used with PortA[5:2]. The actual port and pins
    // used may be different on your part, consult the data sheet for more
    // information. GPIO port A needs to be enabled so these pins can be used.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    
    //
    // Configure the pin muxing for SSI0 functions on port A2, A3, A4, and A5.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinConfigure(GPIO_PA2_SSI0CLK);
    GPIOPinConfigure(GPIO_PA3_SSI0FSS);
    GPIOPinConfigure(GPIO_PA4_SSI0RX);
    GPIOPinConfigure(GPIO_PA5_SSI0TX);
    
    //
    // Configure the GPIO settings for the SSI pins. This function also gives
    // control of these pins to the SSI hardware. Consult the data sheet to
    // see which functions are allocated per pin.
    // The pins are assigned as follows:
    // PA5 - SSI0Tx
    // PA4 - SSI0Rx
    // PA3 - SSI0Fss
    // PA2 - SSI0CLK
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 |
    GPIO_PIN_2);
    
    //
    // Configure and enable the SSI port for SPI master mode. Use SSI0,
    // system clock supply, idle clock level low and active low clock in
    // freescale SPI mode, master mode, 1MHz SSI frequency, and 8-bit data.
    // For SPI mode, you can set the polarity of the SSI clock when the SSI
    // unit is idle. You can also configure what clock edge you want to
    // capture data on. Please reference the datasheet for more information on
    // the different SPI modes.
    //
    #if defined(TARGET_IS_TM4C129_RA0) || \
    defined(TARGET_IS_TM4C129_RA1) || \
    defined(TARGET_IS_TM4C129_RA2)
    SSIConfigSetExpClk(SSI0_BASE, ui32SysClock, SSI_FRF_MOTO_MODE_0,
    SSI_MODE_MASTER, 1000000, 8);
    #else
    SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
    SSI_MODE_MASTER, 1000000, 8);
    #endif
    
    //
    // Enable the SSI0 module.
    //
    SSIEnable(SSI0_BASE);
    
    //
    // Read any residual data from the SSI port. This makes sure the receive
    // FIFOs are empty, so we don't read any unwanted junk. This is done here
    // because the SPI SSI mode is full-duplex, which allows you to send and
    // receive at the same time. The SSIDataGetNonBlocking function returns
    // "true" when data was returned, and "false" when no data was returned.
    // The "non-blocking" function checks if there is any data in the receive
    // FIFO and does not "hang" if there isn't.
    //
    while(SSIDataGetNonBlocking(SSI0_BASE, &pui32DataRx[0]))
    {
    }
    
    //
    // Initialize the data to send.
    //
    pui32DataTx[0] = 's';
    pui32DataTx[1] = 'p';
    pui32DataTx[2] = 'i';
    
    //
    // Display indication that the SSI is transmitting data.
    //
    UARTprintf("Sent:\n ");
    
    //
    // Send 3 bytes of data.
    //
    for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
    {
    //
    // Display the data that SSI is transferring.
    //
    UARTprintf("'%c' ", pui32DataTx[ui32Index]);
    
    //
    // Send the data using the "blocking" put function. This function
    // will wait until there is room in the send FIFO before returning.
    // This allows you to assure that all the data you send makes it into
    // the send FIFO.
    //
    SSIDataPut(SSI0_BASE, pui32DataTx[ui32Index]);
    }
    
    //
    // Wait until SSI0 is done transferring all the data in the transmit FIFO.
    //
    while(SSIBusy(SSI0_BASE))
    {
    }
    
    //
    // Display indication that the SSI is receiving data.
    //
    UARTprintf("\nReceived:\n ");
    
    //
    // Receive 3 bytes of data.
    //
    for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
    {
    //
    // Receive the data using the "blocking" Get function. This function
    // will wait until there is data in the receive FIFO before returning.
    //
    SSIDataGet(SSI0_BASE, &pui32DataRx[ui32Index]);
    
    //
    // Since we are using 8-bit data, mask off the MSB.
    //
    pui32DataRx[ui32Index] &= 0x00FF;
    
    //
    // Display the data that SSI0 received.
    //
    UARTprintf("'%c' ", pui32DataRx[ui32Index]);
    }
    
    //
    // Return no errors
    //
    return(0);
    }
    
    

  • Hello Naveen,

    Ahh, just what I suspected. You are including links to TivaWare folder for "inc", "driverlib", and "utils" but that is not the correct method.

    You should link only the main TivaWare folder.

    The call for #include "inc/hw_memmap.h" is expecting only the main TivaWare folder. That was it goes to C:\ti\TivaWare_C_Series-2.1.4.178 and appends /inc/hw_memmap.h to it, to create the completed directory of C:\ti\TivaWare_C_Series-2.1.4.178/inc/hw_memmap.h

    However, the way you have it setup, it will look for the following and not find it: C:\ti\TivaWare_C_Series-2.1.4.178\inc/inc/hw_memmap.h

    In order words, you need to delete the 3 folder links for TivaWare in the Include Options and replace them with just C:\ti\TivaWare_C_Series-2.1.4.178

    Please make the recommended adjustment and see if your project compiles.
  • Hi Ralph,

           Those  "inc", "driverlib", and "utils" errors were gone but I've got a new error that I couldn't able to fix. The screenshots of that error can be,

  • Greetings,

    Thanks to vendor's Ralph - you are almost there...     The example code you've employed appears intended for a, 'less complex (likely older) vendor MCU' - and 'that fact' - accounts for your current errors.

    Note that file  'pin_map.h'  (properly) contains those pins' definitions.     Those definitions differ - from the ones your (past) code employed.

    File 'pin_map.h' is huge - as it  is charged w/carrying  pin definitions - on an 'individual MCU basis' - for  'ALL TM4C devices.'

    // TM4C129ENCPDT Port/Pin Mapping Definitions

    //*****************************************************************************

    #ifdef PART_TM4C129ENCPDT

    #define GPIO_PA4_U3RX           0x00001001

    #define GPIO_PA4_T2CCP0         0x00001003

    #define GPIO_PA4_I2C7SCL        0x00001002

    #define GPIO_PA4_SSI0XDAT0      0x0000100F            Note the change from your (past)  "GPIO_PA4_SSI0RX"

    and

    #define GPIO_PA5_U3TX           0x00001401

    #define GPIO_PA5_T2CCP1         0x00001403

    #define GPIO_PA5_I2C7SDA        0x00001402

    #define GPIO_PA5_SSI0XDAT1      0x0000140F         Note the change from your (past) "GPIO_PA5_SSI0TX"

    [cb1]   It may be that 'still other'  such 'define conflicts' exist.      This 'deep dive' into 'pin_map.h'  (here, now) should  'arm you' - to 'Slay any  hidden/remaining dragons...'

  • This is the pin_map. h file,

    Removed due to excessive size

    Here Pinmapping remains the same. 

  • Hello Naveen,

    I removed your pin_map.h copy paste, it's over 10k lines, way too long for E2E.

    Now then, what cb1 says is exactly correct.

    The GPIO_PA4_SSI0RX and GPIO_PA5_SSI0TX definitions are for TM4C123x processors

    The GPIO_PA4_SSI0XDAT0 and GPIO_PA5_SSI0XDAT1 definitions are for the TM4C129x processors you are using.

    If you go through your pin_map.h file searching for both sets of definitions, you'll see this for yourself.

    That example was developed on TM4C123x processors.

    I will record the mismatch for 129x as a bug so we can look into adding ifdefs to avoid confusion in the future.
  • Oh Ralph ... I so wanted to click 'LIKE' w/in poster's 'pin_map.h' file presentation.
    Although - most here would (notably) age - scrolling to the bitter end - of that enormous file!

    Note that I (tried) to guide this poster to the necessity of  'scrolling to HIS MCU - w/in pin_map.h!'      It is uncertain - 'if he employed that discipline!'    Note that the 'likelihood of his past code being 'aimed' at an 'older and/or less capable MCU - was also explained.    (w/in my post ... and  followed/amplified w/in yours.)    

    I don't know how one could improve upon my:

    // TM4C129ENCPDT Port/Pin Mapping Definitions

    #ifdef PART_TM4C129ENCPDT

    #define GPIO_PA4_U3RX           0x00001001

    #define GPIO_PA4_SSI0XDAT0      0x0000100F            Note the change from your (past)  "GPIO_PA4_SSI0RX"

    Color Coding - Bolding - Detailed Explanation - seem NOT to have captured his attention...

    Clearly a 'giant GREEN' is yours - and a small one - should arrive my 'LIKED" doorstep...

  • I think the only detail missing was acknowledging that the #define changed from 123x to the 129x that he is using, beyond that your presentation was suburb and that is why I selected only your post for the yellow click I can doll out as a suggestion to customers.
  • 'Be STILL'  (yet not too still)  - my 'detail obsessed' heart!      ('mocking'  by unruly (yet) 'crack' staff  -  even after the award of  'superb'  - unlikely to dim anytime soon...)

  •  Hi cb1_mobile and Ralph ,

                 I had made those corrections as you mentioned above, pin_map issue is fixed as of now but I have got new error i don't have any idea abut that error.

  • 'SPI_Test' is your apparent project's name - (took awhile - but I 'got that.')     

    Those 3 'newest' errors - as reported by this IDE - are not especially helpful - are they?     Do these  newest 3 errors appear anywhere else -  with  (some)  usable detail?

    Firm/I employ the 'PRO IDE - IAR' - so I've zero  'use for and/or experience'  w/vendor-only offering...

  • Hello Naveen,

    Those errors aren't descriptive enough for me to understand what is going on wrong too. Though my guess would be you have overlapping files like two *_ccs.c files or two .cmd files etc.