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 Hung Bui,

    I have APP_TIMER_V2_RTC1_ENABLED in the preprocessor definitions, which comes from the ble_uart example. NRFX_RTC1_ENABLED I don't use.

    In the posting you mentioned I read that the softdevice is using RTC0. When my LoRa example is using RTC1 and RTC2 that means I have no chance to unite my LoRa example and the ble_uart example due to the fact that the ble_uart example also needs RTC1.

    I my opinion a lot of confusion (not only in my case, also for many others who want to integrate two examples) comes from issues, which seems to be a kind of doubling. I my case, I can config some parts by means of sdk_config.h and also by means of preprocessor definitions. Why? There are two files nrfx_rtc.c and drv_rtc.c, which do obviously at least partly the same thing. Where is the difference between them, when I have to use which file, or which example is using this or that file for what reason?

    I'm quite sure that there are a few more such issues, and I don't understand why.

    Kind regards

    Axel

  • Hi Hung Bui,

    it seems that drv_rtc.c is an somehow outdated driver version and nrfx_rtc.c is the actual one. A description of the migration procedure from old versions to new ones we found at https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.0.2/page/nrfx_migration_user_guide.html. There is also mentioned that the old drivers for clock, power, and rng can't be migrated due to their complex dependencies.

    Knowing these issues, it is extremely pity that in Nordic's examples a number of old drivers are used. It would be nice to have examples with the actual versions, especially in case of merging these examples with other ones using the new driver versions.

    Is there a chance to have the examples updated in next versions of the SDK? For people starting with nRF programming, it seems not wise to use outdated drivers at first. Confusion and frustration might follow...

    Kind regards

    Axel

  • Hi Axel, 
    It was a little bit messy I agree. The nRF5 SDK has unfortunately discontinue 4 years ago. We don't have further development on this SDK since then. 

    Since the timer is not a very complex peripheral, my suggestion is to try adapting the driver/application to use nrfx_rtc.c instead of drv_rtc.c.

    I'm not so sure if the ble_uart uses rtc, could you show that in the code ? 

    axel_s said:
    I can config some parts by means of sdk_config.h and also by means of preprocessor definitions. Why?

    Its just how it is. You can configure the definition in both preprocessor and sdk_config.h. The preprocessor definition is more chip dependent where the sdk_config.h is more application dependent. 

Related