This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Code runs in debugger, but not on power up

I have an app built in IAR using S110, SDK 7 on PCA10028 DK board that runs fine with the debugger, but if I stop the debugger and unplug and plug back in the USB cable, it does not run.

This used to work, but has recently stopped. The only thing I can think of that could have caused this is a recent update to the built in JTAG code on the board. Perhaps it is holding the Nordic CPU reset now, where it didn't before.

Does this sound like a possibility? Anyone else seen this behavior? Anyone know how to downgrade the JTAG code to a previous version to test this theory?

Thanks, Jeff.

Parents
  • And I found the answer.

    I had ENABLE_DEBUG_LOG_SUPPORT enabled, and this requires an implementation of printf. When running in the IAR debugger, there is a mechanism for "semi-hosting" that redirects printf and scanf and the like for stdio to the debugger. Running without the debugger, nowhere for that stuff to go and it hangs. Removing ENABLE_DEBUG_LOG_SUPPORT from my compile options allows the code to work from a power up without the debugger.

    Jeff.

Reply
  • And I found the answer.

    I had ENABLE_DEBUG_LOG_SUPPORT enabled, and this requires an implementation of printf. When running in the IAR debugger, there is a mechanism for "semi-hosting" that redirects printf and scanf and the like for stdio to the debugger. Running without the debugger, nowhere for that stuff to go and it hangs. Removing ENABLE_DEBUG_LOG_SUPPORT from my compile options allows the code to work from a power up without the debugger.

    Jeff.

Children
No Data
Related