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.

Problem while compiling with a customized header

Other Parts Discussed in Thread: TM4C123GH6PM

Dear all,

 I was trying to configure and initialize ILI9341 display controller with 240 X 320 Pixels of Color TFT display using the TM4C123 and the program has worked perfect. However, after checking a sample prototype software, I tried to create individual header called LCD2_2SPI.h and an associated c file named: LCD2_2SPI.c . After doing this, I have included the header file in the main program given below:

Now the problem is that, when the functions TivaInit(); Lcd_Init(); LCD_Clear(BLACK); (highlighted below in light blue) was directly defined inside this main.c file, there were no compilation error. However, when I created a header and shifted the definitions and declared the functions in the header and defined them in LCD2_2SPI.c , there are errors coming (compilation errors) saying: #10234-D unresolved symbols remain in these three functions. The Problems window is screenshot below:

 

 

Please help as to what might be going wrong. I have tried a lot checking everything. I am using TivaWare_C_Series-2.1.1.71 and the configurations in CCS project and libraries are fine. The project runs successfully when the functions are defined in main.c and declared in main.c But errors show up when moved to the header LCD2_2SPI.h and an associated c file named: LCD2_2SPI.c  

 

 

SOFTWARE:

// Include Files
#include <stdint.h>
#include <stdbool.h>

#include "driverlib/LCD2_2SPI.h"   // (this was created later on after checking everything in this main file)
#include "driverlib/ssi.h"
#include "driverlib/gpio.h"
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "driverlib/interrupt.h"
#include "inc/hw_gpio.h"

 


//Constants //

//const unsigned int black = 0;
//const unsigned int Red = 63488;
//const unsigned int Green = 2016;
//const unsigned int Blue = 31;
//const unsigned int White = 65535;
//const unsigned int Purple = 61727;
//const unsigned int Yellow = 65504;
//const unsigned int Cyan = 2047;
//const unsigned int d_gray = 21130;
//const unsigned int l_gray = 31727;
//

//Definitions //
unsigned int BACK_COLOR, POINT_COLOR; //Background color, brush color

////////////////// Interrupt Dummy ///////////////////////////////////////////////////////////////
void UartIntHandler(void)
{

}
void Uart2IntHandler(void)
{

}
/////////////////////// Fns //////////////////////////////////////////////////////////////////////


////////////////// Main Routine ////////////////////////////////////////////////////////////////////
void main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_2 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
SysFreq = SysCtlClockGet();


TivaInit();
Lcd_Init();
LCD_Clear(BLACK);
BACK_COLOR=BLUE;
POINT_COLOR=WHITE;

// LCD_ShowString(10,10,TEST);//LCD_ShowString(u16 x,u16 y,const u8 *p)
// Draw_Circle(100,100,50);
// LCD_ShowNum(100,100,123,5);//LCD_Show2Num(u16 x,u16 y,u16 num,u8 len)
// LCD_Show2Num(100,200,123,5);//LCD_Show2Num(u16 x,u16 y,u16 num,u8 len)
// LCD_DrawRectangle(1,1,240,30);//LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2)
// LCD_Fill(0,0,240,30,WHITE);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
// LCD_Fill(1,1,239,29,YELLOW);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
// LCD_Fill(2,2,238,28,CYAN);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
// LCD_Fill(3,3,237,27,BLUE);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
//
// LCD_Fill(180,11,183,27,WHITE);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
// LCD_Fill(185,14,188,27,WHITE);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
// LCD_Fill(190,17,193,27,WHITE);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
// LCD_Fill(195,20,198,27,WHITE);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)
// LCD_Fill(200,23,203,27,WHITE);//LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color)

while(1)
{
// u16 circx=120,circy=0;
// LCD_ShowString(220,4,"R");
// SysCtlDelay(SysFreq);
// LCD_ShowString(220,4," ");
// SysCtlDelay(SysFreq);


// while(circy<321)
// {
// POINT_COLOR=WHITE;
// Draw_Circle(circx,circy,50);//Draw_Circle(u16 x0,u16 y0,u8 r)
// POINT_COLOR=BLACK;
// Draw_Circle(circx,circy,50);//Draw_Circle(u16 x0,u16 y0,u8 r)
// circy++;
// }

}

}

_______________________________________________________________________________________________________________________________ 

THE HEADER FILE LCD2_2SPI.h:

#include <stdint.h>
#include <stdbool.h>

#ifndef __LCD_H
#define __LCD_H


// Define the size of the LCD
#define LCD_W 240
#define LCD_H 320


#define AllPins GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
#define TFTControlPins GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
#define TFTReset GPIO_PIN_4
#define LPLEDs GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
#define u8 unsigned char
#define u16 unsigned int
#define u32 unsigned long
#define MSB GPIO_PORTB_BASE
#define LSB GPIO_PORTD_BASE
// SSI RELATED DEFINITIONS, ONLY FOR 2.2" LCD //
#define SCK GPIO_PIN_2//PORT A, SSI 0 ONLY
#define CS GPIO_PIN_3
#define MISO GPIO_PIN_4
#define MOSI GPIO_PIN_5
#define DC GPIO_PIN_4// PORT E
#define RESET GPIO_PIN_5// PORT E


#define LCD_RS GPIO_PIN_4
#define LCD_WR GPIO_PIN_5
#define LCD_RD GPIO_PIN_6
#define LCD_CS GPIO_PIN_7
#define LCD_REST GPIO_PIN_4

// Temporary values
u16 temp=0x0000;
u8 TEST[]="Hello! This is a testing routine that displays the data on the LCD";

// Defined Arrays //
//unsigned char symbol[];
//unsigned char asc2_1608[1520];
u8 symbol[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xFE,0xFF,0x01,0x00,0xFE,0xFF,0x01,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0xFE,0xFF,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0xFE,0xFF,0x00,0x00,0x06,0xC0,0x00,0x00,0x06,0xC0,0x00,0x00,0x02,0x00,0x00,0x30,0x30,0x0C,0x1C,0xF0,0x7F,0xFC,0x3F,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0xF0,0x3F,0xFC,0x1F,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0x30,0x30,0x0C,0x1C,0xF0,0x3F,0xFC,0x1F,0xF0,0x3F,0xFC,0x1F,0x30,0x30,0x0C,0x1C,0x30,0x10,0x04,0x0C,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x08,0x08,0xC0,0xF1,0xFF,0x1F,0xC0,0xF0,0xFF,0x1F,0xC0,0x48,0x4C,0x1C,0xC4,0xDC,0xCC,0x1D,0xCC,0xDC,0x8D,0x1D,0xDC,0x8E,0x8D,0x1D,0xD8,0x06,0x0E,0x1F,0xF8,0xC3,0xEF,0x1D,0xF8,0xF1,0xEC,0x1C,0xD0,0x60,0x1D,0x1C,0xC0,0x1C,0x77,0x0C,0xFE,0x9F,0xE7,0x00,0x34,0x83,0xE3,0x0C,0x30,0xC3,0xFF,0x1F,0x30,0xC3,0x61,0x00,0x30,0xE3,0x61,0x00,0x30,0xE3,0x61,0x06,0x30,0xF3,0xFF,0x0F,0x30,0xDB,0x61,0x00,0x30,0xFB,0x61,0x04,0x38,0xDB,0x61,0x0E,0x18,0xCF,0xFF,0x0F,0x18,0xC7,0x61,0x00,0x98,0xC7,0x61,0x00,0x0C,0xC3,0x61,0x38,0x04,0xC2,0xFF,0x3F,0x06,0xC0,0x01,0x00,0x02,0xC0,0x01,0x00,0x00,0x00,0x00,0x00,
};
u8 asc2_1608[1520]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
0x00,0x48,0x6C,0x24,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x24,0x24,0x24,0x7F,0x12,0x12,0x12,0x7F,0x12,0x12,0x12,0x00,0x00,
0x00,0x00,0x08,0x1C,0x2A,0x2A,0x0A,0x0C,0x18,0x28,0x28,0x2A,0x2A,0x1C,0x08,0x08,
0x00,0x00,0x00,0x22,0x25,0x15,0x15,0x15,0x2A,0x58,0x54,0x54,0x54,0x22,0x00,0x00,
0x00,0x00,0x00,0x0C,0x12,0x12,0x12,0x0A,0x76,0x25,0x29,0x11,0x91,0x6E,0x00,0x00,
0x00,0x06,0x06,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x40,0x20,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x20,0x40,0x00,
0x00,0x02,0x04,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00,
0x00,0x00,0x00,0x00,0x08,0x08,0x6B,0x1C,0x1C,0x6B,0x08,0x08,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x7F,0x08,0x08,0x08,0x08,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x04,0x03,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x00,0x00,
0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x00,
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
0x00,0x00,0x00,0x08,0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x20,0x20,0x10,0x08,0x04,0x42,0x7E,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x20,0x18,0x20,0x40,0x40,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x20,0x30,0x28,0x24,0x24,0x22,0x22,0x7E,0x20,0x20,0x78,0x00,0x00,
0x00,0x00,0x00,0x7E,0x02,0x02,0x02,0x1A,0x26,0x40,0x40,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x38,0x24,0x02,0x02,0x1A,0x26,0x42,0x42,0x42,0x24,0x18,0x00,0x00,
0x00,0x00,0x00,0x7E,0x22,0x22,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x24,0x18,0x24,0x42,0x42,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0x18,0x24,0x42,0x42,0x42,0x64,0x58,0x40,0x40,0x24,0x1C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x04,
0x00,0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x20,0x40,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x40,0x20,0x10,0x08,0x04,0x02,0x00,0x00,
0x00,0x00,0x00,0x3C,0x42,0x42,0x46,0x40,0x20,0x10,0x10,0x00,0x18,0x18,0x00,0x00,
0x00,0x00,0x00,0x1C,0x22,0x5A,0x55,0x55,0x55,0x55,0x2D,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x08,0x08,0x18,0x14,0x14,0x24,0x3C,0x22,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x1E,0x22,0x42,0x42,0x42,0x22,0x1F,0x00,0x00,
0x00,0x00,0x00,0x7C,0x42,0x42,0x01,0x01,0x01,0x01,0x01,0x42,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x1F,0x22,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1F,0x00,0x00,
0x00,0x00,0x00,0x3F,0x42,0x12,0x12,0x1E,0x12,0x12,0x02,0x42,0x42,0x3F,0x00,0x00,
0x00,0x00,0x00,0x3F,0x42,0x12,0x12,0x1E,0x12,0x12,0x02,0x02,0x02,0x07,0x00,0x00,
0x00,0x00,0x00,0x3C,0x22,0x22,0x01,0x01,0x01,0x71,0x21,0x22,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x7E,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x3E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x11,0x0F,
0x00,0x00,0x00,0x77,0x22,0x12,0x0A,0x0E,0x0A,0x12,0x12,0x22,0x22,0x77,0x00,0x00,
0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x42,0x7F,0x00,0x00,
0x00,0x00,0x00,0x77,0x36,0x36,0x36,0x36,0x2A,0x2A,0x2A,0x2A,0x2A,0x6B,0x00,0x00,
0x00,0x00,0x00,0xE3,0x46,0x46,0x4A,0x4A,0x52,0x52,0x52,0x62,0x62,0x47,0x00,0x00,
0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x22,0x1C,0x00,0x00,
0x00,0x00,0x00,0x3F,0x42,0x42,0x42,0x42,0x3E,0x02,0x02,0x02,0x02,0x07,0x00,0x00,
0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x4D,0x53,0x32,0x1C,0x60,0x00,
0x00,0x00,0x00,0x3F,0x42,0x42,0x42,0x3E,0x12,0x12,0x22,0x22,0x42,0xC7,0x00,0x00,
0x00,0x00,0x00,0x7C,0x42,0x42,0x02,0x04,0x18,0x20,0x40,0x42,0x42,0x3E,0x00,0x00,
0x00,0x00,0x00,0x7F,0x49,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x42,0x22,0x24,0x24,0x14,0x14,0x18,0x08,0x08,0x00,0x00,
0x00,0x00,0x00,0x6B,0x49,0x49,0x49,0x49,0x55,0x55,0x36,0x22,0x22,0x22,0x00,0x00,
0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x77,0x22,0x22,0x14,0x14,0x08,0x08,0x08,0x08,0x08,0x1C,0x00,0x00,
0x00,0x00,0x00,0x7E,0x21,0x20,0x10,0x10,0x08,0x04,0x04,0x42,0x42,0x3F,0x00,0x00,
0x00,0x78,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x78,0x00,
0x00,0x00,0x02,0x02,0x04,0x04,0x08,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x40,0x40,
0x00,0x1E,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1E,0x00,
0x00,0x38,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
0x00,0x06,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x78,0x44,0x42,0x42,0xFC,0x00,0x00,
0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x1A,0x26,0x42,0x42,0x42,0x26,0x1A,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x44,0x02,0x02,0x02,0x44,0x38,0x00,0x00,
0x00,0x00,0x00,0x60,0x40,0x40,0x40,0x78,0x44,0x42,0x42,0x42,0x64,0xD8,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x7E,0x02,0x02,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0xF0,0x88,0x08,0x08,0x7E,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x22,0x22,0x1C,0x02,0x3C,0x42,0x42,0x3C,
0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x3A,0x46,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x1E,
0x00,0x00,0x00,0x03,0x02,0x02,0x02,0x72,0x12,0x0A,0x16,0x12,0x22,0x77,0x00,0x00,
0x00,0x00,0x00,0x0E,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x92,0x92,0x92,0x92,0x92,0xB7,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x46,0x42,0x42,0x42,0x42,0xE7,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x26,0x42,0x42,0x42,0x22,0x1E,0x02,0x07,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x44,0x42,0x42,0x42,0x44,0x78,0x40,0xE0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x4C,0x04,0x04,0x04,0x04,0x1F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x42,0x02,0x3C,0x40,0x42,0x3E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x3E,0x08,0x08,0x08,0x08,0x08,0x30,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x42,0x42,0x42,0x42,0x62,0xDC,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x14,0x08,0x08,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEB,0x49,0x49,0x55,0x55,0x22,0x22,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0x24,0x18,0x18,0x18,0x24,0x6E,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE7,0x42,0x24,0x24,0x14,0x18,0x08,0x08,0x07,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x22,0x10,0x08,0x08,0x44,0x7E,0x00,0x00,
0x00,0xC0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0x20,0x20,0xC0,0x00,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x00,0x06,0x08,0x08,0x08,0x08,0x08,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x06,0x00,
0x0C,0x32,0xC2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
// Variables //
uint32_t SysFreq;
int32_t LCD_READ, read_data=0;
unsigned char bitdata;
uint32_t reply[];
static u16 kkk=1 , kkkbk=0;


extern u16 BACK_COLOR, POINT_COLOR;

extern void TivaInit(void);
extern void Lcd_Init(void);
extern void LCD_Clear(u16 Color);
extern void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2);
extern void LCD_WR_DATA8(char da);
extern void LCD_WR_DATA(int da);
extern void LCD_WR_REG(char da);

extern void LCD_DrawPoint(u16 x,u16 y);
extern void LCD_DrawPoint_big(u16 x,u16 y);
u16 LCD_ReadPoint(u16 x,u16 y);
extern void Draw_Circle(u16 x0,u16 y0,u8 r);
extern void LCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2);
extern void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2);
extern void LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color);
extern void LCD_ShowChar(u16 x,u16 y,u8 num,u8 mode);
extern void LCD_ShowNum(u16 x,u16 y,u32 num,u8 len);
extern void LCD_Show2Num(u16 x,u16 y,u16 num,u8 len);
extern void LCD_ShowString(u16 x,u16 y,const u8 *p);

//Pen color
#define WHITE 0xFFFF
#define BLACK 0x0000
#define BLUE 0x001F
#define BRED 0XF81F
#define GRED 0XFFE0
#define GBLUE 0X07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define GREEN 0x07E0
#define CYAN 0x7FFF
#define YELLOW 0xFFE0
#define BROWN 0XBC40 //Brown
#define BRRED 0XFC07 //Brownish red
#define GRAY 0X8430 //Gray
//GUI Color

#define DARKBLUE 0X01CF //Navy blue
#define LIGHTBLUE 0X7D7C //Light Blue
#define GRAYBLUE 0X5458 //Gray-blue
// More than three colors for color PANEL

#define LIGHTGREEN 0X841F //Light green
#define LGRAY 0XC618 //Light gray (PANNEL), form the background color

#define LGRAYBLUE 0XA651 //Light gray blue (intermediate layer color)
#define LBBLUE 0X2B12 //Blue light brown (select entry inverse)

#endif

____________________________________________________________________________________________________________

 THE LCD2_2SPI.c :

#include <stdint.h>
#include <stdbool.h>

#include "driverlib/ssi.h"
#include "driverlib/gpio.h"
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "driverlib/interrupt.h"
#include "driverlib/LCD2_2SPI.h"
#include "inc/hw_gpio.h"

void LCD_Writ_Bus(char da) //Parallel Data Write function
{
bitdata=da;
/* LCD_SDI=bit7;LCD_SCK=0;LCD_SCK=1;
LCD_SDI=bit6;LCD_SCK=0;LCD_SCK=1;
LCD_SDI=bit5;LCD_SCK=0;LCD_SCK=1;
LCD_SDI=bit4;LCD_SCK=0;LCD_SCK=1;
LCD_SDI=bit3;LCD_SCK=0;LCD_SCK=1;
LCD_SDI=bit2;LCD_SCK=0;LCD_SCK=1;
LCD_SDI=bit1;LCD_SCK=0;LCD_SCK=1;
LCD_SDI=bit0;LCD_SCK=0;LCD_SCK=1;
*/
SSIDataPut(SSI0_BASE,bitdata);
while(SSIBusy(SSI0_BASE));

}
void LCD_WR_DATA8_SSI(char da) //Send -8 bit parameter data // CONVERTED TO CCS
{
//DC=1;
GPIOPinWrite(GPIO_PORTE_BASE, DC,0x10); //Pulses the dc line
LCD_Writ_Bus(da);
}
void LCD_WR_DATA(int da) // CONVERTED TO CCS
{
//DC=1;
GPIOPinWrite(GPIO_PORTE_BASE, DC,0x10); //Pulses the dc line
LCD_Writ_Bus(da>>8);
LCD_Writ_Bus(da);
}
void LCD_WR_REG(int da) // CONVERTED TO CCS
{
//DC=0;
GPIOPinWrite(GPIO_PORTE_BASE, DC,0); //Pulses the WR line
LCD_Writ_Bus(da);
}
// void LCD_WR_REG_DATA(int reg,int da) // CONVERTED TO CCS
//{
// LCD_WR_REG(reg);
// LCD_WR_DATA(da);
//}
void Address_set(unsigned int x1,unsigned int y1,unsigned int x2,unsigned int y2) // CONVERTED TO CCS
{
LCD_WR_REG(0x2a);
LCD_WR_DATA8_SSI(x1>>8);
LCD_WR_DATA8_SSI(x1);
LCD_WR_DATA8_SSI(x2>>8);
LCD_WR_DATA8_SSI(x2);

LCD_WR_REG(0x2b);
LCD_WR_DATA8_SSI(y1>>8);
LCD_WR_DATA8_SSI(y1);
LCD_WR_DATA8_SSI(y2>>8);
LCD_WR_DATA8_SSI(y2);

LCD_WR_REG(0x2C);
}
///////////////////////////newly imported///////////////////////////////
// void Write_Command(unsigned int Wcommand)
// {
//// TFT_RD = 1;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_RD,LCD_RD);
//// TFT_RS = 0;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_RS,LCD_RS);
//// TFT_DP_Hi = wcommand >> 8;
// GPIOPinWrite(MSB, AllPins,(Wcommand >>8));
//// TFT_DP_Lo = wcommand ;
// GPIOPinWrite(LSB, AllPins,Wcommand);
// // TFT_WR = 0;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_WR,0);
// // TFT_WR = 1 ;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_WR,LCD_WR);
// }
//
// void Write_Data(unsigned int Wdata)
// {
//// TFT_RD = 1;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_RD,LCD_RD);
//// TFT_RS = 1 ;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_RS,LCD_RS);
//// TFT_DP_Hi = Wdata >>8 ;
// GPIOPinWrite(MSB, AllPins,(Wdata >>8));
//// TFT_DP_Lo = wdata;
// GPIOPinWrite(LSB, AllPins,Wdata);
//// TFT_WR = 0;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_WR,0);
//// TFT_WR = 1 ;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_WR,LCD_WR);
//
// }
// void Write_Command_Data(unsigned int Wcommand,unsigned int Wdata)
// {
// Write_Command(Wcommand);
// Write_Data(Wdata);
// }
void Lcd_Init(void)
{
GPIOPinWrite(GPIO_PORTA_BASE, CS,CS);
//TFT_RST=1;
GPIOPinWrite(GPIO_PORTE_BASE, RESET,0x20);
//delay_ms(5);
SysCtlDelay(SysFreq/2);// 5 ms delay
//TFT_RST=0;
GPIOPinWrite(GPIO_PORTE_BASE, RESET,0);
//delay_ms(15);
SysCtlDelay(SysFreq/2);// 15 ms delay
//TFT_RST=1;
GPIOPinWrite(GPIO_PORTE_BASE, RESET,0x20);
//delay_ms(15);
SysCtlDelay(SysFreq/2);// 15 ms delay
//TFT_CS =0;
GPIOPinWrite(GPIO_PORTA_BASE, CS,0x08);
SysCtlDelay(SysFreq/100);// 15 ms delay
GPIOPinWrite(GPIO_PORTA_BASE, CS,0);

LCD_WR_REG(0xCB);
LCD_WR_DATA8_SSI(0x39);
LCD_WR_DATA8_SSI(0x2C);
LCD_WR_DATA8_SSI(0x00);
LCD_WR_DATA8_SSI(0x34);
LCD_WR_DATA8_SSI(0x02);

LCD_WR_REG(0xCF);
LCD_WR_DATA8_SSI(0x00);
LCD_WR_DATA8_SSI(0XC1);
LCD_WR_DATA8_SSI(0X30);

LCD_WR_REG(0xE8);
LCD_WR_DATA8_SSI(0x85);
LCD_WR_DATA8_SSI(0x00);
LCD_WR_DATA8_SSI(0x78);

LCD_WR_REG(0xEA);
LCD_WR_DATA8_SSI(0x00);
LCD_WR_DATA8_SSI(0x00);

LCD_WR_REG(0xED);
LCD_WR_DATA8_SSI(0x64);
LCD_WR_DATA8_SSI(0x03);
LCD_WR_DATA8_SSI(0X12);
LCD_WR_DATA8_SSI(0X81);

LCD_WR_REG(0xF7);
LCD_WR_DATA8_SSI(0x20);

LCD_WR_REG(0xC0); //Power control
LCD_WR_DATA8_SSI(0x23); //VRH[5:0]

LCD_WR_REG(0xC1); //Power control
LCD_WR_DATA8_SSI(0x10); //SAP[2:0];BT[3:0]

LCD_WR_REG(0xC5); //VCM control
LCD_WR_DATA8_SSI(0x3e);
LCD_WR_DATA8_SSI(0x28);

LCD_WR_REG(0xC7); //VCM control2
LCD_WR_DATA8_SSI(0x86); //--

LCD_WR_REG(0x36); // Memory Access Control
LCD_WR_DATA8_SSI(0x48);

LCD_WR_REG(0x3A);
LCD_WR_DATA8_SSI(0x55);

LCD_WR_REG(0xB1);
LCD_WR_DATA8_SSI(0x00);
LCD_WR_DATA8_SSI(0x18);

LCD_WR_REG(0xB6); // Display Function Control
LCD_WR_DATA8_SSI(0x08);
LCD_WR_DATA8_SSI(0x82);
LCD_WR_DATA8_SSI(0x27);

LCD_WR_REG(0xF2); // 3Gamma Function Disable
LCD_WR_DATA8_SSI(0x00);

LCD_WR_REG(0x26); //Gamma curve selected
LCD_WR_DATA8_SSI(0x01);

LCD_WR_REG(0xE0); //Set Gamma
LCD_WR_DATA8_SSI(0x0F);
LCD_WR_DATA8_SSI(0x31);
LCD_WR_DATA8_SSI(0x2B);
LCD_WR_DATA8_SSI(0x0C);
LCD_WR_DATA8_SSI(0x0E);
LCD_WR_DATA8_SSI(0x08);
LCD_WR_DATA8_SSI(0x4E);
LCD_WR_DATA8_SSI(0xF1);
LCD_WR_DATA8_SSI(0x37);
LCD_WR_DATA8_SSI(0x07);
LCD_WR_DATA8_SSI(0x10);
LCD_WR_DATA8_SSI(0x03);
LCD_WR_DATA8_SSI(0x0E);
LCD_WR_DATA8_SSI(0x09);
LCD_WR_DATA8_SSI(0x00);

LCD_WR_REG(0XE1); //Set Gamma
LCD_WR_DATA8_SSI(0x00);
LCD_WR_DATA8_SSI(0x0E);
LCD_WR_DATA8_SSI(0x14);
LCD_WR_DATA8_SSI(0x03);
LCD_WR_DATA8_SSI(0x11);
LCD_WR_DATA8_SSI(0x07);
LCD_WR_DATA8_SSI(0x31);
LCD_WR_DATA8_SSI(0xC1);
LCD_WR_DATA8_SSI(0x48);
LCD_WR_DATA8_SSI(0x08);
LCD_WR_DATA8_SSI(0x0F);
LCD_WR_DATA8_SSI(0x0C);
LCD_WR_DATA8_SSI(0x31);
LCD_WR_DATA8_SSI(0x36);
LCD_WR_DATA8_SSI(0x0F);

LCD_WR_REG(0x11); //Exit Sleep
// delayms(120);
SysCtlDelay(SysFreq/2);// 200 ms delay

LCD_WR_REG(0x29); //Display on
LCD_WR_REG(0x2c);
}

//void TFT_Set_Address(unsigned int PX1,unsigned int PY1,unsigned int PX2,unsigned int PY2)
//{
// Write_Command_Data(68,(PX2 << 8) + PX1 ); //Column address start2
// Write_Command_Data(69,PY1); //Column address start1
// Write_Command_Data(70,PY2); //Column address end2
// Write_Command_Data(78,PX1); //Column address end1
// Write_Command_Data(79,PY1); //Row address start2
// Write_Command(34);
//}
//
//void TFT_Fill(unsigned int color)
//{
// unsigned int i,j;
//// TFT_CS = 0;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_CS,0);
// TFT_Set_Address(0,0,239,319);
//
// Write_Data(color);
//
// for(i = 0; i <= 319; i++)
// {
// for(j = 0; j <= 239; j++)
// {
// //TFT_WR = 0;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_WR,0);
// //TFT_WR = 1;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_WR,LCD_WR);
// }
// }

// TFT_CS = 1;
// GPIOPinWrite(GPIO_PORTC_BASE, LCD_CS,LCD_CS);
//}
//
//// Clear screen function
////Color:To clear the screen filled with color
void LCD_Clear(u16 Color) // CONVERTED TO CCS
{
u8 VH,VL;
u16 i,j;
int x=1,y=1;
VH=Color>>8;
VL=Color;
// kkk = 100;
// kkkbk =0
Address_set(0,0,LCD_W,LCD_H);

for(i=0;i<LCD_W;i++)
{
for (j=0;j<LCD_H;j++) // LCD_H
{

LCD_WR_DATA8_SSI(VH);
LCD_WR_DATA8_SSI(VL);
}
}

// kkkbk = kkk+1;
// kkk += 1;
// if(kkk > 240)
// {
// kkk = 1;
// kkkbk = 0;
// }

}
////Dotted
////POINT_COLOR:The color of this point
void LCD_DrawPoint(u16 x,u16 y)
{
Address_set(x,y,x,y);//Setting the cursor position
LCD_WR_DATA(POINT_COLOR);
}
//// Draw a big point
////POINT_COLOR:The color of this point
//void LCD_DrawPoint_big(u16 x,u16 y) // CONVERTED TO CCS
//{
// LCD_Fill(x-1,y-1,x+1,y+1,POINT_COLOR);
//}
// Fill in the designated area specified color
// Size of the area:
// (xend-xsta)*(yend-ysta)
void LCD_Fill(u16 xsta,u16 ysta,u16 xend,u16 yend,u16 color) // CONVERTED TO CCS
{
u16 i,j;
Address_set(xsta,ysta,xend,yend); //Setting the cursor position
for(i=ysta;i<=yend;i++)
{
for(j=xsta;j<=xend;j++)LCD_WR_DATA(color);//Setting the cursor position
}
}
// Draw the line
//x1,y1:Starting point coordinates
//x2,y2:End coordinates
void LCD_DrawLine(u16 x1, u16 y1, u16 x2, u16 y2) // CONVERTED TO CCS
{
u16 t;
int xerr=0,yerr=0,delta_x,delta_y,distance;
int incx,incy,uRow,uCol;

delta_x=x2-x1; //Calculate the coordinates of the incremental
delta_y=y2-y1;
uRow=x1;
uCol=y1;
if(delta_x>0)incx=1; //Set single-step directions
else if(delta_x==0)incx=0;//Vertical line
else {incx=-1;delta_x=-delta_x;}
if(delta_y>0)incy=1;
else if(delta_y==0)incy=0;//Level
else{incy=-1;delta_y=-delta_y;}
if( delta_x>delta_y)distance=delta_x; //Select the basic incremental axis
else distance=delta_y;
for(t=0;t<=distance+1;t++ )//Drawing a line output
{
LCD_DrawPoint(uRow,uCol);//Dotted
xerr+=delta_x ;
yerr+=delta_y ;
if(xerr>distance)
{
xerr-=distance;
uRow+=incx;
}
if(yerr>distance)
{
yerr-=distance;
uCol+=incy;
}
}
}
//Draw a rectangle
void LCD_DrawRectangle(u16 x1, u16 y1, u16 x2, u16 y2) // CONVERTED TO CCS
{
LCD_DrawLine(x1,y1,x2,y1);
LCD_DrawLine(x1,y1,x1,y2);
LCD_DrawLine(x1,y2,x2,y2);
LCD_DrawLine(x2,y1,x2,y2);
}
//A circle the size of the appointed position draw
//(x,y):The center
//r :Radius
void Draw_Circle(u16 x0,u16 y0,u8 r) // CONVERTED TO CCS
{
int a,b;
int di;
a=0;b=r;
di=3-(r<<1); //Judgment flag next point position
while(a<=b)
{
LCD_DrawPoint(x0-b,y0-a); //3
LCD_DrawPoint(x0+b,y0-a); //0
LCD_DrawPoint(x0-a,y0+b); //1
LCD_DrawPoint(x0-b,y0-a); //7
LCD_DrawPoint(x0-a,y0-b); //2
LCD_DrawPoint(x0+b,y0+a); //4
LCD_DrawPoint(x0+a,y0-b); //5
LCD_DrawPoint(x0+a,y0+b); //6
LCD_DrawPoint(x0-b,y0+a);
a++;
//Using the Bresenham algorithm Circle
if(di<0)di +=4*a+6;
else
{
di+=10+4*(a-b);
b--;
}
LCD_DrawPoint(x0+a,y0+b);
}
}
////Displays a character at the specified position
//
//// num "" ---> "~"
//// mode: overlay mode (1) or non-overlapping mode (0)
//// Display a character at the specified location
//
void LCD_ShowChar(u16 x,u16 y,u8 num,u8 mode) // CONVERTED TO CCS
{
u8 temp;
u8 pos,t;
u16 x0=x;
u16 colortemp=POINT_COLOR;
if(x>LCD_W-16||y>LCD_H-16)
{
return;
}
//Settings window
num=num-' ';//Obtained after the offset value
Address_set(x,y,x+8-1,y+16-1); //Setting the cursor position
if(!mode) //Non-overlapping mode
{
for(pos=0;pos<16;pos++)
{
temp=asc2_1608[(u16)num*16+pos]; //Call 1608 fonts
for(t=0;t<8;t++)
{
if(temp&0x01)POINT_COLOR=colortemp;
else POINT_COLOR=BACK_COLOR;
LCD_WR_DATA(POINT_COLOR);
temp>>=1;
x++;
}
x=x0;
y++;
}
}else//Superimposition
{
for(pos=0;pos<16;pos++)
{
temp=asc2_1608[(u16)num*16+pos]; //Call 1608 fonts
for(t=0;t<8;t++)
{
if(temp&0x01)LCD_DrawPoint(x+t,y+pos);//Draw a point
temp>>=1;
}
}
}
POINT_COLOR=colortemp;
}
// m ^ n function
u32 mypow(u8 m,u8 n)
{
u32 result=1;
while(n--)result*=m;
return result;
}
// Show two figures
// x, y: starting point coordinates
// len: Digits
// color: color
// num: value (0 to 4294967295);
void LCD_ShowNum(u16 x,u16 y,u32 num,u8 len) // CONVERTED TO CCS
{
u8 t,temp;
u8 enshow=0;
num=(u16)num;
for(t=0;t<len;t++)
{
temp=(num/mypow(10,len-t-1))%10;
if(enshow==0&&t<(len-1))
{
if(temp==0)
{
LCD_ShowChar(x+8*t,y,' ',0);
continue;
}else enshow=1;

}
LCD_ShowChar(x+8*t,y,temp+48,0);
}
}
// Show two figures
// x, y: starting point coordinates
// num: number (0 to 99);
void LCD_Show2Num(u16 x,u16 y,u16 num,u8 len) // CONVERTED TO CCS
{
u8 t,temp;
for(t=0;t<len;t++)
{
temp=(num/mypow(10,len-t-1))%10;
LCD_ShowChar(x+8*t,y,temp+'0',0);
}
}
// Display the string
// x, y: starting point coordinates
// * p: string starting address
// With 16 fonts
void LCD_ShowString(u16 x,u16 y,const u8 *p) // CONVERTED TO CCS
{
while(*p!='\0')
{
if(x>LCD_W-16){x=0;y+=16;}
if(y>LCD_H-16)
{
y=x=0;
LCD_Clear(RED);
}
LCD_ShowChar(x,y,*p,0);
x+=8;
p++;
}
}
//
//// Display a character (32 * 33 size) at the specified location
//// dcolor content color, gbcolor for Beijing color
//void show_char(unsigned int x,unsigned int y,unsigned char index) // CONVERTED TO CCS
//{
// unsigned char i,j;
// unsigned char *temp=symbol;
// Address_set(x,y,x+31,y+31); //Settings area
// temp+=index*128;
// for(j=0;j<128;j++)
// {
// for(i=0;i<8;i++)
// {
// if((*temp&(1<<i))!=0)
// {
// LCD_WR_DATA(POINT_COLOR);
// }
// else
// {
// LCD_WR_DATA(BACK_COLOR);
// }
// }
// temp++;
// }
//}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////ENABLING PORTS//////////////////////////////////////////////
void TivaInit(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); // PE4 = D/C' , PE5 = RESET
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // LEDs for debugging only, not requierd in final
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);// SSI pins
SysCtlDelay(SysFreq/10);// 100mS delay

GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LPLEDs);

/////////////////////OTHER CONTROL LINES////////////////////////////////////////////
GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, CS);//
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, DC|RESET);

/////////////////SSI CONFIG HERE//////////////////////////////////////////////////////

SSIDisable(SSI0_BASE); // disables th SSI module as required for init
GPIOPinConfigure(GPIO_PA2_SSI0CLK);
GPIOPinConfigure(GPIO_PA4_SSI0RX);
GPIOPinConfigure(GPIO_PA5_SSI0TX);

GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_4|GPIO_PIN_5);

SSIClockSourceSet(SSI0_BASE, SSI_CLOCK_SYSTEM); // sets the system clock as the source of clock

SSIConfigSetExpClk(SSI0_BASE, SysFreq, SSI_FRF_MOTO_MODE_2,SSI_MODE_MASTER, 20000000, 8);// defines base, System clk, Mode 0 = SPH = SPO = 0,Master, 400 KHz, no. of bits = 8 = 1 byte transfer

SSIEnable(SSI0_BASE); // enables SSI
////////////////////// SSI CONFIG ENDS/////////////////////////////////////////

 

  • I noted this post hours earlier - hoped that someone familiar w/this vendor's (singular) IDE would respond.

    I checked all 3 of the error creating functions - iirc I could not find the closing brace for the last one.  (last appearing in your code - yet I don't believe that's the cause of your error.)

    Vendor's compiler reports (only) those first 3 "now external" functions are flawed - yet I wonder about "all others."    And I note that those failing are the very first one's called - after you set system clock.  Would it not prove useful to "switch those 3 - error causing external functions" with 3 other external ones?   (i.e. those not flagged as, "in error")     Such would reveal that your compiler can handle - at least some - of your added, external functions.

    In addition - might you greatly shorten at least one of those failing external functions - and repeat your test?   I'm aware that the program cannot (then) perform to your liking - but such signals "if" the issue is within the external function itself or requires some added file notification or dependency.

    Each of those failing functions appear reasonably large - perhaps you must notify other files w/in your program of the presence of (both) added SPI functions.  (.c & .h)

  • Hi Turjasu,

    Also in addition to CB1 notes please check for remaining or typo existing in the exports moved and clean the project before compile. Past had a typo in an moved export cause the same kind of errors. Took long time to see but one day the exported variable name was noticed very odd. Ended up being a label of an exported struct classified name in the resource was incorrectly being called by another name in the export.

  • Greatly shortening each of the errant functions - as far earlier suggested - eliminates the "search for typo."
  • Hello cb1

    Yes, I agree with you. While we see the 5 errors we do not see the 78 warnings (rather too high)

    Regards
    Amit
  • It's hard to know where to start.

    The header file does not belong in driverlib
    The initializations do not belong in the header
    You are missing a lot of brackets in your defines
    Indentation is missing but that may be because you didn't use the code paste facility
    The protective header define could be better named. The chance of the current definition colliding is high
    What every one else complained about

    Finally the error you are complaining about is from the link and locate step. It suggests you haven't linked and/or compiled the file containing the functions

    Robert
  • Thanks cb1 for your reply.

    I understand that the last function has no closing }, but i just forgot to copy paste it here. otherwise it is there in the actual code.

    Now coming to the point that the failing functions are the ones which are called initially under main.c . This is true! That is why i tried blocking all of them and created a simple function called useless as given below:

    void useless(void)

    {

    }

    And tried calling this in main.c and the same error appeared. Proving it that the compiler was totally unable to handle any external functions.

    Also I tried calling other external functions from other libraries previously defined by TI in its tivaware and they worked fine. But in the same header and corresponding .c file when i am defining a small function and calling it in main.c, It failed to compile and generated the same error!

    I do not understand why this is happening!

    And finally I created a blank project called TEST and included a new header called test_header.h and defined the function

    extern void useless(void)

    and defined it in test_header.c :

    void useless(void)

    {

    }

    and called it in main.c

    And the Error still happened. This proves it is independant of the function, the compiler has some issues.

    I am using Windows 8.1 PRO, is it someway related to the OS? I might be wrong, but still...

  • TURJASU PYNE1 said:
    This proves it is independant of the function, the compiler has some issues.

    No, it does not.

    There are alternative and far more likely explanations considering that others are successfully compiling multiple source projects. I thin kthe most likely is that you are simply specifying your build incorrectly.

    Robert

  • Hello Turjasu

    extern void useless(void)

    must be

    extern void useless(void);

    Regards
    Amit
  • You can make a simple check of whether you are at least compiling test_header.c Add a line like

    never_declared = 35qr;

    to the useless function.

    If this does not produce a compiler error, then you are not compiling the test_header.c module.

    Robert
  • yes.. i have put the ; syntax
  • ok sir. I will try that out surely. Thanks
  • Yes. True,
    It didnot return any error while compiling the function with the line:
    never_declared = 35qr;

    Can you please help me with where might be the problem. I am not that expert in this
  • it is not compiling the module. As it did not return any error!
  • Hello Turjasu

    As Robert mentioned, you may not have added the C file to the compilation list. Can you check the compilation log to see if the C file is being compiled at all!!!

    Regards
    Amit
  • Yes. I am doing that

    Regards,
    Turjasu Pyne



    ---- Amit Ashara wrote ----

     

    A Message from the TI E2E™ Community
    Texas Instruments

     

    Amit Ashara replied to Problem while compiling with a customized header.

    Hello Turjasu

    As Robert mentioned, you may not have added the C file to the compilation list. Can you check the compilation log to see if the C file is being compiled at all!!!

    Regards
    Amit

     

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • Hello Turjasu,

    Can you please attach the compilation log file to the forum post?

    Regards
    Amit
  • here is the compiler log as requested:

    **** Build of configuration Debug for project TFT_LCD_2_2 ****

    "c:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
    'Building target: TFT_LCD_2_2.out'
    'Invoking: ARM Linker'
    "c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -Ooff -g --define=PART_TM4C123GH6PM --display_error_number --diag_warning=225 --diag_wrap=off -z -m"TFT_LCD_2_2.map" --heap_size=0 --stack_size=512 -i"c:/ti/ccsv6/tools/compiler/arm_5.1.5/lib" -i"c:/ti/ccsv6/tools/compiler/arm_5.1.5/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="TFT_LCD_2_2_linkInfo.xml" --rom_model -o "TFT_LCD_2_2.out" "./tm4c123gh6pm_startup_ccs.obj" "./main.obj" "C:/ti/TivaWare_C_Series-2.1.1.71/driverlib/ccs/Debug/driverlib.lib" "../tm4c123gh6pm.cmd" -l"libc.a"
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    LCD_Clear ./main.obj
    Lcd_Init ./main.obj
    TivaInit ./main.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "TFT_LCD_2_2.out" not built

    >> Compilation failure
    gmake: *** [TFT_LCD_2_2.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

  • Hi,

    Both Robert and Amit told you, but not sufficiently imperative: do not place your files in driverlib folder! place them in your project root folder, even make your "drivers" folder into your project root - see Tiva examples. Otherwise you need to recompile driverlib - but this method is prone to further problems - if you change the driverlib version, your files will be lost, even forever.

    Second, when declaring/writing your own files, do not use double underscore prefix, use a single underscore postfix, aka instead __LCD2_H use LCD2_H_. The double underscore prefix is to be used by compiler internal names; do not interfere with them!

  • Hi,

    That log appears truncated and please confirm you do clean this project after moving the code from (main.c) into you new file?

    Clean project close CCS & reopen, rebuild the index, Check for and resolve missing includes: right click on project folder for all tools.

    The problem seems to be in (main.c) judging from truncated log. My find has been the very first warning or error tends to be a pointer to the problem. For instance having an include (main.h) in the new header file pointing to code left behind referenced by exported variable or function in the new header file sometimes makes the compiler throw many errors, refuse to continue linker is never invoked.

  • Hello Turjasu

    Can you please attach your project?

    Regards
    Amit
  • Ahh, you're using make, show us your makefile.

    Robert
  • where to find the makefile? sorry i do not know :(
  • SW.zip

    Dear Amit,

      I have attached the project. Please find it. I am using Tivaware version "TivaWare_C_Series-2.1.1.71" .

    It is an export of the CCS v6 project taken from the software itself.

    Thanks

  • Hello Turjasu

    The files LCD2_2SPI.h and LCD2_2SPI.c are missing in the SW.zip

    Regards
    Amit
  • No idea, it's your build.

    Robert
  • is it this one? :

    ################################################################################
    # Automatically-generated file. Do not edit!
    ################################################################################

    SHELL = cmd.exe

    CG_TOOL_ROOT := c:/ti/ccsv6/tools/compiler/arm_5.1.5

    ORDERED_OBJS += \
    $(GEN_CMDS__FLAG) \
    "./tm4c123gh6pm_startup_ccs.obj" \
    "./main.obj" \
    "C:/ti/TivaWare_C_Series-2.1.1.71/driverlib/ccs/Debug/driverlib.lib" \
    "../tm4c123gh6pm.cmd" \
    -l"libc.a" \

    -include ../makefile.init

    RM := DEL /F
    RMDIR := RMDIR /S/Q

    # All of the sources participating in the build are defined here
    -include sources.mk
    -include subdir_vars.mk
    -include subdir_rules.mk
    -include objects.mk

    ifneq ($(MAKECMDGOALS),clean)
    ifneq ($(strip $(S_DEPS)),)
    -include $(S_DEPS)
    endif
    ifneq ($(strip $(S_UPPER_DEPS)),)
    -include $(S_UPPER_DEPS)
    endif
    ifneq ($(strip $(S62_DEPS)),)
    -include $(S62_DEPS)
    endif
    ifneq ($(strip $(C64_DEPS)),)
    -include $(C64_DEPS)
    endif
    ifneq ($(strip $(ASM_DEPS)),)
    -include $(ASM_DEPS)
    endif
    ifneq ($(strip $(CC_DEPS)),)
    -include $(CC_DEPS)
    endif
    ifneq ($(strip $(S55_DEPS)),)
    -include $(S55_DEPS)
    endif
    ifneq ($(strip $(C67_DEPS)),)
    -include $(C67_DEPS)
    endif
    ifneq ($(strip $(C??_DEPS)),)
    -include $(C??_DEPS)
    endif
    ifneq ($(strip $(CLA_DEPS)),)
    -include $(CLA_DEPS)
    endif
    ifneq ($(strip $(CPP_DEPS)),)
    -include $(CPP_DEPS)
    endif
    ifneq ($(strip $(S??_DEPS)),)
    -include $(S??_DEPS)
    endif
    ifneq ($(strip $(C_DEPS)),)
    -include $(C_DEPS)
    endif
    ifneq ($(strip $(C62_DEPS)),)
    -include $(C62_DEPS)
    endif
    ifneq ($(strip $(CXX_DEPS)),)
    -include $(CXX_DEPS)
    endif
    ifneq ($(strip $(C++_DEPS)),)
    -include $(C++_DEPS)
    endif
    ifneq ($(strip $(ASM_UPPER_DEPS)),)
    -include $(ASM_UPPER_DEPS)
    endif
    ifneq ($(strip $(K_DEPS)),)
    -include $(K_DEPS)
    endif
    ifneq ($(strip $(C43_DEPS)),)
    -include $(C43_DEPS)
    endif
    ifneq ($(strip $(S67_DEPS)),)
    -include $(S67_DEPS)
    endif
    ifneq ($(strip $(SA_DEPS)),)
    -include $(SA_DEPS)
    endif
    ifneq ($(strip $(S43_DEPS)),)
    -include $(S43_DEPS)
    endif
    ifneq ($(strip $(OPT_DEPS)),)
    -include $(OPT_DEPS)
    endif
    ifneq ($(strip $(S64_DEPS)),)
    -include $(S64_DEPS)
    endif
    ifneq ($(strip $(C_UPPER_DEPS)),)
    -include $(C_UPPER_DEPS)
    endif
    ifneq ($(strip $(C55_DEPS)),)
    -include $(C55_DEPS)
    endif
    endif

    -include ../makefile.defs

    # Add inputs and outputs from these tool invocations to the build variables
    EXE_OUTPUTS += \
    TFT_LCD_2_2.out \

    EXE_OUTPUTS__QUOTED += \
    "TFT_LCD_2_2.out" \

    BIN_OUTPUTS += \
    TFT_LCD_2_2.hex \

    BIN_OUTPUTS__QUOTED += \
    "TFT_LCD_2_2.hex" \


    # All Target
    all: TFT_LCD_2_2.out

    # Tool invocations
    TFT_LCD_2_2.out: $(OBJS) $(CMD_SRCS) $(LIB_SRCS) $(GEN_CMDS)
    @echo 'Building target: $@'
    @echo 'Invoking: ARM Linker'
    "c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -Ooff -g --define=PART_TM4C123GH6PM --display_error_number --diag_warning=225 --diag_wrap=off -z -m"TFT_LCD_2_2.map" --heap_size=0 --stack_size=512 -i"c:/ti/ccsv6/tools/compiler/arm_5.1.5/lib" -i"c:/ti/ccsv6/tools/compiler/arm_5.1.5/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="TFT_LCD_2_2_linkInfo.xml" --rom_model -o "TFT_LCD_2_2.out" $(ORDERED_OBJS)
    @echo 'Finished building target: $@'
    @echo ' '

    TFT_LCD_2_2.hex: $(EXE_OUTPUTS)
    @echo 'Invoking: ARM Hex Utility'
    "c:/ti/ccsv6/tools/compiler/arm_5.1.5/bin/armhex" -o "TFT_LCD_2_2.hex" $(EXE_OUTPUTS__QUOTED)
    @echo 'Finished building: $@'
    @echo ' '

    # Other Targets
    clean:
    -$(RM) $(EXE_OUTPUTS__QUOTED)$(BIN_OUTPUTS__QUOTED)
    -$(RM) "main.pp" "tm4c123gh6pm_startup_ccs.pp"
    -$(RM) "main.obj" "tm4c123gh6pm_startup_ccs.obj"
    -@echo 'Finished clean'
    -@echo ' '

    .PHONY: all clean dependents
    .SECONDARY:

    -include ../makefile.targets
  • 3630.SW.zip.

    Here it is..! I have included the header and the c file

  • Hello Turjasu,

    My apologies but I am sorry to say that I have never seen such a code which is highly unstructured. I would strongly advise to follow a good coding structure to make sure that variables and functions are well defined and exported.

    Regards
    Amit
  • I do agree with you. But it was created in a haste by my colleague and then handed over to me. I fully accept your observation.
    The header and the c file both are not done by me and is just a result of doing things in haste. All my codes are much better and commented as well as structured.

    Regards,
    Turjasu Pyne



    ---- Amit Ashara wrote ----

     

    A Message from the TI E2E™ Community
    Texas Instruments

     

    Amit Ashara replied to Problem while compiling with a customized header.

    Hello Turjasu,

    My apologies but I am sorry to say that I have never seen such a code which is highly unstructured. I would strongly advise to follow a good coding structure to make sure that variables and functions are well defined and exported.

    Regards
    Amit

     

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • Hello Turjasu

    I would suggest re-doing it since the functions may be correct but syntax structures are not correct.

    Regards
    Amit
  • But the problem also persists even if I am making a blank program as I said before. And the c file is not getting compiled at all.

  • > But the problem also persists even if I am making a blank program as I said before. And the c file is not getting compiled at all.

    The program is actually trying to compile, "check debug folder (main.obj) is being renewed on the next compile after you cleaned the project. Notice the debug folder is emptied during clean. Compiler stops at main.obj and is not even getting to linking due to encountered export errors during compile.

    The tough part is locating where the exports are going amuck. Like I pointed out earlier if you have even one export in the new file pointing to a function in (main.h) that was moved from (main.c) into your new C file the compiler can not locate the symbols. An improper name given for an exported variable can also cause the same symbol errors.
  • Hello Turjasu

    Attached is a simple hello program which uses a function in file clockfunc.c and clockfunc.h which can be called in main.c. You can use this as a reference.

    hello.zip

    Regards

    Amit

  • Hi Amit,

    Bravo - believe this type/style example (as you've just furnished) properly "models" user's issue/requirement...

    Mefears that "own project" issues may remain - thus new (further) complications may lurk...
  • Hello cb1,

    I wanted to establish a baseline for any further complications.

    Regards
    Amit
  • Dear Sir,

    Thanks a lot for your help. Now I have developed the headers and the entire project is structured as it should be and is working fine. Figured out the problem which was relating to the creation / consolidation of the declared array as well as the functions in a single header. Moreover, as per your hello example, I have restructured the header inclusions in the c file and not under main. Also I have segregated the font header as a separate header for the project so that the functions related to the LCD were in separate header, which helped remove the compilation problem.
    I will upload the entire project shortly along with the sampled header so that others facing this issue may get it solved.
    Thanks to everyone who has helped me.
  • Hello Turjasu

    You may still want to keep your project to yourself unless as it may be your organization's propitiatory information.

    The template in my post may be useful to others.

    Regards
    Amit
  • Thanks sir. I will share what can be shareable. Apart from your template, it has a good way of initializing ILI9341 based lcd that is not available in forum and might be helpful

    Regards,
    Turjasu Pyne



    ---- Amit Ashara wrote ----

     

    A Message from the TI E2E™ Community
    Texas Instruments

     

    Amit Ashara replied to Problem while compiling with a customized header.

    Hello Turjasu

    You may still want to keep your project to yourself unless as it may be your organization's propitiatory information.

    The template in my post may be useful to others.

    Regards
    Amit

     

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • Hello Turjasu

    Hmm, well that would be a good pointer to folks doing or planning to do the same.

    Regards
    Amit