• 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 » Embedded Software » BIOS » BIOS forum » How to kill a statically configured SWI
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

How to kill a statically configured SWI

This question is answered
YQ Zhou
Posted by YQ Zhou
on Apr 12 2012 03:25 AM
Prodigy80 points

I am using CCSv4 and my SWIs are configured by CCS configuration tool or by editing the tcf file. How can I kill a queued SWI from a running SWI?

Thanks.

Zhou

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 Apr 12 2012 21:35 PM
    Guru60360 points

    Zhou,

    Please tell which version of BIOS you are using and which device this will be used with.

    Please explain fully what you mean by "kill".

    This thread will be moved to the BIOS Forum because this is a BIOS question. Please post software questions to the appropriate forum.

    Regards,
    RandyP

    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.
  • YQ Zhou
    Posted by YQ Zhou
    on Apr 12 2012 22:07 PM
    Prodigy80 points

    Hi RandyP,

    Thanks for moving the thread to the right forum.

    I found 3 directories in my CCS installation which may be related to your question:

    C:\Program Files\Texas Instruments\bios_5_41_10_36

    C:\Program Files\Texas Instruments\bios_6_31_04_27

    C:\Program Files\Texas Instruments\C6000 Code Generation Tools 7.0.3

    Is my bios version 6.31?

    By killing an SWI, I mean that if a new SWI is running and an old SWI was suspended, I want to remove the old SWI from the queue because the info or context used by the old SWI may have been invalid. I want delete the old SWI so that it will not continue to execute when the DSP is available, unless a now SWI_post() is called for it. My SWI was posted by SWI_post(&my_swi_name).

    I am looking forward to your reply because I am fixing an urgent issue.

    Thanks.

    Zhou

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Scott Gary
    Posted by Scott Gary
    on Apr 13 2012 00:42 AM
    Genius10040 points

    Zhou,

    If you are using a SWI (all capitals) then it is DSP/BIOS, and version 5.41.10.36 from your install info.

    If I understand your situation right, you have a SWI that is executing, and then it gets preempted because a higher priority SWI is readied to run.  And within that higher priority SWI, a decision is made to not continue the execution of that previously executing (but preempted) SWI.  Is that the case? 

    If so, I don’t think there is any way to cleanly do that.  Because, the context of the SWI that was preempted is sitting on the stack, and the higher priority SWI’s context has ‘stacked’ on top of it.  To properly unwind the stack, that previous SWI must resume, and then finish its execution.

    There is an API to delete a dynamically created SWI (SWI_delete()), but that can’t be called from SWI or HWI context.

    I wonder if for your case you can use an application-managed flag for the SWI that can be preempted? The higher priority SWI writes to that flag to tell the lower priority SWI to *not* continue because it was preempted.  And before that lower priority SWI does anything that it shouldn’t (after being preempted) it checks that flag to make sure it is OK? 

    You’d likely need to do a SWI_disable() before that lower priority SWI checks the flag and does its work, which will hold off the higher priority SWI from being able to run immediately, until SWI_enable() is called. 

    When that lower priority SWI sees the flag that says ‘don’t continue’, it clears the flag and then the function returns.  Then the SWI will be "done", but will still be available to be posted to do work again.  It just finished earlier than it normally would.

    It is a bit messy, but maybe it will work for your use case?

    Hope this helps…

    Scott

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • YQ Zhou
    Posted by YQ Zhou
    on Apr 13 2012 01:06 AM
    Prodigy80 points

    Thanks Scott.

    Sorry to know that there is no way to clean a stacked SWI.

    Your proposal is what I have been thinking of, however it adds overhead. This is why I am reluctant to implement it.

    Zhou

    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 Apr 13 2012 10:15 AM
    Guru60360 points

    Zhou,

    The solution Scott has outlined and that you have considered is the only direct answer to your question. With no other insight into your application, this is the only type of suggestion we can offer.

    It does make sense that something new (the higher priority SWI) could overwrite the input data or the output data of something old (the lower priority SWI). But it would seem possible that the lower priority SWI may have completed and you would not worry about it. In that case, it may be better to reconsider your priority settings for the SWI so that the first SWI will always complete before the second SWI begins.

    Another option could be to block the output of the lower priority SWI once the higher priority SWI has detected that the lower priority one is running. If the output is using a pointer, that pointer could be changed, but you have a race condition that would depend on where in the lower priority SWI the pre-emption occurred. Or if the output is moved at the end, that operation might be the only one that is blocked. Some portions of the lower priority SWI should be protected by the SWI_disable/_enable pair that Scott mentioned.

    The best solutions are always systemic solutions. Arrange the priorities and sequences to do things the way they need to be done instead of patching them to get there.

    My opinions, for what they are are worth.

    Regards,
    RandyP

    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.
  • YQ Zhou
    Posted by YQ Zhou
    on Apr 16 2012 02:41 AM
    Prodigy80 points

    Thanks RandyP and Scott.

    How can I have a higher timer interrupt which is "definitely to run" if no higher priority interrupt blocks it? Then I can use this timer to periodically clear the contents (assuming they are in global buffers) which are generated by the old SWIs.

    Zhou

    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 Apr 16 2012 06:44 AM
    Guru60360 points

    Zhou,

    Use a PRD function.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

    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.
  • YQ Zhou
    Posted by YQ Zhou
    on Apr 16 2012 07:56 AM
    Prodigy80 points

    Thanks RandyP.

    I do not know how the priority of PRD over SWI. Will PRD always run when its period expires and it will always pre-emption SWI?

    Zhou

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on Apr 16 2012 14:14 PM
    Mastermind20600 points

    Zhou,

    PRD functions run in the context of a SWI; more specifically they run in the context of the SWI called "PRD_swi."

    So, the PRD function can be preempted by a SWI of higher priority, or by a HWI.

    Steve

    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 Apr 16 2012 14:53 PM
    Verified Answer
    Verified by YQ Zhou
    Guru60360 points

    Zhou,

    I will recommend that you go through some of the BIOS training material that TI offers. You started this thread with a detail that is not covered there, but your questions now are ones that are addressed by the online training material. These training sources will help you understand things that you do not yet know to ask about and this will improve your successes with your project.

    Please go to the TI Wiki Pages and search for "BIOS training" (no quotes). You will find several links and some will offer multiple choices. Look through those for the ones that seem best suited to you. My recommendation is the "C6000 Embedded Design Workshop Using BIOS" page as a starting point, with a link to the archived version 5.93 which dealt with DSP/BIOS instead of the newer SYS/BIOS.

    The DSP/BIOS User's Guide explains what the PRD functionality is and how it compares with SWIs. The training material may be the best way to get introduced to the concepts

    Regards,
    RandyP

    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.
  • YQ Zhou
    Posted by YQ Zhou
    on Apr 22 2012 23:17 PM
    Prodigy80 points

    Thanks RandyP.

    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