'NRF_RTC2' undeclared

Hello,

I am trying to port a project from the NRF52840 DK to a custom board where I am using the NRF52820. The code compiles fine when the project is using the settings for NRF52840 but when I adjust the settings under 'Code generation' to match that of the NRF82820 it complains that NRF_RTC2 is undeclared which it first comes across in nrfx_rtc.h at:

#define NRFX_RTC_INSTANCE(id)                                   \
{                                                               \
    .p_reg            = NRFX_CONCAT_2(NRF_RTC, id),             \
    .irq              = NRFX_CONCAT_3(RTC, id, _IRQn),          \
    .instance_id      = NRFX_CONCAT_3(NRFX_RTC, id, _INST_IDX), \
    .cc_channel_count = NRF_RTC_CC_CHANNEL_COUNT(id),           \
}

I suspect this has to do with the fact that NRF52840 has three real time counters while 52820 only has two, but I don't understand how I can work around this problem. I am not enabling RTC2 in the config file. Any ideas? Thank you.

Parents
  • Looks like the problem is coming from the RTC driver (nrfx_rtc.c). Try to disable the RTC instance in your sdk_config.h file:

    // <q> RTC1_ENABLED  - Enable RTC1 instance
     
    
    #ifndef RTC1_ENABLED
    #define RTC1_ENABLED 0
    #endif

    and:

    // <q> NRFX_RTC1_ENABLED  - Enable RTC1 instance
     
    
    #ifndef NRFX_RTC1_ENABLED
    #define NRFX_RTC1_ENABLED 0
    #endif

    You may also remove the nrfx_rtc.c file from your project if you are not using the RTC driver. Note that app_timer has its own dedicated RTC driver (drv_rtc.c).

    If you are not able to get it working, I have now converted the ticket to private. You can zip the project directory and upload it by clicking "Insert->Image/video/file".

Reply
  • Looks like the problem is coming from the RTC driver (nrfx_rtc.c). Try to disable the RTC instance in your sdk_config.h file:

    // <q> RTC1_ENABLED  - Enable RTC1 instance
     
    
    #ifndef RTC1_ENABLED
    #define RTC1_ENABLED 0
    #endif

    and:

    // <q> NRFX_RTC1_ENABLED  - Enable RTC1 instance
     
    
    #ifndef NRFX_RTC1_ENABLED
    #define NRFX_RTC1_ENABLED 0
    #endif

    You may also remove the nrfx_rtc.c file from your project if you are not using the RTC driver. Note that app_timer has its own dedicated RTC driver (drv_rtc.c).

    If you are not able to get it working, I have now converted the ticket to private. You can zip the project directory and upload it by clicking "Insert->Image/video/file".

Children
No Data
Related