Hi, I'm trying to use the UART5 receive interruption with my tm4c1294xl launchpad board but I'm getting stuck because the ISR is not being called, bellow is my code
#include <stdint.h> #include <stdbool.h> #include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/interrupt.h" #include "driverlib/pin_map.h" #include "driverlib/sysctl.h" #include "driverlib/uart.h" #include "driverlib/gpio.h" /*variable to keep system clock*/ uint32_t g_ui32SysClock; void init_serial(uint32_t system_clock, void (*pfnHandler) (void)){ /*Enabling Peripherals*/ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART5); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC); /*Setting Up pins*/ GPIOPinConfigure(GPIO_PC6_U5RX); GPIOPinConfigure(GPIO_PC7_U5TX); GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_6 | GPIO_PIN_7); /*UART Configurations*/ UARTConfigSetExpClk(UART5_BASE,system_clock,115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); /*Enable uart interruptions*/ IntEnable(INT_UART5); UARTIntEnable(UART5_BASE, (UART_INT_RX | UART_INT_RT)); /*Registering UART isr*/ IntRegister(INT_UART5, pfnHandler); } /*ISR for uart5 receive or receive timeout interruption */ void UARTIntHandler(void) { uint32_t ui32Status; // // Get the interrrupt status. // ui32Status = UARTIntStatus(UART5_BASE, true); // // Clear the asserted interrupts. // UARTIntClear(UART5_BASE, ui32Status); // // Loop while there are characters in the receive FIFO. // while(UARTCharsAvail(UART5_BASE)) { // // Read the next character from the UART and write it back to the UART. // UARTCharPutNonBlocking(UART5_BASE, UARTCharGetNonBlocking(UART5_BASE)); // // Blink the LED to show a character transfer is occuring. // GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_PIN_0); // // Delay for 1 millisecond. Each SysCtlDelay is about 3 clocks. // SysCtlDelay(g_ui32SysClock / (1000 * 3)); // // Turn off the LED // GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, 0); } } int main(void){ /* Set the clocking to run at 120MHz */ g_ui32SysClock= SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000); /*Start string*/ uint8_t *cThisChar = "Starting..."; /*Onboard led just for verifications*/ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION); GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0); GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, 0x00); /*Enabling processor interrupts*/ IntMasterEnable(); /*serial configurations*/ init_serial(g_ui32SysClock, UARTIntHandler); /*Sending initial string*/ while(*cThisChar != '\0'){ UARTCharPutNonBlocking(UART5_BASE, *cThisChar++); } while(1){ /*Wait interruptions*/ } /*no errors*/ return 0; }
Code is compling with no errors but when I send something to the board the receive interruption is not triggered.