Softdevice example extension

Hallo,

I'm using Segger Embedded Studio to program nRF52840. In the Nordic nRF5_SDK there is the ble_app_uart example using S140 softdevice, which is running well. Now I have a dev kit from SEEED for WM1110. The software is included in the SDK according the descriptions at SEEED's wiki, the LoRaWAN example is also running well.

Now I want to integrate both examples. As recommended several times in the forum, I started with the softdevice example. I managed to include the files from the LoRaWAN example including paths, preprocessor directives etc., all files are compiling without errors. But the linker listed a number of errors.

The first error (just as an example) names multiple definitions of the RTC1_IRQHandler, which is defined in drv_rtc.c. When searching for "RTC1_IRQHandler" in the whole solutions, I have exactly identical outputs for the LoRaWAN example and my newly created combined application. The only conclusion regarding the error source seems the softdevice, which might include another definition of the handler.

How can I solve such issues? Is there any description, what files or configurations exactly are included in the softdevices (I found functional descriptions only)?

Kind regards

Axel

  • Hi Axel, 
    Please show the error log. 

    Are you saying that in the combined application if you do a full search you only see it's defined in drv_rtc.c but you still see the multiple definitions error ? 

    The softdevice doesn't use RTC1. You can see the list here: https://www.nordicsemi.com/Products/Development-software/S140

  • Hallo,

    at first: I can't find a log file as well as a place to switch it on.

    Meanwhile I'm a little confused, mainly about the config file. There are two section, which might be relevant. One is the NRFX_RTC_ENABLED (incl. RTC0/RTC1/RTC2), the other one is the RTC_ENABLED (incl. RTC0/RTC1/RTC2). What is the difference, which one should be used for which setting?

    In my LoRa example, RTC_ENABLED, RTC1_ENABLED and RTC2_ENABLED are set to 1, additionally NRFX_ENABLED is set to 1, but the single NRFX_RTCx_ENABLED are 0. Compiling and running is ok.

    In my ble_uart example, all the NRFX_RTC_ENABLED or RTC_ENABLED values are 0. Therefore, there should be no conflict when switching them on. But this leads to a "multiple definitions" error, as described.

    Furthermore, I wonder about nrfx_rtc.c. At the end of that file (lines 227, 334, and 341) there are checks for NRFX_RTCx_ENABLED. I see the lines following the NRFX_RTC0_ENABLED check grayed, but the lines following NRFX_RTC1_ENABLED and NRFX_RTC2_ENABLED check in black, i.e. the first one is 0, but the others are 1. As mentioned, in my config file all these settings are 0. When searching within the whole SDK directory, a definition of NRFX_RTCx_ENABLED signals to 1 is only done within the templates, which I don't use. But where else do these check results come from?

    The preprocessor definitions include APP_TIMER_V2_RTC1_ENABLED, which comes from the ble_uart example. But even this definition doesn't explain the positive check of NRFX_RTC2_ENABLED.

    Kind regards

    Axel

  • Hi Axel, 
    What I meant is to post the full error log where you see "multiple definitions of the RTC1_IRQHandler". You can just copy and paste the whole error you see on the screen. 


  • no problem:

    Output/Debug/Obj/ble_app_uart_pca10056_s140/nrfx_rtc.o: in function `RTC1_IRQHandler':

    multiple definition of `RTC1_IRQHandler'; Output/Debug/Obj/ble_app_uart_pca10056_s140/drv_rtc.o:/home/adminhtw/nRF5_SDK_17.1.0_ddde560/components/libraries/timer/drv_rtc.c:355: first defined here

    nrfx_rtc.c as well as drv_rtc.c are compiled without errors or warnings.

    Kind regards

    Axel

  • Hi Axel, 
    The issue is that for some reason you are enabling RTC1 for both nrf_rtc.c and drv_rtc.c 
    Please double check that you don't have NRFX_RTC1_ENABLED and APP_TIMER_V2_RTC1_ENABLED
    They can be defined in the preprocessor symbol in addition to sdk_config.h


    You can take a look here: Symbol RTC1_IRQHandler multiply defined (by port_cmsis_systick.o and drv_rtc.o). 

Related