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

sdk_config overwritten by sdk_old_config

hello nordic

i have been working with nrff52832 with the SDK16.0 (also working with s132 if it matters)

it is a real head braking to deal with your never ending sdk_config.h, today i found out that he has an even more evil origen which is the sdk_old_config.h 

why do we need 2 files defining the same things, seems like a very poor solution to whatever problem 

i wish to configure a timer by enabling NRFX_TIMER_ENABLE so i change it in the sdk_config.h but it does nothing, i have tried to disable every definition that seems related to legacy but still nothing changes 

please help it been to many hours of try and error with no real programing because of that

best regards and hope for better days

Ziv

  • Nothing in my SDK 16.0.0 references a file named sdk_old_config.h, so this must be in your own code.

  • Hello Ziv,

    please help it been to many hours of try and error with no real programing because of that

    I am sorry to hear about the troubles you have had with this!

    it is a real head braking to deal with your never ending sdk_config.h, today i found out that he has an even more evil origen which is the sdk_old_config.h 

    why do we need 2 files defining the same things, seems like a very poor solution to whatever problem


    I can understand how the overwrite performed by apply_old_config might seem backwards - but it is done to provide backwards compatibility for customers with projects using legacy drivers.

    In essence, to avoid having the apply_old_config overwrite your sdk_config you will have to remove all legacy driver *_ENABLED defines from your sdk_config. To be absolutely clear: you may not leave the legacy *_ENABLED set to 0, that will still leave them defined and cause the override by apply_old_config. So, to avoid this either comment out or remove entirely the legacy driver *_ENABLED defines.
    In your case, that means that you can only have NRFX_TIMER_ENABLED defined in your sdk_config - as long as the legacy *_ENABLED is defined it will overwrite the NRFX_*_ENABLED.

    For more information about this, please see the discussions in this and this ticket.

    Please let me know if anything still should be unclear.

    Best regards,
    Karl

  • I assume that Ziv is referencing apply_old_config.h here, and that sdk_old_config is a typo / oversight.

    Best regards,
    Karl

  • i have tried to disable all legacy related defines but actualy there is

    // <e> TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer
    //==========================================================
    #ifndef TIMER_ENABLED
    #define TIMER_ENABLED 1
    #endif

    in the sdk_config.h and it must be set to 1 , and also i may beed other drivers like uart, twi and such 

    BUT, it seems that if i only enable the TIMER_ENABLE and leave the NRFX_TIMER_ENABLED 0,  then it seems fine.. i think .. not sure because it creates another issue .. the nrfx_timer.c  driver does not have any dependencis for some reason .. and if i disable TIMER_ENABLE back to 0 then the dependencies return .. WTF (sorry for that but it has been half a day already and no progress in the simplest thing of adding a timer to a project)

    but i get this error in the ntfx_timer.c file

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

    and last try so far ...

    if i set the TIMER_ENABLE TO 0

    and in the nrfx_timer.h file i add the definition of NRFX_TIMER0_ENABLE 1

    #define NRFX_TIMER0_ENABLED 1 // ziv addition
    #ifndef __NRFX_DOXYGEN__
    enum {
    #if NRFX_CHECK(NRFX_TIMER0_ENABLED)
        NRFX_TIMER0_INST_IDX,
    #endif
    #if NRFX_CHECK(NRFX_TIMER1_ENABLED)
        NRFX_TIMER1_INST_IDX,
    #endif

    then i get a warning of redefinition, but if i don't write it there then it is not defined at all .. again sorry but WTF ?

    any ideas ?

Related