Hello , I'm using Kail MDK 5.29 with the Texas instrument board " LM4F120H5QR " , it was working fine along time ago ....however when i try to recompile some old simple programs using the debugger mode it always enter this FaultISR infinite loop !! ...
As you can see it doesn't show the Local variables and it never get out of this Loop ....I already installed the required Packs , What do you suggest me to do ?
Thank you
So your code is generating a Fault.
There is plenty of info available on debugging ARM Faults; eg,
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/Babcefea.html
Joseph Yiu's "Definitive Guide to ARM® Cortex®-M3 and Cortex®-M4 Processors" has a whole Chapter on "Fault Exceptions and Fault Handling"
https://www.elsevier.com/books/the-definitive-guide-to-arm-cortex-m3-and-cortex-m4-processors/yiu/978-0-12-408082-9
Am_Eng said:Texas instrument board " LM4F120H5QR "
and are you using Texas Instruments code with it?
If so, Texas Instruments would be the ones to ask - whether their code has any specific features to help you catch & debug the Fault & its Cause
Am_Eng said:it never get out of this Loop
As the code comment says, that's exactly what it is intended to do!
Thank you for your replay but it's not a Texas instrument code it's a very simple "C" Code ---> ( just a variable counter ) , as it appeares below , the IDE is working on Simulator (not real board).
#include<stdio.h>
int main() { int Counter = 0; Counter++ ; Counter++ ; Counter++ ; }
Am_Eng said:replay
* reply
Am_Eng said:it's not a Texas instrument code
might still be worth looking to see if they do provide some useful stuff to help ...
Am_Eng said:it's a very simple "C" Code
So if you step it in the debugger, where exactly does the fault occur?
Again, have you done some research on ARM Fault Handling?
Thank you for your reply , the debugger doesn't enter the main function it start from the beginning to enter the "startup.s" file (which contains the ISR) ,My case is different then the others whom posted for the same issue because i'm running the debugging mode on the "Simulator not the real Board" hence i don't need to configure any clock issues or unlock ports (as it's required for the real board ) .
So the problem lies in your "startup.s" file, then!
So step through that, and see where it fails!
Am_Eng said:i'm running the debugging mode on the "Simulator not the real Board" hence i don't need to configure any clock issues or unlock ports
Hmmm ... I'm not so sure about that.
The Simulator does still need to be correctly configured.
And the Simulator will correctly simulate a Fault if your code does (or fails to do) something to generate a Fault.
Thank you Andy for your help , Everything is working fine now.....i believe the problem was a compatibility problem with newest version of Kail and Windows 7 , i installed a 21a Version and the debugger works fine now ...
I configured a simple project for the LM4F120H5QR in uVision 5.29, and got the same behavior (execution stops in FaultISR). In the startup.s file, there's a conditional test, shown below. The target defines CPU to be Cortex-M4.fp.sp, which doesn't match the test, so those few lines aren't assembled into the output file.
IMPORT __main IF {CPU} = "Cortex-M4.fp" LDR R0, =0xE000ED88 ; Enable CP10,CP11 LDR R1,[R0] ORR R1,R1,#(0xF << 20) STR R1,[R0] ENDIF B __main
Changing the test to use Cortex-M4.fp.sp (to match the compiler command line argument) got a "working" simulation. Working in the sense that it didn't hit FaultISR. Maybe the difference between older/newer version of Keil is in the startup.s file?
Sounds a lot more likely than a compatibility issue with Windows 7!
Yeah, that would make sense. For what it's worth those lines enable the Floating Point Extension. If those lines are skipped over, executing any Floating point instruction in the code, will result in a fault. A walk through of the error itself and how to find the instruction which caused the fault in general can be found here
Hi adam I am aslo facing same issue i tried changing the cpu to cortex-m4.fp.sp still issue exsist.do you have any other solution?
nisharamanak - Did you look at the links chrisc11 provided a year ago?
Also the links I provided back then.
Here's some more links on debugging Hard Faults:
https://community.arm.com/developer/ip-products/system/f/embedded-forum/3257/debugging-a-cortex-m0-hard-fault
nisharamanak Are you using compiler 5 (ARMCC) or compiler 6 (ARMCLANG)? Each compiler defines the CPU type differently, and neither is compatible with the original startup.s file.
If after compiler-specific modifications to startup.s you are getting hard faults, then use one of the links provided elsewhere in this thread to find the source and fix it.
nisharamanak hey, Keil doesn't state the memory of the TIVA-C µController Right;after you select your µControllerKeil automatic sets the RAM definition Like this :When you go to the datasheet, you'll find that this is wrong,So go back and change those memory addressFinally, don't forget to check the memory layout box in the Linker tab, otherwise, your memory definition is not considered.This is how the error solved for me.
Hi I am using compiler 5 I have not made any update in startup file ,my initial target is to just run a counter program and observe the registers
HI Am_eng , I tried this but still there is a faultisr