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

Cannot combine BLE example with TWI example

Hi.

I'm trying to combine TWI sensor and BLE app UART examples. 

I already tried putting parts of TWI sensor example in the BLE example, but it gave errors on missing definitions for some TWI parts (even though they were enabled in sdk_config.h)

Now I tried doing it the other way around, and its giving missing definition errors on SoftDevice components. 

Output/Release/Obj/twi_sensor_pca10040/nrf_pwr_mgmt.o:C:\Users\Me\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\components\libraries\pwr_mgmt/nrf_pwr_mgmt.c:78: undefined reference to `__start_pwr_mgmt_data'
Output/Release/Obj/twi_sensor_pca10040/nrf_pwr_mgmt.o:(.rodata.pwr_mgmt_data+0x4): undefined reference to `__stop_pwr_mgmt_data'
Output/Release/Obj/twi_sensor_pca10040/nrf_sdh.o:C:\Users\Me\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh.c:83: undefined reference to `__start_sdh_req_observers'
Output/Release/Obj/twi_sensor_pca10040/nrf_sdh.o:(.rodata.sdh_req_observers+0x4): undefined reference to `__stop_sdh_req_observers'
Output/Release/Obj/twi_sensor_pca10040/nrf_sdh.o:C:\Users\Me\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh.c:89: undefined reference to `__start_sdh_stack_observers'
Output/Release/Obj/twi_sensor_pca10040/nrf_sdh.o:(.rodata.sdh_stack_observers+0x4): undefined reference to `__stop_sdh_stack_observers'
Output/Release/Obj/twi_sensor_pca10040/nrf_sdh.o:C:\Users\Me\nRF5_SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\components\softdevice\common/nrf_sdh.c:86: undefined reference to `__start_sdh_state_observers'
Output/Release/Obj/twi_sensor_pca10040/nrf_sdh.o:(.rodata.sdh_state_observers+0x4): undefined reference to `__stop_sdh_state_observers'

I synchronized sdk_config.h, I synchronized the include paths in project settings, nothing seems to work. 

What am I doing wrong here? Any help would be highly appreciated. 

Thanks in advance. 

Parents
  • Hello,

    Now I tried doing it the other way around, and its giving missing definition errors on SoftDevice components. 

    I would highly recommend that you proceed by adding the TWI sensor example's files and sdk_config configuration to the BLE app UART example, rather than the other way around.
    Adding all the BLE requirements and includes to a non-BLE project is much more tedious than adding the TWI parts to an existing BLE project.

    I synchronized sdk_config.h, I synchronized the include paths in project settings, nothing seems to work. 

    What am I doing wrong here? Any help would be highly appreciated. 

    Could you show me the contents of your User Included Directories? Please also make sure that they are included in the common build configuration.
    It also looks to me as if your path might include a forward slash, where windows would like a backwards one - please change this to match window's expectations.
    It seems that you might have done this to multiple include paths, as your error messages is both for nrf_pwr_mgmt and nrf_sdh.c files.
    Could you also confirm for me that you have added the source .c files to your project's source files?

    Best regards,
    Karl

  • Hi Karl.

    Thank you so much for the suggestions. 

    I would highly recommend that you proceed by adding the TWI sensor example's files and sdk_config configuration to the BLE app UART example, rather than the other way around.

    I did exactly this. 

    Moreover, it seems that all the timers in my sdk_config were enabled, even though they were not being used. I disabled the ones that are not being used and synchronized my sdk_config with the default one provided by Nordic's example. Then I synchronized it with the TWI example. 

    Could you also confirm for me that you have added the source .c files to your project's source files?

    I also added all the .c files needed.

    It works perfectly now. 

Reply
  • Hi Karl.

    Thank you so much for the suggestions. 

    I would highly recommend that you proceed by adding the TWI sensor example's files and sdk_config configuration to the BLE app UART example, rather than the other way around.

    I did exactly this. 

    Moreover, it seems that all the timers in my sdk_config were enabled, even though they were not being used. I disabled the ones that are not being used and synchronized my sdk_config with the default one provided by Nordic's example. Then I synchronized it with the TWI example. 

    Could you also confirm for me that you have added the source .c files to your project's source files?

    I also added all the .c files needed.

    It works perfectly now. 

Children
No Data
Related