Hello,
This is my code:
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "utils/uartstdio.h"
#include "inc/hw_memmap.h"
#include "inc/hw_gpio.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/gpio.h"
#include "driverlib/uart.h"
#include "driverlib/sysctl.h"
void onButtonDown(void);
void UART_Init(void);
void main()
{
SysCtlClockSet(SYSCTL_SYSDIV_4| SYSCTL_USE_PLL | SYSCTL_OSC_INT | SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_4);
GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_4,GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1);
GPIOIntDisable(GPIO_PORTF_BASE, GPIO_PIN_4);
GPIOIntClear(GPIO_PORTF_BASE, GPIO_PIN_4);
GPIOIntRegister(GPIO_PORTF_BASE, onButtonDown);
GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_FALLING_EDGE);
GPIOIntEnable(GPIO_PORTF_BASE, GPIO_PIN_4);
UART_Init();
while (1)
{
//GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, (GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_1) ^ GPIO_PIN_1));
SysCtlDelay(1000000);
}
}
void onButtonDown(void)
{
GPIOIntDisable(GPIO_PORTF_BASE, GPIO_PIN_4);
GPIOIntClear(GPIO_PORTF_BASE, GPIO_PIN_4);
SysCtlDelay(500000);
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1, (GPIOPinRead(GPIO_PORTF_BASE, GPIO_PIN_1) ^ GPIO_PIN_1));
GPIOIntClear(GPIO_PORTF_BASE, GPIO_PIN_4);
GPIOIntEnable(GPIO_PORTF_BASE, GPIO_PIN_4);
}
void UART_Init(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); //here I get the error, when I comment this line the error disapears
}
And these are the errors reported:
When I add the file uartstdio.c into the project directory, the error is gone. But the compiler must search for this file as it does for the others. I don't understand what is wrong. Any help would be much appreciated.


