• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Development Tools » Code Composer Studio » Code Composer Forum » DSP/BIOS TSK module
Share
Code Composer Studio
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Common Questions
  • Code Composer Studio Forum Usage Guidelines

  • Resources
  • Code Composer Studio (CCStudio) Product Folder
  • Troubleshooting CCS
  • CCS Wiki
  • Download CCS
  • Order CCS
  • Tools Insider Blog
  • Bug Tracking
  • DSP/BIOS TSK module

    DSP/BIOS TSK module

    This question is answered
    E2E_display_name_Mike
    Posted by E2E_display_name_Mike
    on May 14 2009 20:25 PM
    Expert1610 points

    I have a suggestion and a debug problem with BIOS.

    suggestion - can we start a new forum for DSP/BIOS?  I wasn't sure where to post my question - the CCS forum seemed the closest forum title but they really are different subjects.  If a DSP/BIOS forum exists, please point me there and forward my question.

    problem - I have created a TSK and when I run the code, inevitably the TSK will stop executing.  I think it happens during a call to SIO_issue, which blocks the TSK until a new receive buffer is ready.  The SIO is getting streaming data from the McASP.  When execution starts, it works fine but at some point something goes wrong.  Either the SIO_issue never unblocks the TSK or the kernel decides to delete (kill?) the TSK.  Other timer interrupts continue to work and the CPU load graph continues to run, but no code in the TSK executes after this "TSK crash".  Any suggestions how I can determine the cause?

    thanks,

    Mike

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • RandyP
      Posted by RandyP
      on May 14 2009 22:42 PM
      Guru60130 points

      A separate forum for DSP/BIOS is a good idea. I think a lot of times the DSP/BIOS questions get posted to the forum for the processor family on which is it running, but it could make good sense to have a collection forum for all of those. Many DSP/BIOS issues are unrelated to the processor.

      And speaking out of the other side of my mouth, could you please provide some details like which processor and platform you are running on, the versions of CCS and DSP/BIOS, and version of WIndows (they always ask that).

      If your TSK was created statically, then it should still show up in the Execution Graph. This will confirm for you that DSP/BIOS did not get mad at you and delete your task without asking - that is not something it would do. The Kernel/Object View should give you insight into what your TSK is waiting for and confirm what its status is.

      You seem to have already decided that the problem is in SIO_issue, so that may be a useful place to consider. Also, since the McASP is the active peripheral, you could always look at the frame sync on a scope to see if it is still running, but looking at the McASP RRDY bit could be useful, too, or even the data read register, but reading that tends to mess up the McASP getting data to the right place - then again, you do not care about that since everything has halted.

      Does it always take about the same amount of time before it breaks?

      What else is going on in the program? And in the task?

      How often is SIO_issue called?

      You could pepper some LOG_printf() calls in your TSK, like just before and just after the SIO_issue() call. Probably would be a lot of data, but once it locks up you will see that last several which should be good enough to confirm that you are not returning from the SIO_issue call.

      You could also create another lower priority task that monitors the McASP RRDY bit and logs how long it is active at a time. If the serial port is no longer getting serviced, then RRDY would stay active for a very long time and this other task might be able to report that.

      Of course, if SIO_issue or whatever is locking up is a higher priority task or a SWI, then your lower priority task might never execute. That would tell you something, too.

      Search for answers, Ask a question, click  Verify  when complete, Help others, Learn more.

      DSP/BIOS
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • E2E_display_name_Mike
      Posted by E2E_display_name_Mike
      on May 18 2009 11:38 AM
      Expert1610 points

      Randy,

      thanks for the reply.  Here is a little more context that you asked for:

      Platform: OMAP L-137 EVM. (But only using the C6747 core).

      System: CCS 3.3.83.13; BIOS 5.33.03; Windows XP.

      You're right these questions are always the first things asked but never seem to matter when the problem is discovered [:P]

      The program doesn't do much more than read in samples via McASP1/EDMA3.  I'm using the driver template code from PSP 01.20.00.  There also is a periodic timer that blinks an LED every second.  That continues to execute even when the TSK crashes.  But this is not too enlighteneing since a PRD is higher priority that the TSK.  I tried commenting out all the processing in the TSK after the SIO_reclaim call, but the crash still happens regardless.  The TSK while loop is basically the following:

      while (1) {

      SIO_reclaim(inStream, rx_ptr, NULL);

      [do some processing]

      SIO_issue(inStream, rx_ptr, BUFSIZE, NULL);

      }

      Based on the current serial data stream and EDMA3 frame size, a new buffer should fill ~ 1.04ms.

      I checked the input FS and other signals and they all look okay. The bug occurs a varaible amount of time after program execution begins.  Sometimes the TSK loop repeats 100 or less times; on other runs it repeats thousands of times before the bug appears.

      I'll try your idea of a lower priority TSK and check the McASP RRDY bit and post the results.  Let me know if you think of other ideas.  I'm new to using the SIO module so not sure what would cause it to suspend indefinitely or how to debug it.

      Mike

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • RandyP
      Posted by RandyP
      on May 18 2009 12:42 PM
      Guru60130 points

      I am not experienced with SIO, either, but there is a lot of good description text in the DSP/BIOS API Ref Guide spru403. At the start of the SIO module are useful points about how it works and the SIO_issue() function description has some good words, too.

      Do you have several buffers queued up before reaching this while(1) loop?

      The Kernel Object View may tell you what the SIO module is waiting to happen. And it or the Execution Graph may be able to tell you if you are spending any time in IDLE or if your task+SIO combo is in an infinite spin. Even stopping the processor could help find where you are spending the most time, but this will not help if you are pending for something to happen.

      My guess is that some kind of race condition is happening in the handling of your buffers within SIO. You might be able to figure something out by looking at the EDMA3 Param for the channel(s) used for the McASP, but that is getting to be pretty advanced debug and might be trying to guess too far ahead of what we know so far.

      Search for answers, Ask a question, click  Verify  when complete, Help others, Learn more.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • E2E_display_name_Mike
      Posted by E2E_display_name_Mike
      on May 18 2009 15:22 PM
      Verified Answer
      Verified by RandyP
      Expert1610 points

      I think I found the issue.  It's similar to your suggestion of a race condition in the buffers.  I think the external clock signal is unreliable.  The serial device that is sourcing the clk, data, and fs operates in burst mode.  I had the clk set to ~28 MHz.  I noticed with a scope the signals looked noisy and loaded with capacitance so I dropped the clk down to ~14 MHz and the problem has gone away.  My guess is the cable/connectors I'm using to attach the two eval boards does not tolereate higher speed signals.  For now I think I can do everything at 14 MHz clk.  thanks for the tips - I'll be able to use them for future debugging.  Actually, I already used the kernel view to reduce the size of the TSK stack :-)

      Mike

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use