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.

UARTprintf not printing at all

Hi all, I've been trying to print out a simple string. I've linked uartstdio.c to my project folder. when i try to use UARTprintf, the my whole code stops working. when i comment out the UARTprintf statement, the rest of the UARTCharPut works. any idea why? thanks in advance.

#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "inc/hw_memmap.h"
#include "driverlib/fpu.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/sysctl.h"
#include "driverlib/systick.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"
#include "utils/ustdlib.h"

#ifdef DEBUG
void
__error__(char *pcFilename, unsigned long ulLine)
{
}
#endif

void ConfigureUART(void)
{
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
	ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
	ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
	ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
	ROM_GPIOPinConfigure(GPIO_PB0_U1RX);
	ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);

	UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
	UARTStdioConfig(0, 38400, 16000000);
	UARTClockSourceSet(UART1_BASE, UART_CLOCK_PIOSC);
	UARTStdioConfig(1, 38400, 16000000);
}

int main(void) {

	uint8_t i, j, k;
	int8_t rxchar;
	uint8_t msgtype[5];
	uint8_t GLLtype[] = {'G', 'P', 'G', 'L', 'L'};
	uint8_t ZDAtype[] = {'G', 'P', 'Z', 'D', 'A'};
	//uint32_t latlong[8];
	//uint32_t datetime[8];
	//uint32_t ui32Index;

	ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

	ConfigureUART();

	UARTprintf("GPS Reading\n");

	while (1) {

		rxchar = UARTCharGet(UART1_BASE);
		if (rxchar == -1)
		{
			UARTCharPut(UART0_BASE, 'F');
			break;
		}
		else if (rxchar == '$') {
			for (i = 0; i < 5; i++) {
				msgtype[i] = UARTCharGet(UART1_BASE);
				UARTCharPut(UART0_BASE, msgtype[i]);
				if (msgtype[i] == GLLtype[i]) {
					j++;
				}
				if (msgtype[i] == ZDAtype[i]) {
					k++;
				}
			}
		}
		else {
			UARTCharPut(UART0_BASE, rxchar);
		}
	}
}