This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Debug to Release

Hello I am using a TM4C129 (http://www.ti.com/ww/en/launchpad/launchpads-connected-ek-tm4c1294xl.html#tabs) . I understand the advantages of going from Debug to release is a reduction in memory size, which is important for my project.

My question is, how do I change the project to release mode? I have tried to right click the project properties, and then change the configuration from debug [active] to release. I then upload the project by clicking Run->Debug.

Obviously the above steps are wrong. please guide me.

Also, do I need an external programmer?

my CCS version is 6.1.2.00015 

thanks

Dan

  • Why will "Release" mode reduce code size?

    The "Debug" mode will enable "symbolic debugging" which will increase file size of generated ELF or COFF file. When the file is downloaded into target memory, those debugging information will be used by debugger, not by your target CPU. So, the binary code size is actually the same.

    If your purpose is to reduce the code size, I don't think "Release" mode will help if you don't do it right. The Release mode is usually used to disable some debug definitions such as DEBUG. This is how it reduce code size. But if you don't use conditional compilation in your source code then nothing will be different. For example, I usually use the following in by ASSERT function:

    #ifdef DEBUG
    	#define ASSERT(expr)	{ if(!(expr)){ assert_error(__FILE__, __FUNCTION__, __LINE__); } }
    #else
    	#define ASSERT(expr)
    #endif

    Once in Release mode where DEBUG is no more defined, all ASSERT() statements will be removed automatically and hence reduce the code size and increase performance.

    Please also note that most of the configurations can be changed when you switching to another mode. So, you may get unexpected result if you are not sure about all the project settings. For example, you may choose "minimum" printf() in Debug mode but have "no float" printf() in Release mode. This will result in inconsistent results.

  • Daniel daniel said:
    I understand the advantages of going from Debug to release is a reduction in memory size, which is important for my project.

    The Debug and Release configurations may have different Optimization levels set for the compiler, where higher optimization levels can change the code size.

    There are no fixed rules in CCS for what the differences are between the Debug and Release configurations, a CCS project just allows different compiler options to be set for each configuration.

  • Just FYI, to add to the previous responses, this wiki section touches on this topic:

    http://processors.wiki.ti.com/index.php/Projects_and_Build_Handbook_for_CCS#Build_Configurations