My source code:
#include <stdio.h>
/*
* TM4C123G
*/
#include "driverlib/pin_map.h"
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_ints.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/uart.h"
#include "uartstdio.h"
//*****************************************************************************
//
// The error routine that is called if the driver library encounters an error.
//
//*****************************************************************************
#ifdef DEBUG
void
__error__(char *pcFilename, unsigned long ulLine)
{
}
#endif
int main(void) {
uint32_t clock_rate;
// System clock set to 80Mhz using the 16 Mhz external crystal (MainOscillator) using PLL
SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
SysCtlDelay(5);
// Enable PortF
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
// Enable PORTA
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
// Setup GPIOF Pins as outputs
GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_1);
// ---- Setup UART0 PA0/PA1 ---- //
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
// Enable UART0
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
// Use 16Mhz internal Oscillator as UART BRCLK
UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
// Select UART function for PA0/PA1
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
// Initialize the UART for console I/O.
UARTStdioConfig(0, 115200, 16000000);
SysCtlDelay(5);
//-------------------------------//
UARTprintf("Test Output \n");
clock_rate = SysCtlClockGet();
while(1){
// Write to Pins
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1, 0x02);
// Delay for a bit
SysCtlDelay(100);
// Write to Pins
GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1, 0x00);
// Delay for a bit
SysCtlDelay(100);
}
return 0;
}
I'm using CCS version 5.4 with the TM4C123G launchpad (Tiva C). The chip is the TM4C123GH6PMI.
I started a new project (did not import an existing example which from what I've read seems to be frowned upon), but thats where I'm at. I had problems with the tivaware driverlib and inc directories not being included in the compiler search path as well as the linker search path. After figuring out I needed to include them in properties/build/arm linker/file search paths and properties/arm compiler/include options I ran into the problem of the "driverlib.lib" file not being added to the top section ("Include library file or command file as input").
Question 1 is, what is this file and why are the .h, .c files for the compiler sufficient?
After straightening this out I tried to send some data out of the uart with the above code. The only way I could get this to work is to copy the uarstdio.c and uartstdio.h files to my local project directory. I added the utils fold to my compiler search path, but I still get the linker error described above when I didn't add the driverlib.lib file. The problem though is that I can't find a utils.lib file to added here as I did above for driverlib problem. Does utils not have one? If not, how do I satisfy the need for the linker to find a library file?
