I'm currently working on a program for an 8-bit freescale chip (MC9S08QG8) in CodeWarrior v10.3 which uses the timer/ period capture to turn a frequency to an analog voltage.
I've gotten the thing to work pretty well in debug mode, but I noticed when I just flash the .abs file to the target to test the release build, it behaves as if the timer register is skewed. In other words, a 20ms period will normally turn on a DAC in debug mode (as intended). However, when the file is flashed directly, the DAC turns on at about 17.4ms. Ditto for other other cases; an event that's supposed to happen at 6.64ms happens at 5.75ms.
The code is interrupt-based - does anyone know what's different in debug vs direct flash that could cause this? Anything I can disable in debug mode to make it behave like a release build?
Let's see Debug and Release in the Desktop case:
In the Desktop World, ‘Debug’ and ‘Release’ builds have following typical meaning:
By default, debug and release mode is the same in CW10. in a MQX project, the difference between debug mode and release mode is optimization level setting.
In debug mode: optimization level is 1.
In release mode: optimization level is 4.
You can also refer Erich blog for this topic
http://mcuoneclipse.com/2012/06/01/debug-vs-release/
can this help?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------