Dear friends, I find a hard fault in my program. my compiler is IAR 7.40.3. My MCU is stm32f103RBT6 and when communicating with sim900 GPRS modem through UART2 some times them MCU halts and when debugging I see it is in the Hard Fault Handler ISR.
I don't think it would be from overflow of stack because communication include very few bytes.
The debugger does not let me use break point in the program. Thanks if you help me to know what causes hard fault?
This is a Keil forum, so why do you want help with the use of your IAR tools?
Have you considered checking where the processor came from when entering the hard fault handler?
I don't recall them having a forum.
Make a Hard Fault Handler that isn't a while loop and output diagnostic data so you can identify the specific code that is faulting and why.
You can find some useful information here:
http://www.keil.com/appnotes/files/apnt209.pdf