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.

  • Hello,

    I think the problem is not that you are not using the legacy drivers, but that the NRFX defines are "overwritten" by the "legacy" defines. if you look at the file "apply_old_config.h", which I assume is included in your project, you will find this sort of thing for most of your NRFX defines:

     

    #if defined (LEGACY_DEFINE)

    #undef NRFX_DEFINE
    #define NRFX_DEFINE LEGACY_DEFINE

    #endif 

     

    So all your NRFX defines are redefined to the old defines if the old defines are defined. Not the smoothest approach when changing drivers, but it is what it is at this point in time.

     

    So either define all the "old" configs to the same as the new ones, or remove them completely (not enough to set them to 0, since this will still count as defined).

     

    Try this, and let me know if it still doesn't work.

     

    Best regards,

    Edvin

  • I just gave apply_old_config.h a look, and this file ( "apply_old_config.h")  had never been part of my project (didn't know about it). The UART_ENABLED was set to zero, but not able to delete.

  • It is not easy to know what files that are included in SES, because only the .c-files are listed in the project view. 

     

    Did you get it to work? What did you mean by "UART_ENABLED was set to zero, but not able to delete"?

     

    You can e.g. comment out the whole section if you open the sdk_config.h file in plain text view, and not the CMSIS view.

     

    BR,

    Edvin

  • The section in sdk_config.h which has the legacy UART parameters is set to, UART_ENABLED 0, and works fine, but when I remove (delete) that section in plain text view

    // <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
    //==========================================================

    I get errors "compiling 'nrfx_uart.c', #error "No enabled UART instances , Check <nrfx_config.h>,.

    -thank-you.

  • If you look in nrfx_uart.c, you see that it checks for:

    #if !NRFX_CHECK(NRFX_UART0_ENABLED)

    #error "No enabled UART instances. Check <nrfx_config.h>."

    #endif 

     

    Have you defined NRFX_UART0_ENABLED to 1?

     

    BR.

    Edvin

Related