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

NRFX migration legacy layer

I can get a clean build and working product with some workarounds, but a couple issues remain from migrating sdk 13.1 to sdk 15.0 (SES nrf52832 s132).

1) After nrf_drv to nrfx, and twi to twim conversions, the app_button.c had references to nrf_gpiote but the nrf_gpiote.c was removed and replaced with nrfx_gpiote.c in the project. Having to change the nrf references in app_button.c (an sdk file) seemed odd to get nrfx to work.

2) Also in sdk_config.h if I try to delete or set to zero GPIOTE_ENABLED I get errors:

error if set to zero: undefined reference to 'nrfx_gpiote_in_is_set'

error if deleted: builds and downloads but no advertising and scanner does not pick up the device.

but all ok when GPIOTE_ENABLED 1 when the file is not even in the project, (also NRFX_GPIOTE_ENABLED is set to one)

3) Not sure if related, but the same for UART_ENABLED. I can set UART_ENABLED to zero but not delete/remove from sdk_config.h,, even though nrf_uarte.c has been removed and not in the project.  If I try to delete the UART_ENABLED section, the error is, "compiling 'nrfx_uart.c', #error "No enabled UART instances , Check <nrfx_config.h>. I have NRFX_UARTE_ENABLED and NRFX_UART_ENABLED set to one.

With these three workarounds all is good, but I'm going for the sdk_config.h file to have no legacy layers.

-thank-you.

  • That helped, thank-you. After NRFX_UART0_ENABLED there was also NRFX_UARTE0_ENABLED and now no more UART_ENABLED legacy layer in sdk_config.h, thank-you.

    I was hoping the same for GPIOTE_ENABLED (as detailed in original question), but the error, undefined reference to 'nrfx_gpiote_in_is_set' maybe could be linked to the changes I had to make to app_button.c (nrf_drv to nrfx).

    GPIOTE_ENABLED is the last legacy layer remaining.

    -thank-you.

  • Hello,

    Have you included the files nrfx_gpiote.c/h?

    And have you defined:

    "#define NRFX_GPIOTE_ENABLED 1" ?

    Did you also define GPIOTE_ENABLED?

     

    Or did I misunderstand your question?

  • All three had already been completed, I included nrfx_gpiote.c/h,   NRFX_GPIOTE_ENABLED=1, GPIOTE_ENABLED=1, and the project works fine. It is just when  GPIOTE_ENABLED=0 that I get error: undefined reference to 'nrfx_gpiote_in_is_set'. I do not have nrf_gpiote.c in the project, and do not want this last legacy layer.

  • Could you please send the project? Or at least a project where I can replicate the issue?

     

    BR,

    Edvin

  • Hello,

    Ok. I understand. I got your project from my colleague. I see what you mean with the app_button issue.

     

    If you remove the GPIPTE_ENABLED completely in sdk_config.h. It should be sufficient to comment out GPIOTE_ENABLED, but if you intend to remove it completely, and only use the nrfx drivers, I guess you can completely remove the GPIOTE_ENABLED section.

    // <e> GPIOTE_ENABLED - nrf_drv_gpiote - GPIOTE peripheral driver - legacy layer
    //==========================================================
    //#ifndef GPIOTE_ENABLED
    //#define GPIOTE_ENABLED 1
    //#endif
    // <o> GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins 
    #ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
    #define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 4
    #endif

     

    The only error I get then is that app_button is missing nrf_drv_gpiote.h, which I assume that you have also removed. 

    All nrf_drv_gpiote.h does in SDK 15 is mapping the old nrf_drv_gpiote names to the new nrfx_gpiote names.

     

    Solutions:

    1. Either include this file, nrf_drv_gpiote.h which will map to the correct names.

    2. Alternatively, you can change the include in app_button.c from:

    #include "nrf_drv_gpiote.h"

    to

    #include "nrfx_gpiote.h"

    and then, change all the names and function calls that are used in app_button.c to the new ones in nrfx_gpiote.h. The correct names are listed in nrf_drv_gpiote.h.

     

    Best regards,

    Edvin

Related