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

what’s difference between debug mode and release mode?

hi,

my device is nrf52832

i run my spi sd card driver fine in debug mode, but when i download it ( F8 ), it can not work!

so my question is what is the difference between debug mode and release mode ?

could anyone help me or give me the link to solve this problem ?

thx

  • What is your environment: for example Keil, Windows 10, etc? In general, "debug" and "release" modes are "build configurations" that is sets of flags and options for the compiler. Typically debug mode means add info to the binary so that the debugger can read it and tell you where the program is in terms of symbols from the source code. Release mode typically means that info is absent. Also, release mode might disable any assertions, and perform code optimization. If debug mode works, why do you want to use release mode?

  • +1 to butch explanation

    normally development starts with debug mode so that we are able to debug the binaries which are maybe behaving as not expected or causing assertions. After debugging all known problems, it is common that you build the binary with max optimizations (for code size and/or execution speed) normally called as release mode and do a regression test on this optimized binary. There is no real definition of release mode as it depends on your make file or build configuration and what your end product requirements are. One may choose that debug and release modes settings are same if speed and code size is not of concern. Note that the debugger info is not added to the binary itself, the debugger info for most popular compilers go to a separate file, for example .ELF file which are not flashed into product memory

Related