Skip to main content
csiusa
Associate
November 7, 2008
Question

Library Example: NVIC_Init causes HardFaultException

  • November 7, 2008
  • 3 replies
  • 831 views
Posted on November 07, 2008 at 13:10

Library Example: NVIC_Init causes HardFaultException

    This topic has been closed for replies.

    3 replies

    csiusa
    csiusaAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 12:48

    I built the example provided in the Firmware Library titled AnalogWatchdog (supposed to use the ADC and interrupts) from the ADC examples, and the example never gets through the NVIC_Init() function. The code is:

    /* Configure and enable ADC interrupt */

    NVIC_InitStructure.NVIC_IRQChannel = ADC1_2_IRQChannel;

    NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;

    NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;

    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

    NVIC_Init(&NVIC_InitStructure);

    Does anybody get this to run correctly and successfully set a breakpoint in the interrupt routine stm32f10x_it.c:ADC1_2_IRQHandler()? The only interrupt I seem to be able to get this example to stop in is the HardFaultException() exception which is triggered when the example calls the NVIC_Init() library function. I am attempting to run this on an STM3210E-EVAL board.

    CC

    [ This message was edited by: csiusa on 13-10-2008 18:28 ]

    csiusa
    csiusaAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 12:48

    Finally got this going (now quite some time ago). It seems to have been that a COMPLETE build needed to be done under RIDE7. Guess using the ''make'' icon vs. rt-click, build on the project does things differently. So it was lack of familiarity with the IDE.

    CC

    ryan1
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:48

    I am also seeing the Hard Fault Exception when calling NVIC_Init() (different application though). I think the exception is generated when the NVIC_Init function tries to access the SCB->AIRCR variable. I've only noticed this after upgrading to the latest version of the ST firmware library.