AnsweredAssumed Answered

Release Mode Optimizations and Binary Creation

Question asked by Benjamin Vespone on Oct 3, 2017
Latest reply on Oct 10, 2017 by Alice_Yang

Hi All,

I have an application that is working well, but I am experiencing strange discrepancies when creating a binary (.hex) in release mode.

 

Processor: MKL17Z64

 

binary sizes under different circumstances:

Debug Mode, load onto Flash w/KDS: ~52kB (console reported binary size)

Debug Mode, generated .hex file: ~52kB

 

Release Mode, load onto Flash w/KDS: ~52kB (console reported binary size)

Release Mode, generated .hex file: ~35kB

 

If I attempt to flash the release mode .hex file with a production utility (Segger J-Flash), the code does not work. The debug version generated .hex file works fine flashing with Segger tool. Based on the code size difference, it seems to be that something was removed or optimized away. 

 

If it makes any difference, I'm using the Kinetis SDK. 

 

Any thoughts?

 

Thanks,

Ben

Outcomes