This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can app_timer from 15.0.0 SDK be used with mesh 2.0.1? I get nrf_nvic_state multiple definition error when I try to do so.

I am trying to use app_timer library with the provisioner example  but I get this linker error.

Linking light_switch_provisioner_nrf52832_xxAA_s132_6.0.0.elf
build/light_switch_provisioner_nrf52832_xxAA_s132_6.0.0_Debug/obj/app_util_platform.o:(.bss.nrf_nvic_state+0x0): multiple definition of `nrf_nvic_state'
(.bss.nrf_nvic_state+0x0): first defined here
Build failed

The multiple definition error is due to nrf_nvic_state being present in mesh_softdevice_init.c as well as app_util_platform.c. I had to add app_util_platform.c since app_timer.c has a dependency on it. Now how do I resolve this??

I managed to build the code by defining nrf_nvic_state as extern in app_util_platform.c but dont know its implications. Is it ok to do it this way?

Parents
  • I think nrf_nvic_state is required in the BLE SDK as well as mesh SDK hence it is defined at both location. There should be some macro check at either of the location which checks for each other's existence. For example there can be a "MESH_SDK_PRESENT" macro that can be checked in app_util_platform.c to avoid redefinition. This is true for other common resources as well...

    Can anyone from Nordic confirm this?

Reply
  • I think nrf_nvic_state is required in the BLE SDK as well as mesh SDK hence it is defined at both location. There should be some macro check at either of the location which checks for each other's existence. For example there can be a "MESH_SDK_PRESENT" macro that can be checked in app_util_platform.c to avoid redefinition. This is true for other common resources as well...

    Can anyone from Nordic confirm this?

Children
No Data
Related