AnsweredAssumed Answered

HELP - project suddenly stopped booting unless debugging session active

Question asked by comsosysarch on Sep 22, 2011
Latest reply on Sep 29, 2011 by Mark Butcher

Working with IAR on bare-metal C/asm project.


I have had everything running for months, working through various issues until mid-August I made a successful demo.

Stashed away the demo code in an archive and a few weeks later started making mods to add more functionality.


At some point over a two-week period, I ran into a problem where my code would boot up and run just fine when a debug session was active, and I could even disconnect from the debugger and it would keep running. BUT... any attempt to reset or reboot without an active debug session would cause the processor to hang (and obviously since the debugger is not attached I do not know what is going on).


The stuff I added has to do with some code to un-block a few ascii commands (ie add a a state machine call in lieu of directly sequential processing). And I added the SYSTICK timer to assist in this.


For a while I was trying to comment out a bunch of code and find out the offending piece - but while I had this chasing down an array initializer, when I left -just- that code in it also booted just fine. Not sure if there is some issue with improper data overlay or what. IAR thinks it is a Freescale Kinetis issue although they are not more specific.


Any ideas on what to try? Or how to gather more info without using the debugger and thereby avoiding the issue?


Maybe I ship a few thousand units with the J-Link attached? And require the customer to hook it to a PC, running a licensed copy of IAR? Mmmmm... maybe not.


So what can I do other than wipe out two weeks of coding, retry, and maybe wind up down the same cul-de-sac?


I do not think my CPU is inadvertently locked. And I had the luxury of flashing another CPU and watching it do the same thing. Luckily I am able to revert to the older code in the archive and have a working product. But I'd like to have those features I worked on.