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.

TM4C123AE6PM: SysTick interrupt not firing.

Part Number: TM4C123AE6PM

Tool/software:

Here's my initialization code:

    SysTickIntRegister(SysTickISR);
    SysTickPeriodSet(80000000/100);    // Interrupt every 10ms. (convert nS to mS), keep (system running at 80MHz)
    SysTickIntEnable();                // in sync with TICK_TIME_MS in tick.h
    SysTickEnable();

    IntMasterEnable();          // Master Enable Interrupts.

SysTickISR() never gets called.

Thanks,

Doug

  • I'm also not getting interrupts on a UART - which works correctly if polled.  I copied working code from a TM4C129xxx, is there something different I need to do in the TM4C123xxx?  Using TivaWare library.

  • If there really isn't a difference between the two families, I likely damaged the CPU from a prior over-current.

  • Hi Doug,

      Can you first try the below systick example on a LaunchPad and then your custom board? If it works on a LaunchPad and not work on your custom board then there is something wrong with your board. If you have another custom board, you can try the same code again. What is the result?

    //*****************************************************************************
    //
    // Counter to count the number of interrupts that have been called.
    //
    //*****************************************************************************
    volatile uint32_t g_ui32Counter = 0;
    
    //*****************************************************************************
    //
    // This function sets up UART0 to be used for a console to display information
    // as the example is running.
    //
    //*****************************************************************************
    void
    InitConsole(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);
    }
    
    //*****************************************************************************
    //
    // The interrupt handler for the for Systick interrupt.
    //
    //*****************************************************************************
    void
    SysTickIntHandler(void)
    {
        //
        // Update the Systick interrupt counter.
        //
        g_ui32Counter++;
    }
    
    uint32_t i=0;
    
    //*****************************************************************************
    //
    // Configure the SysTick and SysTick interrupt with a period of 1 second.
    //
    //*****************************************************************************
    int
    main(void)
    {
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        uint32_t ui32SysClock;
    #endif
    
        uint32_t ui32PrevCount = 0;
    
        //
        // Set the clocking to run directly from the external crystal/oscillator.
        // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
        // crystal on your board.
        //
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                           SYSCTL_OSC_MAIN |
                                           SYSCTL_USE_OSC), 25000000);
    #else
        //SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
        //               SYSCTL_XTAL_16MHZ);
        SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
    
    #endif
    
        //
        // Set up the serial console to use for displaying messages.  This is
        // just for this example program and is not needed for Systick operation.
        //
        InitConsole();
    
        //
        // Display the setup on the console.
        //
        UARTprintf("SysTick Firing Interrupt ->");
        UARTprintf("\n   Rate = 1sec\n\n");
    
        //
        // Initialize the interrupt counter.
        //
        g_ui32Counter = 0;
    
        i = SysCtlClockGet();
    
        //
        // Set up the period for the SysTick timer.  The SysTick timer period will
        // be equal to the system clock, resulting in a period of 1 second.
        //
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        SysTickPeriodSet(ui32SysClock);
    #else
        SysTickPeriodSet(SysCtlClockGet());
    #endif
    
        //
        // Enable interrupts to the processor.
        //
        IntMasterEnable();
    
        //
        // Enable the SysTick Interrupt.
        //
        SysTickIntEnable();
    
        //
        // Enable SysTick.
        //
        SysTickEnable();
    
        //
        // Loop forever while the SysTick runs.
        //
        while(1)
        {
            //
            // Check to see if systick interrupt count changed, and if so then
            // print a message with the count.
            //
            if(ui32PrevCount != g_ui32Counter)
            {
                //
                // Print the interrupt counter.
                //
                UARTprintf("Number of interrupts: %d\r", g_ui32Counter);
                ui32PrevCount = g_ui32Counter;
            }
        }
    }

  • Hi Charles,

    My assumption was right, I had both CPUs replaced and now interrupts work.

    Thanks, Doug