cancel
Showing results for 
Search instead for 
Did you mean: 

Library Example: NVIC_Init causes HardFaultException

csiusa
Associate II
Posted on November 07, 2008 at 13:10

Library Example: NVIC_Init causes HardFaultException

3 REPLIES 3
csiusa
Associate II
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 ]

ryan1
Associate
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.

csiusa
Associate II
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