Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Wrong configuration for ble_app_hrs_freertos example in SDK 15.0

The sdk_config.h configuration file for ble_app_hrs_freertos example contains following definition:

#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1

This macro should be defined as 4. When it is defined as 1 then the function bsp_init() fails (NRF_ERROR_NO_MEM).

I think this is a mistake made during migration to nrfx drivers. SDK 14.2 contains this definition:

#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 4

In SDK 15.0 this is present as well but is not used. Due to migration to nrfx drivers, the ble_app_hrs_freertos example uses NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS whih is incorrectly defined as 1.

  • Hello,

    If you don't change anything in the example, ble_app_hrs_freertos, it runs through bsp_init() without problems.

     

    If you have not changed anything, then you can see in the file "apply_old_config.h" that on line 176, it says:

    #if defined(GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS)
    #undef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
    #define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
    #endif

     

    So the NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS is actually overwritten by the GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS, which is 4.

     

    But if you remove the defines for GPIOTE_ENABLED, GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS and GPIOTE_CONFIG_IRQ_PRIORITY (all the defines without NRFX_GPIOTE), then yes. I agree that it crashes after bsp_init() because of error 4, NRF_ERROR_NO_MEM.

     

    That is probably why it is not discovered, since the project runs without modification. Thank you for reporting this bug. I will report it internally, so that it is fixed in the next SDK version.

     

    Best regards,

    Edvin

Related