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.

SysBIOS Freezes for short periods

Other Parts Discussed in Thread: MSP430F5324, SYSBIOS

We are using Sys/BIOS on MSP430F5324/28 MCUs. We have 4 tasks which are mostly waiting on semaphore. We have a few Interrupts on P1 & P2 but they are low frequency. One is just for UART which responds to commands sent from a computer and the other is on an a pulse which ticks about 300 times a second. 

The system seems to run without any problems even when fully 'loaded' which means all the interrupts are firing etc. Suddenly it becomes unresponsive for a few seconds and then resumes normal activity. The feeling one gets is similar to the experience with a desktop which waits for a few seconds while waiting on something like HDD. 

The application does not use any dynamic memory allocation within itself. It uses 2 clock functions. 

Basically we can't figure out why the system should 'freeze' for a few (2-4) seconds and then resumes normal response. 

BIOS version 6.35.1.29

XDC Tools version 3.25.0.48

  • Hi Mohammed,

    How are you determining that the system has become unresponsive ? If you can provide some background on your application that would be helpful. One other thing that is unclear to me is that do you have 2 separate MSP430s and if so how are they interacting ?

    Best,

    Ashish

  • Ashish,

    There is a continuous dump from the board to the monitoring system via UART. This output suddenly freezes and then restarts in 2-3 seconds.

    The system uses only a single MCU. I meant to say that we use either one of the two SKUs

    The application is controlling a motor and getting input from UART and an quadrature input from an encoder. 

    Speed is not an issue because if the motor is run at full speed there is no issue however when commands are fed this problem gets exhibited.

    This is not a logic issue in the program because we are using independent tasks there is no code to wait or loop.

  • Mohammed,

    I just saw your post, and am jumping in based upon the note that the application freezes for 2-3 seconds.   

    Two seconds is the rollover delay of the 16-bit timers when running at 32KHz.    I’m wondering if you are using TickMode_DYNAMIC for the Clock module?  If so, you might try using TickMode_PERIODIC to see if that changes the behavior. 

    How two switch is described here: http://processors.wiki.ti.com/index.php/SYS/BIOS_for_the_MSP430#Switch_Clock_module_from_using_TickMode_DYNAMIC_to_TickMode_PERIODIC

    There are some application constraints for using TickMode_DYNAMIC listed here: http://processors.wiki.ti.com/index.php/SYS/BIOS_for_the_MSP430#Clock_Tick_Suppression

    I’m guessing that servicing of the timer interrupt (and the running of the Clock Swi that processes timeouts) might be delayed too much in your application, resulting in a necessary wrap of the timer count (2 seconds later) for the next timer interrupt to fire…

    Regards,
    Scott

  • Scott, 

    That is a great angle you've thought of, however I am using PERIODIC and not DYNAMIC CLOCK for the tick for SysBIOS. Also I am not using Swi. The MCU is running at 25Mhz and the clock tick is 1ms. I am using about 3 SysBIOS timers though (not sure if they can be considered Swi). They are 5ms and really don't do much so I think they get over within a few microseconds. I am also using DriverLib.

    Any other suggestions for investigations would be very welcome.

    Thanks!

    Mohammed

  • Mohammed,

    Thanks for the additional information.  

    If it is indeed a 2 second freeze, it really feels like the timer wrap situation.  This could be due to a long period where interrupts are disabled, or due to a long-running ISR, either of which hold off execution of the timer ISR for more than one Clock tick period.

    Just to clarify…  Are you sure there isn’t a long duration with interrupts disabled?  Or a 1+ msec duration ISR?  And can you tell if the freeze is really 2 seconds versus 3?

    After the version of SYS/BIOS that you are using (6.35.1.29), we’ve made some improvements to better accommodate late servicing of the timer’s ISR.  In the version you have DYNAMIC mode is most susceptible to late servicing (as described on the wiki page), but even PERIODIC mode can have problems if the timer’s ISR is held off too long.  

    Is it possible for you to upgrade to later SYS/BIOS and XDCTools releases (with the improvements)?  For example, 6.37.00.20 (and XDCTools 3.25.04.88), or later, available here: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/index.html

    Thanks,
    Scott