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

SEGGER_RTT_CONFIG_DEFAULT_MODE blocking app

If SEGGER_RTT_CONFIG_DEFAULT_MODE is "BLOCK", the program won't start without RTT attached - at least for me... is there a possible solution? I mean, technically it makes sense, because the buffer is never flushed without RTT Logger attached, but as we require the blocking logging in the current stage of the project for debugging purposes, we would have to maintain two different firmware versions to use with and without RTT logger attached

Parents
  • we had similar issues... (we are on armGCC and makefile, your mileage may vary) a simple way to get to the behavior you want this is to add a makefile command line option. something like:

    make flash RTT=NO
    

    adding the RTT option necessitate just 2 changes in the makefile, at the top of it add this:

    ifdef RTT
    ifeq ($(RTT), YES)
                LOGGING_MESSAGES := -DNRF_LOG_ENABLED=1 #add messages
    else
                LOGGING_MESSAGES := -DNRF_LOG_ENABLED=0 #remove messages
    endif
    endif
    

    and later on in the makefile add to the existing CFLAGS

    FLAGS += $(LOGGING_MESSAGES)
    

    You can do fancier things but I'm just showing a simple example. You will have to clean when you switch the options but it works. Hope this helps

Reply
  • we had similar issues... (we are on armGCC and makefile, your mileage may vary) a simple way to get to the behavior you want this is to add a makefile command line option. something like:

    make flash RTT=NO
    

    adding the RTT option necessitate just 2 changes in the makefile, at the top of it add this:

    ifdef RTT
    ifeq ($(RTT), YES)
                LOGGING_MESSAGES := -DNRF_LOG_ENABLED=1 #add messages
    else
                LOGGING_MESSAGES := -DNRF_LOG_ENABLED=0 #remove messages
    endif
    endif
    

    and later on in the makefile add to the existing CFLAGS

    FLAGS += $(LOGGING_MESSAGES)
    

    You can do fancier things but I'm just showing a simple example. You will have to clean when you switch the options but it works. Hope this helps

Children
No Data
Related