Part Number: EK-TM4C129EXL
Tool/software: Code Composer Studio
Dear Sir,
I have problem during debugging. During step execution I had problem when execute this line GPIOPinConfigure(GPIO_PA0_U0RX) ,after that execution jump into infinite loop in startup program.
which I given below...
/ This is the code that gets called when the processor receives a fault
// interrupt. This simply enters an infinite loop, preserving the system state
// for examination by a debugger.
//
//*****************************************************************************
static void
FaultISR(void)
{
//
// Enter an infinite loop.
//
while(1)
{
}
}
And my code is ---
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
//#include "driverlib/systick.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/uart.h"
#include "driverlib/interrupt.h"
#include "utils/uartstdio.h"
void SetupUart0(void);
char Uart0_receiver(void);
void UART5_Transmitter(unsigned char data);
void SetupUart0(void)
{
#if defined(TARGET_IS_TM4C129_RA0) || \
defined(TARGET_IS_TM4C129_RA1) || \
defined(TARGET_IS_TM4C129_RA2)
uint32_t ui32SysClockFreqHz;
#endif
uint32_t SysClockFreqHz;
SysClockFreqHz = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
//
// Enable GPIO port A which is used for UART0 pins.
// TODO: change this to whichever GPIO port you are using.
SysCtlPeripheralEnable(GPIO_PORTA_BASE);
//
// Enable UART0 so that we can configure the clock.
//
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
while (SysCtlPeripheralReady(SYSCTL_PERIPH_UART0) != true)
{
}
//
// 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);
//GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
// Sets the configuration of a UART
UARTConfigSetExpClk(UART0_BASE, SysClockFreqHz, 115200, (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE | UART_CONFIG_WLEN_8));
// Set UART to interrupt when Tx FIFO is almost empty or any char received
UARTFIFOEnable(UART0_BASE);
//UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8);
//Enable Uart
UARTEnable(UART0_BASE);
// IntEnable(INT_UART0);
// UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT | UART_INT_TX);
UARTStdioConfig(0, 115200, 40000000);
}
/*void Uart0InterruptHandler(void)
{
uint32_t InterruptFlags;
InterruptFlags = UARTIntStatus(UART0_BASE, false);
UARTIntClear(UART0_BASE, InterruptFlags);
if (InterruptFlags & UART_INT_TX)
{
// Room in Tx FIFO
while (UARTSpaceAvail(UART0_BASE))
{
// UARTCharPutNonBlocking(UART0_BASE, BufGet(&Tx));
}
}
if (InterruptFlags & (UART_INT_RX | UART_INT_RT))
{
// Data in Rx FIFO
while (UARTCharsAvail(UART0_BASE))
{
// BufPut(&Rx, UARTCharGetNonBlocking(UART0_BASE));
}
}
} */
// char receive function
char Uart0_receiver(void)
{
char data;
while(UARTCharsAvail(UART0_BASE)!=false)
{
data=UARTCharGet(UART0_BASE);
}
return (unsigned char) data;
}
void UART5_Transmitter(unsigned char data)
{
// unsigned char peta;
while(UARTSpaceAvail(UART0_BASE)!=false)
{
UARTCharPut(UART0_BASE, data);
}
}
/**
* main.c
*/
int main(void)
{
SetupUart0();
UARTprintf("test");
//return 0;
}
Please help me. How can I solve this? Actually I was testing a character(A) send in board (like interrupt ) and it will be on led. When I will send B then it will be off led.
Imtiaj Hossain
