I'm not sure if this is a Keil issue or a TI processor issue, so if I am in the wrong place just let me know.
I was trying to use the pow() function from Keil's math.h library on a TI TM4C123GH6PM to solve some polynomials, but that function seems to intermittently crash the system. It seems to happen about one in ten attempts, and doesn't seem to depend on the data I'm using. It will sometimes crash with a set of parameters, and when I run it again with the same set of parameters it works fine. I tried to see what was happening using the debugger, but the disassembly just shows it to be sitting in the reset code after the crash, of course. It isn't hard to recreate this function with for loops, so that's what I did, but I'm curious why this function doesn't seem to work.
Any ideas?
Make sure you have an adequate stack, and have a Hard Fault Handler which can provide diagnostic output about the location and nature of the fault, and the registers and core state.
community.arm.com/.../5414
I had some time to look into this further. The fault is an "Invalid PC Load Usage Fault," which is apparently often caused by stack corruption or stack overflow. I changed the stack to 0x01000, and that seems to fix it. Although I still don't know why that function seems to use so much memory.
I'm not entirely familiar with memory debugging these types of issues in uVision. Is there a way that I can see how big my stack is getting?