LOG written in FLASH : use memory in Release build

Hello,

I have issue with my application size which is too big to success DFU.

So i checked the memory content with nrfjprog --memrd 0x0001C000 --n 0x5C000.

I see that my prints are present in flash and consume the memory ! even if i build in release. see below an exemple.
I have that with "SEGGER_RTT_printf" and "__LOG" prints.
This looks really not normal in "release". It is not what I want.

0x00043410: 4C415620 54414449 21204445 32000A21 | VALIDATED !!..2|
0x00043420: 4F542064 20484355 65746564 64657463 |d TOUCH detected|
0x00043430: 0A212120 20643200 43554F54 41562048 | !!..2d TOUCH VA|
0x00043440: 4144494C 20444554 000A2121 54206433 |LIDATED !!..3d T|
0x00043450: 64205041 63657465 20646574 000A2121 |AP detected !!..|

Here is how I build and the configuration : 
Name="Release"
arm_use_builtins="Yes"
build_intermediate_directory="build/$(ProjectName)_$(Configuration)/obj"
build_output_directory="build/$(ProjectName)_$(Configuration)"
gcc_debugging_level="None"
gcc_entry_point="Reset_Handler"
gcc_omit_frame_pointer="Yes"
gcc_optimization_level="Optimize For Size" />

in sdk_config.h file : 
#define NRF_LOG_ENABLED 0

How can I still use this log in "debug" environment and disable in release to NOT write in FLASH which is precious.

Thank you for your help, I didn't find help on the forum.

Valentin

Parents Reply
  • Ok if I want to use the NRF_LOG_ENABLED flag, I need to use NRF_LOG_ macros.

    But is this the good way to print my application and disable prints writing in flash ?
    I would like to use __LOG and that logs do not write in flash.

    If I user NRF_LOG, I still need to compile specifically with NRF_LOG_ENABLE 0 in release.
    I will not change my sdk_config.h always when i flash for release ...

    Sry i try to understand what the best I can do.
    Thx :)

Children
Related