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

In file "nrfx_ppi.c" SDK 15.0.0 are missing log configuration lines.

Hi, everyone.
We are developing BLE project on the chip nrf52832 with SDK 15.0.0 software. In this project we are using ppi feature. During the work the program must enable and disable ppi-channels all the time. Every time when it does it - to the terminal are sent the messages as "Function: nrfx_ppi_channel_enable, error code: NRF_SUCCESS." or "Function: nrfx_ppi_channel_assign, error code: NRF_SUCCESS.". During searching the proble, in comparing with the previous version we saw that in the file "nfx_ppi.c" don't exist the next lines:

#if NRFX_PPI_CONFIG_LOG_ENABLED
#define NRF_LOG_LEVEL NRFX_PPI_CONFIG_LOG_LEVEL
#define NRF_LOG_INFO_COLOR NRFX_PPI_CONFIG_INFO_COLOR
#define NRF_LOG_DEBUG_COLOR NRFX_PPI_CONFIG_DEBUG_COLOR
#else //PPI_CONFIG_LOG_ENABLED
#define NRF_LOG_LEVEL 0
#endif //PPI_CONFIG_LOG_ENABLED

while in the file "skd_config.h" the defined options for it:
NRFX_PPI_CONFIG_LOG_LEVEL
NRFX_PPI_CONFIG_INFO_COLOR
NRFX_PPI_CONFIG_DEBUG_COLOR

aren't used anywere.

This file "nfx_ppi.c" uses the heather file <nrfx_log.h> where exist another lines:

#if NRFX_CHECK(NRFX_CONFIG_ENTRY(_CONFIG_LOG_ENABLED))
#define NRF_LOG_LEVEL NRFX_CONFIG_ENTRY(_CONFIG_LOG_LEVEL)
#define NRF_LOG_INFO_COLOR NRFX_CONFIG_ENTRY(_CONFIG_INFO_COLOR)
#define NRF_LOG_DEBUG_COLOR NRFX_CONFIG_ENTRY(_CONFIG_DEBUG_COLOR)
#else
#define NRF_LOG_LEVEL 0
#endif
#endif // defined(NRFX_LOG_MODULE)

but these lines don't have any effect on the "NRFX_LOG_INFO()" macro in "nfx_ppi.c".

Are the prefiousely-mentioned-missing-lines in file "nfx_ppi.c" are missing mistakly or there exist another option to neutralize unneeded log messages?
Any other option to neutralize unneeded message then adding these lines I couldn't find.

Thank you very much for paying the attention.

Best Regards
Boris Fridman

  • Hi Boris,

    Looks like there is a bug in nrfx_ppi.c, I think #define NRFX_LOG_MODULE_NAME PPI should have been #define NRFX_LOG_MODULE PPI. By changing this define I was able to disable/enable logging with NRFX_PPI_CONFIG_LOG_ENABLED in sdk_config.h. I'll report this internally. 

    Best regards,

    Vidar

  • Hi, Vidar

    I agree about the definition "NRFX_LOG_MODULE" because in ohter files the it is defined so, but in the file "nrfx_ppi.c"  it was defined maybe misstakely but foriginaly as "NRFX_LOG_MODULE_NAME". So maybe I should change it to "NRFX_LOG_MODULE" too. But the lines 

    #if NRFX_PPI_CONFIG_LOG_ENABLED
    #define NRF_LOG_LEVEL NRFX_PPI_CONFIG_LOG_LEVEL
    #define NRF_LOG_INFO_COLOR NRFX_PPI_CONFIG_INFO_COLOR
    #define NRF_LOG_DEBUG_COLOR NRFX_PPI_CONFIG_DEBUG_COLOR
    #else //PPI_CONFIG_LOG_ENABLED
    #define NRF_LOG_LEVEL 0
    #endif //PPI_CONFIG_LOG_ENABLED

    were missing and should they be added too if with them the logging functions as needed - doesn't show enablind/disableing channels when not needed ?

    Could you check more exactly?

    What is the importance for the definition "#define NRFX_LOG_MODULE" or "NRFX_LOG_MODULE_NAME"? Where is it checked?

  • Hi Boris,

     

    If you have a look at the nrfx_log header you can see that NRFX_LOG_MODULE_NAME is being defined along with the rest of logging parameters:

    #if defined(NRFX_LOG_MODULE) // defined to "PPI"
    #define NRF_LOG_MODULE_NAME NRFX_LOG_MODULE

    #define NRFX_CONFIG_ENTRY(x) CONCAT_3(NRFX_, NRFX_LOG_MODULE, x)

    #if NRFX_CHECK(NRFX_CONFIG_ENTRY(_CONFIG_LOG_ENABLED))
    #define NRF_LOG_LEVEL NRFX_CONFIG_ENTRY(_CONFIG_LOG_LEVEL) // ie, NRFX_PPI_CONFIG_LOG_LEVEL
    #define NRF_LOG_INFO_COLOR NRFX_CONFIG_ENTRY(_CONFIG_INFO_COLOR)
    #define NRF_LOG_DEBUG_COLOR NRFX_CONFIG_ENTRY(_CONFIG_DEBUG_COLOR)
    #else
    #define NRF_LOG_LEVEL 0
    #endif
    #endif // defined(NRFX_LOG_MODULE)

    #include <nrf_log.h>

    #if defined(NRFX_LOG_MODULE)
    NRF_LOG_MODULE_REGISTER();
    #endif

Related