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

  • i have also tried to use 

    nrf_drv_rtc_t

    same issue just with the rtc parameters 

    you should add emojis to this chat so i can try to pass my sad tired face .. struggling with the simplest thing for a whole day 

  • Hello Ziv,

    ziv123 said:
    you should add emojis to this chat so i can try to pass my sad tired face .. struggling with the simplest thing for a whole day 

    I am sorry to hear that!
    Are you doing this by using the TIMER peripheral directly?
    In the case that you are interested in using the RTC, the easiest way you can add a timer to your project would be to use the app_timer from the timer library rather than using the TIMER peripheral directly.

    ziv123 said:
    i have tried to disable all legacy

    Given the importance of the distinction between disabled ( *_ENABLED 0 ) and removed, could you verify for me what you are doing in the code when you are 'disabling' the legacy related defines? I think you have got it correctly, but I am asking just in case. 

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

    For future reference, you might find the Migration to nrfx Guide useful to have a look at when migrating code from nrf_drv drivers to the nrfx_ drivers.

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

    I would advise against spreading your peripheral configuration defines out into the different driver source / header files.
    You should instead keep all the defines in the sdk_config or alternatively the app_config (for application-specific configurations).

    Also, you should keep in mind that TIMER0 is used for the SoftDevice - this is probably the cause of the issue you detail in your previous comment.

    ziv123 said:
    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 ?

    Could you tell me, is it an example you are trying to add the nrfx_timer to? If so, which example are you working with?

    Best regards,
    Karl

  • Hi Karl

    would be to use the app_timer

    the app timer works with the low frequency clock if i am correct. .. i need faster frequency of pin toggle (i was actually starting to do it with pwm, since the timer just took to much time so far, but i am not sure it will be accurate cause i read that it sometimes not with ble scanning at the same time, also it is much more complex to redefine the top counter and/ or frequency each time to get the change in period and maintain 50% duty cycle all the time as well) 

    Given the importance of the distinction between disabled ( *_ENABLED 0 ) and removed, could you verify for me what you are doing in the code when you are 'disabling' the legacy related defines? I think you have got it correctly, but I am asking just in case.

    i am just trying to set an instance:

    //static nrf_drv_timer_t move_timer = NRF_DRV_TIMER_INSTANCE(0)

    and i can remove or disable but i do need some of this drivers enabled i guess so ...

    I would advise against spreading your peripheral configuration defines out into the different driver source / header files.

    off course its bad practice and i don't tend to do that it was more for testing and trying to understand something maybe but i do not keep it changed.

    Also, you should keep in mind that TIMER0 is used for the SoftDevice - this is probably the cause of the issue you detail in your previous comment

    if i define NRFX_TIMER1_ENABLE i get the same issue of redefinition .. so i guess i didn't understand that 

    best regards

    Ziv

  • Hello Ziv,

    Karl Ylvisaker said:
    Could you tell me, is it an example you are trying to add the nrfx_timer to? If so, which example are you working with?

    Please clarify on this question.

    ziv123 said:
    the app timer works with the low frequency clock if i am correct. .. i need faster frequency of pin toggle (i was actually starting to do it with pwm, since the timer just took to much time so far, but i am not sure it will be accurate cause i read that it sometimes not with ble scanning at the same time, also it is much more complex to redefine the top counter and/ or frequency each time to get the change in period and maintain 50% duty cycle all the time as well) 

    You are correct - I suggested the app_timer since you mentioned that you were attempting to use the RTC.
    Which frequency will you be working with, and which timer instance ID do you have available for this?

    ziv123 said:
    off course its bad practice and i don't tend to do that it was more for testing and trying to understand something maybe but i do not keep it changed.

    I understand, that is good to hear. I just mentioned it to make sure.

    ziv123 said:
    if i define NRFX_TIMER1_ENABLE i get the same issue of redefinition .. so i guess i didn't understand that 

    Would you mind sharing the contents of your sdk_config and the error that is generated during the compilation?
    I can convert the ticket to private view if you would not like to share the code publicly.

    Best regards,
    Karl

  • hi Karl

    Please clarify on this question.

    its a code i was working on with the other project i just minimized it, the basic was the central app_ble_blinky example, to that in the other project i added the app timer, pwm, twi, uart, saadc and i think that's it . but i don't need all of that in the current project just ble scanning and a timer for pin toggling, later there will be more things like twi i think, some communication for sure.

    you mentioned that you were attempting to use the RTC.

    i thought that RTC can be configured to HF, but i rechecked the data sheet - off course you are correct

    Would you mind sharing the contents of your sdk_config

    you want the whole 12030 lines of sdk_config lines here? i am guessing i didn't understand your meaning, but the sdk_config is just defines it does not revile anything on my project to my understanding so i don't mind sharing if i understood better what to share 

    best regards

    Ziv

Related