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.

Some SYS/BIOS threads are not running.

Other Parts Discussed in Thread: TMS320DM6437

Hello,

I'm using CCS version 4.2.0.10018 and SYS/BIOS 6.30.2.42 to develop an application for the TMS320DM6437. This processor is on a custom board that we have developed.

I'm using SYS/BIOS to do all of the following.

Thread 1 - A Hwi thread (created by Hwi_create and triggered by a CAN transmit/receive interrupt).

Thread 2 - A Timer thread (created by Timer_create and triggered every 100 microseconds, used to read data from an A/D converter and to trigger the next conversion).

Threads 3 and 4 - Two Task threads (created by Task_create, one with priority 15 that periodically reads CAN packets from the bus, the other with priority 14 that periodically writes CAN packets to the bus).

All four of my threads execute just fine as long as my timer thread function simply reads the data from the A/D converter (via the SPI interface) and then triggers the next conversion.

However, when I added code to my timer thread function to insert each data point in a circular buffer, the other threads (threads 1, 3 and 4) stopped running (the timer thread continues to work just fine).

First I called a function from my timer thread function to save the data in a circular buffer. Then I made that function inline, but it made no difference. Then I stopped calling the function and instead just insert directly into the circular buffer from my timer function, but it made no difference.

I'm at a loss. All four of these thread functions are fairly simple. The circular buffer code was copied from another project and has been well tested. All of the threads should be able to "keep up".

Is this a thread priority problem? I placed breakpoints in all the threads and only the timer thread breakpoint is reached.

Does anyone have any ideas? I'm new to the SYS/BIOS real-time kernel.

Thanks,

Tim M

 

  • Tim,

    Here are 2 ideas:

    1) The extra work undertaken by the timer ISR leaves no time to context-switch back to your Tasks before the next timer interrupt comes in.  How many cycles does it take to intert the data points in your circular buffer?  If you're trying to write to non-cached DDR memory this can take a large number of cycles.

    2) Use the ROV (RTSC Object Viewer) tool in CCSv4.2 to check out the state of your two tasks after they have been created.  You will be to view a) the state of the Task (i.e. running, ready, blocked, etc) and b) what the Task is blocked on in case it is blocked.   If you see that your tasks are ready but not executing that may be a sign that your ISR(s) are consuming all your CPU time. 

    You can launch ROV by going to Tools and selecting 'ROV'.

    Regards,

    Shreyas