• 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 handle the NMI and ILLEGAL interrupt in BIOS for c28x?
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

How to handle the NMI and ILLEGAL interrupt in BIOS for c28x?

This question is answered
tony chen
Posted by tony chen
on Apr 15 2012 22:05 PM
Prodigy240 points

Currently I am running  the SysBios 6.32.05.54 with CCS5.1 on 28335 PGF ControlCard.

I am trying to use the following code(devide by 0, and accessing invalid address)

to see what is the behavior of the system.

	UInt32 i = 1,tt,*pAdd =(UInt32*)0x300000 ;

i = i/3;
tt = (loopCnt/i);
*pAdd = tt;

But I found the program can run without any stop even with some devide-by-zero overflow .
Neither NMI and ILLEGAL interrupt was triggered.

I try to search how to handle the NMI and ILLEGAL interrupt in BIOS for c28x, but no useful information found yet:(
Is their anyone knowing the answer or having these experience?
Thanks in advance!
NMI ILLEGAL interrupt c28x
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Steven Connell
    Posted by Steven Connell
    on Apr 16 2012 21:14 PM
    Mastermind20540 points

    Hi tony chen,

    I will have to try something similar locally to see if I see the same results.  I'll try that and get back to you as soon as I can.

    Steve

    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 17 2012 13:25 PM
    Mastermind20540 points

    tony chen,

    I was able to reproduce the problem you are seeing.  I also see that the divide by 0 is happening, however the program continues on.

    I noticed that the value of 'tt' in:

    tt = (loopCnt/i);

    becomes 0xFFFFFFFF.  It may be that this is the defined result for divide by 0 on the C28x.

    Furthermore, I don't believe this is a BIOS issue, so I will request that it is forwarded to the compiler forums; they may have some further insight on this.

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Apr 17 2012 16:11 PM
    Mastermind40550 points

    The C standard says that integer division by zero is undefined behavior.  This means that the implementation (compiler+linker+library) is free to do anything at all, and may do something different every time.  Strictly conforming programs are not allowed to expect any particular behavior, including a raised signal.   Some implementations do raise a signal upon integer divide-by-zero (particularly those that have division implemented as a CPU instruction), but the TI implementation does not.  The C2800 implementation does return 0xFFFFFFFF, but that is strictly to prevent an infinite loop in the division function.  Programs should not rely on this value; they should test the divisor for zero before the division.  Anything else is non-portable.

    In short: do not divide integers by zero.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • tony chen
    Posted by tony chen
    on Apr 18 2012 00:10 AM
    Prodigy240 points

    If the devide by 0 operation will not trigger any interrupt,

    How about accessing the invalid address ?

    What's the use of NMI and ILLEGAL interrupt  for c28x?

    And how to handle these two interrupts in BIOS?

    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 18 2012 14:07 PM
    Mastermind20540 points

    Hi tony chen,

    You can use the BIOS configuration tool to handle an NMI interrupt.

    For example, if I open a C28x based BIOS configuration file (*.tcf file), I see this under the HWI manager:

    You can configure the "function" property so that it will run a particular function when triggered.  Similar for ILLEGAL.

    Please also see this document for some more information:

    http://www.ti.com/lit/ug/spru430e/spru430e.pdf

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • tony chen
    Posted by tony chen
    on Apr 18 2012 22:11 PM
    Prodigy240 points

    Hi Steve,

    I am using SysBios 6.32.05.54 with CCS5.1, in the CCS5.1, all the BIOS hwi needs to be added by assigning the interrupt number to a function manually.

    When I created a new hwi with the int number 18 (NMI for 28335), the following picture showed.

    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 20 2012 14:17 PM
    Mastermind20540 points

    Hi Tony,

    Can you try adding the following into the code of your *.cfg file?  You will need to replace "<your ISR function>" with the name of the ISR function that you want to run when the NMI is triggered.

    var Hwi = xdc.useModule('ti.sysbios.family.c28.Hwi');

    Hwi.plugMeta(18, <your ISR function>);

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • tony chen
    Posted by tony chen
    on Apr 23 2012 01:51 AM
    Prodigy240 points

    Hi Steve,

    Thanks, it works.

    By using asm(" INTR NMI"); I was able to trigger my NMI ISR.

    But I didnt find any GUI interface showing the NMI and ILLEAGLE interrupt status in CCS 5 yet.

    B&R

    tony

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Lori Heustess
    Posted by Lori Heustess
    on Apr 23 2012 09:49 AM
    Verified Answer
    Verified by David Friedland
    Guru50545 points

    Tony,

    An ILLEGAL trap (or ITRAP) happens when an illegal opcode is executed.  Often this is due to the PC going off into the weeds due to a stack overflow or buffer overflow.  There is some more information on this wiki page:

    http://processors.wiki.ti.com/index.php/Interrupt_FAQ_for_C2000#The_ITRAP_Interrupt

    For NMI - on the 2833x devices you can configure which pin on port A will be connected to NMI - this is described in www.ti.com/lit/sprufb0

    Search for GPIOXNMISEL.

    Unfortunately I'll have to defer to other experts on the CCS 5 / BIOS question.

    -Lori

    Did a reply answer your question? If yes, please click the "yes" button located at the bottom of that post.
    Visit these helpful C2000 Links!
    C2000 TI Wiki Pages
    TI Forum Sitemap
    ControlSUITE
    C2000 Getting Started
    CLA FAQs
    Workshop Material!
    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