1

I am trying to run Lab 3 exercise from the Getting Started with the Tiva (page 71). I am using Tiva C Series TM4C123GH6PM with Code Composer Studio 6.0.1 .

My code is as folles:

#include <stdint.h>
#include <stdbool.h>
#include "C:\ti\TivaWare_C_Series-2.1.0.12573\inc\hw_memmap.h"
#include "C:\ti\TivaWare_C_Series-2.1.0.12573\inc\hw_types.h"
#include "C:\ti\TivaWare_C_Series-2.1.0.12573\driverlib\sysctl.h"
#include "C:\ti\TivaWare_C_Series-2.1.0.12573\driverlib\gpio.h"

uint8_t ui8PinData=2;

int main(void)
{
    SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);

    while(1)
    {
        GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, ui8PinData);
        SysCtlDelay(2000000);
        GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3, 0x00);
        SysCtlDelay(2000000);
        if(ui8PinData==8) {ui8PinData=2;} else {ui8PinData=ui8PinData*2;}
    }

}

At the includes I needed to put the full path for the CCS to find them.

The error I get is:

errors

Any ideas how to fix this?

Metalzero2
  • 531
  • 2
  • 6
  • 17
  • 1
    You have to link some library (DriverLib??( which contains missing functions. And BTW, full path as include file is not good practice. – Anto Jurković Mar 29 '15 at 22:29

1 Answers1

2

try doing:

#include "hw_memmap.h"
#include "hw_types.h"
#include "sysctl.h"
#include "gpio.h"

You might also need to link those files from driverlib into your project. To do this, right click your project, select properties. There should be a section for include options. Check that your driverlib folder is linked there.

tzhenghao
  • 128
  • 2
  • 5