• 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 » FaultISR
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
  • Forums

    FaultISR

    This question is not answered
    ephraim oved
    Posted by ephraim oved
    on Aug 11 2011 04:22 AM
    Intellectual940 points

    Hi.

     

    I use the micro lm3s6965 , it works fine.

    I added a quicksort routine , It works fine on another board ( with lm3s6965 ).

    Once I added a quicksort routine , The program hangs.

    With the debugger I see that it stops on

    FaultISR B FaultISR

    Is there a way to know the source of this problem ?.

    Please Advise.

     

    Attached the source of the quicksort.

    void swap(unsigned short *x,unsigned short *y)
    {
       unsigned short temp;
       temp = *x;
       *x = *y;
       *y = temp;
    }

    int choose_pivot(int i,int j )
    {
       return((i+j) /2);
    }

    void quicksort(unsigned short list[],int m,int n)
    {
       int i,j,k;
       unsigned short key;
       if( m < n)
       {
          k = choose_pivot(m,n);
          swap(&list[m],&list[k]);
          key = list[m];
          i = m + 1;
          j = n;
          while(i <= j)
          {
             while((i <= n) && (list[i] <= key))
                    i++;
             while((j >= m) && (list[j] > key))
                    j--;
             if( i < j)
                    swap(&list[i],&list[j]);
          }
       // swap two elements
          swap(&list[m],&list[j]);
       // recursively sort the lesser list
          quicksort(list,m,j - 1);
          quicksort(list,j + 1,n);
       }
    }

    faultisr quicksort lm3s695
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Andy Neil
      Posted by Andy Neil
      on Aug 11 2011 05:26 AM
      Guru31975 points

      ephraim oved
      Is there a way to know the source of this problem ?.

      Yes.

      There are 2 approaches:

      1. Single-step your code, and observe when it goes to the Fault ISR
        (may not be effective if the cause is timing-related);
      2. Use the Fault status, and trace back through the stack to find the cause.
        This has been discussed plenty of times on this forum - try a search.
        Your tools may provide specific facilities to help with this.
        The fault mechanism is standard to Cortex-M3, not specific to Stellaris - so general Cortex-M3 resources will be applicable; eg,
        http://infocentre.arm.com
        http://www.amazon.com/Definitive-Guide-ARM-Cortex-M3-Second/dp/185617963X/ref=sr_1_1?ie=UTF8&s=books&qid=1306159864&sr=1-1

       

      hard fault FaultISR Fault ISR fault
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Aug 11 2011 05:29 AM
      Guru31975 points

      ephraim oved
       recursively sort the lesser list

      Think about what is the key risk of doing anything recursively...?

      recirsive
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • ephraim oved
      Posted by ephraim oved
      on Aug 11 2011 05:33 AM
      Intellectual940 points

      Hi.

       

      Can you be more specific.

       

      Bye.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Aug 11 2011 06:09 AM
      Guru31975 points

      About what?

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • ephraim oved
      Posted by ephraim oved
      on Aug 11 2011 06:14 AM
      Intellectual940 points

       

      more specific about

      Think about what is the key risk of doing anything recursively...?

       

      The input to the quicsort is 20 unsigned short numbers.

       

      Bye.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Aug 11 2011 07:09 AM
      Guru31975 points

      Think  about it!

      As I said, there is a key risk of doing anything recursively - isn't there?

      It is inherent in the nature of recursion - nothing specifically to do with Stellaris or embedded systems, although the fact that these are memory constrained means that you are likely to hit the problem sooner that on PCs or other "big" systems...

      Think about what happens each time you call a function from within a function from within a function from... - can that just go on ad infinitum?

      recursive reentrant recusrion
      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