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

Combining ble_peripheral code with peripheral (twi_scanner) code

I am currently using the ble_app_template code from examples\ble_peripheral in SDK v10. The code and BLE read/write function successfully works. I now want to combine the ble_app_template code with twi_scanner code, because I am trying to use the nrf51822 to connect to i2c sensors, get the sensor data, and then send the data over BLE to phone.

I have successfully combined two peripheral examples programs before: twi_scanner and uart from examples\peripherals in SDK v12. I did that by combining the main.c and sdk_config.h code from both examples.

When I check the ble_app_template project in Keil 5, I cannot see a sdk_config.h file anywhere. I did some research and another post said the sdk_config.h is in the config folder for the project. But in Keil the config folder is not included under the project files for ble_app_template. How should I proceed? Thank you 

  • Hi,

    SDK 10 is very old and did not use the sdk_config.h concept yet. There are several other configuration files though (such as nrf_drv_config.h), which together constitute something similar to sdk_config.h. These are typically in a folder called "config". So if you stick with this ancient SDK, then look for those files instead.

    Note that I recommend you use the latest SDK supporting your chip, which is SDK 12.3 for the nRF51.

  • Hi. 

    I'm trying to combine ble_app_uart__saadc_timer_driven__scan_mode example with TWI_sensor example. 

    I synchronized the project files in SDK, sdk_config.h files and even paths in the project settings, but I am still getting "missing definitions" errors. 

    And I tried it both ways, putting ble_saadc code in TWI_sensor gives missing definitions in SoftDevice libraries, and outting TWI_sensor code in ble_saadc gives missing definitions in TWI libraries. However, all of these are included, and enabled.

    Can you please guide me, on how to merge the two of these? 

    Best regards

Related