Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: RTOS Project Build Problem with TM4C123G Launch Pad

$
0
0

Hi All,

 I was working on a RTOS project with TM4C123G Launch Pad.The project is Blinking an LED.Below is the code for the project;

When i initialy tried to build the project the errors were about the missing include files xdc/std.h, ti/sysbios/BIOS.h and xdc/cfg/global.h.After manually giving the paths for these files now there is another error as ;


#1965 cannot open source file "ti/targets/select.h" main.c /RTOS_1 line 86, external location: C:\ti\xdctools_3_25_03_72\packages\xdc\std.h C/C++ Problem

 

But the weird thing is there is no source file "ti/targets/select.h" as menitoned on line 86.

What am i doing wrong can some one help on this issue?

 

Thanks in advance

Kutlu

 

//----------------------------------------
// BIOS header files
//----------------------------------------
#include <xdc/std.h> //mandatory - have to include first, for BIOS types
#include <ti/sysbios/BIOS.h> //mandatory - if you call APIs like BIOS_start()
#include <xdc/cfg/global.h> //header file for statically defined objects/handles
#include <xdc/runtime/Log.h> //used for Log_info() calls


//------------------------------------------
// TivaWare Header Files
//------------------------------------------
#include <stdint.h>
#include <stdbool.h>

#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "inc/hw_ints.h"
#include "driverlib/interrupt.h"
#include "driverlib/timer.h"
#include <time.h>


//----------------------------------------
// Prototypes
//----------------------------------------
void hardware_init(void);
void ledToggle(void);
void delay(void);


//---------------------------------------
// Globals
//---------------------------------------
volatile int16_t i16ToggleCount = 0;


//---------------------------------------------------------------------------
// main()
//---------------------------------------------------------------------------
void main(void)
{

hardware_init(); // init hardware via Xware

BIOS_start();

}


//---------------------------------------------------------------------------
// hardware_init()
//
// inits GPIO pins for toggling the LED
//---------------------------------------------------------------------------
void hardware_init(void)
{
//Set CPU Clock to 40MHz. 400MHz PLL/2 = 200 DIV 5 = 40MHz
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

// ADD Tiva-C GPIO setup - enables port, sets pins 1-3 (RGB) pins for output
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);

// Turn on the LED
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 4);

}


//---------------------------------------------------------------------------
// ledToggle()
//
// toggles LED on Tiva-C LaunchPad
//---------------------------------------------------------------------------
void ledToggle(void)
{
// LED values - 2=RED, 4=BLUE, 8=GREEN
if(GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_2))
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0);
}
else
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_2, 4);
}

delay(); // create a delay of ~1/2sec

i16ToggleCount += 1; // keep track of #toggles

Log_info1("LED TOGGLED [%u] TIMES",i16ToggleCount);

}

//---------------------------------------------------------------------------
// delay()
//
// Creates a 500ms delay via TivaWare fxn
//---------------------------------------------------------------------------
void delay(void)
{
SysCtlDelay(5000000); // creates ~500ms delay - TivaWare fxn

}


Viewing all articles
Browse latest Browse all 91752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>