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.

LM4F232 SysTick stopped working



I was developing an app on the EKS-LM4F232 board (part number ends in A1). 

I tried to setup Port K pin4 as a GPIO output. I ended up in the FaultISR when I ran the executable. I soon realized the Port K has some special setup requirements and switched to using Port J.

So now I can execute the program but I never get the SysTickIntHandler(). 

I loaded an earlier version of my program (where the SysTick did work) and it no longer works. So I went back to the qs-logger app. I can load it but still no SysTick.

I've cycled power on the board  and loaded several applications, everything seems to work but the SysTick. I can not find any NV registers related to the SysTick.

There is errata 4.2 related to SysTick, but it does not seem to be the problem here.

Below are the related code segments... 

--- Start snippet 

// Derived from qs-logger.c - Data logger Quickstart application for EK-LM4F232.
//*****************************************************************************
#define CLOCK_RATE 100
#define MS_PER_SYSTICK (1000 / CLOCK_RATE)


static volatile unsigned long g_ulTickCount;

// Handles the SysTick timeout interrupt.
void SysTickIntHandler(void)
{
    // Increment the tick count.
    g_ulTickCount++;
}

--- End snippet

--- Start snippet 

int main(void)
{
  unsigned long ulSysClock;

   // Set the clocking to run at 50 MHz.
   ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |
                                           SYSCTL_OSC_MAIN);
   ulSysClock = ROM_SysCtlClockGet();
--- End snippet
...
--- Start snippet
    // Configure SysTick to periodically interrupt.
    g_ulTickCount = 0;
    ROM_SysTickPeriodSet(ulSysClock / CLOCK_RATE);
    ulSysClock = ROM_SysTickPeriodGet();
    if( ulSysClock != ROM_SysCtlClockGet()/100 )
        while(1);
    ROM_SysTickIntEnable();
    ROM_SysTickEnable();
    ROM_IntMasterEnable();
--- End snippet
...
--- Start snippet
    // Forever loop to run the application
    while(1)
    {
        static unsigned long ulLastTickCount = 0;

        // Each time the timer tick occurs, process any button events.
        if(g_ulTickCount != ulLastTickCount)
        {
--- End snippet
...
--- Start snippet
        }

    }
}

  • Peter,

    I've got a few questions about qs-logger.  When you say that the app is not working with the systick, can you tell me what you are experiencing?  Does the logo at the beginning show up?  Are you able to use the buttons?  Are you using the qs-logger binary from the installation or are you rebuilding?

    Thanks,

    Sean

  • When I run the qs-logger, I get the logo and then the menu, but I cannot navigate the menu.

    If I put a break point in the SysTick interrupt handler, it never brakes there. If I put a break point inside the " if(g_ulTickCount != ulLastTickCount)" I never get there either.

    I found another example for this kit that uses the systick "sine_demo". I built and ran it seems to work OK unless I use the debugger. If I step through the app, I never get the g_ulTickCount incremented.

    So, I went back and loaded qs-logger. If I just load and run it seems to be fine. In fact, I can load one of my apps and it runs.

    Maybe a problem with the debugger? Or my ignorance of the debugger?

  • Peter,

    Stepping through the code will cause issues since the interrupts need to fire faster than you can step, but it shouldn't cause the problems you are describing.  Are you always running your code with the debugger or are you loading the binary with LM Flash Programmer?

    Sean

  • I'm always loading with the debug button in CCS.. 

  • It is conceivable that CCS is doing something to the SysTick registers when code is loaded and the debugger is started. I will ask my coworkers if they have seen any similar behavior.  Try loading the binary files directly with LM Flash Programmer and see if you get the same behavior.

    Sean

  • Peter,

    After asking around, this problem has been seen before and may be related to a specific version of CCS.  Make sure you're running the latest version and/or have all the updates from the "Check for Updates" menu item. See if that helps.

    Sean

  • Sean,

    Sorry I did not get back earlier. 

    When the problem first showed up, I updated CCS and the compiler. So it shows up in the latest version.

    The problem went away, and once I had working code, I moved on to the next pressing issue.

    When I get some slack, I'll try to reproduce the error and give you more specific description.

    Thanks,

    Peter 

  • Peter,

    No worries.  If there still is a problem when you get back to this issue, we may need to work with the CCS team.

    Sean

  • I'm using 4.2.4.0033 with an EK-LM4F232 and see the same issue.  Whenever this happens, I close and re-start CCS and the missing SysTick interrupt problem seems to go away, for a while.  I've also seen the debugger show the wrong branch taken in an if...else construct.  There are indeed some issues in CCS when debugging realtime code, so I always have a serial port (configured for a high rate) and a few I/O pins I can toggle, for debugging without using the CCS debugger.

  • I see similiar behaviour with CCS 5.2.0.00069 on LM4F232 eva board and it is fairly nasty - I cannot belief this debugger any more...

    The SysTick Timer runs and get reloaded (as I see) but no interrupt handler gets called!

    @TI staff: Is there any solution for this ?

  • Jens,

    Make sure you are running the latest version of CCS.  It can be downloaded here: http://processors.wiki.ti.com/index.php/Download_CCS 

    It appears that 5.3.0 is the latest version.  If you are still experiencing the problem, we can start working through it.

    Thanks,

    Sean

  • Hi,

    I had the problem with the on-CD version of CCS (5.2), and I still have the problem with 5.3.0.00090.

    I have also tried the sine_demo, and I get the same result as qs-logger (it hangs, waiting for the tick to change).

    If these programs are busy-waiting on g_ulTickCount, and I exit code composer, then everything starts working perfectly when code composer disconnects from the board.

    Dave

  • Hi,

    I restarted the debugger several times, and reinstalled CCS, but I am not sure if I ever power cycled my debug board. It turns out that when I completely powered off my board things went back to normal (at least with CCS 5.3).

    Dave