• 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 » Microcontrollers » Stellaris® ARM® Microcontrollers » Stellaris® ARM® LM3S Microcontrollers Forum » Problem in interrupt.c of Stellaris library 8049
Share
Stellaris® ARM® Microcontrollers
  • Forum
Options
  • Subscribe via RSS
Helpful Stellaris® LM4F Series Links
  • LM4F Series
  • Stellaris PinMux Utility
  • Stellaris® LM4F120 LaunchPad
  • LM4F MCU Applications
  • LM4F MCU Video
  • ARM Cortex-M4F Whitepaper
  • Stellaris MCU Brochure
  • LM4F232 Eval Kit
  • Problem in interrupt.c of Stellaris library 8049

    Problem in interrupt.c of Stellaris library 8049

    This question is answered
    Embedded SGP
    Posted by Embedded SGP
    on Oct 11 2011 05:09 AM
    Prodigy150 points

    Hello,

    I recently updated to 8049 from 6852 version of Stellaris Peripheral Driver Library. I am using LM3S5R31. The problem is that the program gets reset because of a FaultISR. I traced the problem to IntEnable() in interrupt.c of this new library.

    It would be highly appreceiated if anybody can give me the following inputs.

    1. What are the precautions that to be taken while updating the Peripheral Driver Library.

    2. Any solution for the above problem?

    Thanks in advance
    Rajan

     

     

    Cortex-M3 driver LM3S5R31
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • TI Alex
      Posted by TI Alex
      on Oct 11 2011 09:37 AM
      Expert8210 points

      Rajan,

      Are you running the exact same code that you ran in version 6852?

      It is most likely not IntEnable(), but you trying to access a peripheral that hasn't been enabled.

      Use the following document as a reference for debugging a fault:

      ARM TRM: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0337e/DDI0337E_cortex_m3_r1p1_trm.pdf

      Section: 5.5.1 Stacking

      This section will give you the state of the stack after the exception, allowing you to debug the fault.

       

      Regards,

      Alex

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • cb1_mobile
      Posted by cb1_mobile
      on Oct 11 2011 10:38 AM
      Guru21890 points

      Of course - do follow the guides of Stellaris Alex.  Perhaps - there may be a slight change in function definition and/or parameterization - between your old and current versions of StellarisWare.  Beyond IntEnable() suggest that you check MasterIntEnable() and other, similar peripheral interrupt enables & set-ups.

      StellarisWare team does a really good job of insuring compatibility from version to version. 

      We've encountered similar problems @ clients - several times the code had been "tweaked" - would no longer run fault-free - even when rolled back to the prior version of StellarisWare - yet the newer version was "blamed."  Wise to confirm that the exact code you are now using does indeed run properly on older StellarisWare...

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Embedded SGP
      Posted by Embedded SGP
      on Oct 11 2011 20:37 PM
      Prodigy150 points

      Thanks for your inputs.

      Yes, the exact same code worked with the old stellaris driver library. Today let me try to exactly pin point the error and update.

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • slandrum
      Posted by slandrum
      on Oct 12 2011 07:28 AM
      Mastermind9510 points

      My guess is that your your startup code no longer includes the links to your interrupt handlers.  The default interrupt handler is the fault ISR.  Check the startup_xxx.c file (where xxx is replaced with something appropriate for your tool suite).

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Embedded SGP
      Posted by Embedded SGP
      on Oct 12 2011 22:43 PM
      Verified Answer
      Verified by Embedded SGP
      Prodigy150 points

      Wow.... As usual the problem was in my code.

      It worked with the old library (in rality it was not!) as the IntDisable was something like this

         else if((ulInterrupt >= 16) && (ulInterrupt <= 47))
          {
              //
              // Disable the general interrupt.
              //
              HWREG(NVIC_DIS0) = 1 << (ulInterrupt - 16);
          }
          else if(ulInterrupt >= 48)
          {
              //
              // Disable the general interrupt.
              //
              HWREG(NVIC_DIS1) = 1 << (ulInterrupt - 48);
          }

      It failed in the latest library because the the code is as below.

         else if(ulInterrupt >= 16)
          {
              //
              // Disable the general interrupt.
              //
              HWREG(g_pulDisRegs[(ulInterrupt - 16) / 32]) =
                  1 << ((ulInterrupt - 16) & 31);
          }

      Awrong number was sent (port number instead of interrupt number) and the register number in the above code (  HWREG(g_pulDisRegs[(ulInterrupt - 16) / 32]) =
      1 << ((ulInterrupt - 16) & 31);) WRONG and hence the exception/faultISR 

      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