I have an application where, as a test, I am calling an empty (nop-like) function in an implementation file from main(). If I don't call this function, GDB runs and I can step through my code in the debugger. However, if I call the function (it can be any function, and can be empty and take no arguments!), then GDB will disconnect immediately. It's reproducible 100% of the time.
I then tried to "run" the application, thinking that GDB stopping is causing my application to not work as well. I added a task that would toggle a GPIO, confirmed it worked, and then added the call to Nop(). When I ran, the GPIO no longer worked, which indicates that the program is either not running, or it's halting.
I thought maybe something was messed up when linking in that implementation file. I looked at the map file output and I didn't see anything strange. I thought maybe the task's stack size was too small, so I increased it from 1k to 4k (even 1k seems like too much), but that didn't help, either.
I then reproduced the problem with the simplest application possible -- no MQX, just a baremetal project that calls my Nop function, and it still fails to run.
I've attached the program here in case anyone has time to look at it and tell me what I am missing here... I don't understand what could have caused this, because I used an earlier version of this C file two weeks ago and was able to execute the functions calls fine!
Original Attachment has been moved to: L6470_k22f_deathtest.zip