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

Combining RTC example(peripheral) and with BLE peripheral

Hello,

I want to combine the RTC example from the peripheral to one of the BLE peripheral examples but the problem is that the BLE peripheral examples need the softdevice whereas the RTC example won't work with that softdevice uploaded.Please help me in this regard.

Thanks.

I am using nrf52 and sdk 11.0

Parents
  • Hi,

    The SoftDevice uses the RTC0 instance, so you need to use RTC1 or RTC2 instead. You can find a list of the peripherals the SoftDevice uses here.

    To use RTC1 instead of RTC0, change

    const nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(0);
    

    to

    const nrf_drv_rtc_t rtc = NRF_DRV_RTC_INSTANCE(1); 
    
  • The examples in the folder SDK_folder\examples\peripheral does not use the SoftDevice, and are placed/flashed to the bottom of the flash-memory on the nRF52. The Bluetooth examples in the SDK_folder\examples\ble_peripheral folder uses the SoftDevice. The SoftDevice is placed at the bottom of the flash, while the application code (your code in Keil) is placed on top of where the SoftDevice is located in the flash-memory.


    If your goal is to combine the RTC example with an example in the ble_peripheral folder, you should use the ble_peripheral example and add the RTC functionality/code to that example.

Reply
  • The examples in the folder SDK_folder\examples\peripheral does not use the SoftDevice, and are placed/flashed to the bottom of the flash-memory on the nRF52. The Bluetooth examples in the SDK_folder\examples\ble_peripheral folder uses the SoftDevice. The SoftDevice is placed at the bottom of the flash, while the application code (your code in Keil) is placed on top of where the SoftDevice is located in the flash-memory.


    If your goal is to combine the RTC example with an example in the ble_peripheral folder, you should use the ble_peripheral example and add the RTC functionality/code to that example.

Children
No Data
Related