Hello!
I`m using Tiva TM4C123 Launchpad to control another device via SPI. I can´t use CCS Debugger because in that case the program gets stuck in the beggining (a Sleep loop that uses: while (_clock() - t0 < dt); waiting scheme), I just load the program and I debug with printf´s.
I´m experiencing strange issues (appearing on multiple locations in the code). I´ll name one example.
In this example, the code won´t work unless I define a variable (which I don´t need & use). Here is a screen of a working version (with the declared variable, tmp):
This works ok. Now, if I comment the variable tmp, the code gets stuck in another part, it doesn´t even reach this part, it goes to FaultISR.
I discovered this by turning on the LED when I reach FaultISR (in startup_ccs.c).
I also print the NVIC_FAULT_STAT_R register, which contains 20000 value, which corresponds to NVIC_FAULT_STAT_INVSTAT - Invalid State Usage Fault. This might mean that Branch command has LSB 0 (it should be 1, Thumb instructions). But I also see in the working code that some Branch instructions have LSB 1, some LSB 0 (am I reading that correctly?! ).
Why is NOT defining a useless variable causing the Fault? How can I fix this?
If anyone can suggest anything that might point to solution, please help! I´ll try to do something to have the Debugger useful, but for the time being I can´t use it.
Thank you in advance!

