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

USBD BLE UART Example - Central

Hi,

I am using Laird's BL654 USB dongle based on the nrf52840 and would like to convert the peripheral USBD BLE UART example (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fusbd_ble_uart_example.html) to act as a central device. I noticed a number of users on the forums have attempted something similar. However, I am new to the Nordic ecosystem of processors and BLE for that matter (coming from TI) and would like some proper guidance from Nordic regarding what they think is the best approach.

If I were to take a guess, I'd probably narrow down the differences between ble_app_uart (peripheral) and usbd_ble_uart and then copy those differences into ble_app_uart_c example?

Regards,

Robert

Parents
  • Hi,

    I believe the easiest approach would be to take the usbd_ble_uart example, and replace the ble_app_uart specific part of the code with the ble_app_uart_c code.

    That said, you can find a central version of the usbd_ble_uart example attached in this post (for SDK 15.3). I recommend to use the Segger Embedded Studio(SES) project. Note that if you are using a newer version of SES, you need to set NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED to 0 in sdk_config.h in order to get RTT logging working correctly(useful if using a DK).

  • Fantastic. Works like a charm using SoftDevice s140 v6.1.1 on both the Nordic PCA10059 and the Laird BL654 USB module (451-00004). However, the USB Serial Device does not pop up in Device Manager when I use Softdevice s140 v7.0.1. Pardon my ignorance, but is there an easy way to modify the project so that it works with the newest protocol stack?

  • Ideally, the project should be ported to SDK 16. But porting the project to use the newest SoftDevice should be straightforward. Looking at the s140_nrf52_7.0.1_migration-document.pdf, some PPI macros are changed, and BLE_COMMON_OPT_ADV_SCHED_CFG is removed, but this project are not using those.

    So to migrate to SoftDevice v7.0.1, replace the headers found in SDK_15_3_folder\components\softdevice\s140\headers , with the new S140 v7.0.1 headers.

    Then, in the SES project, change FLASH_START from 0x26000 to 0x27000, and set FLASH_SIZE=0xd9000

    Also change RAM_START and RAM_SIZE according to this figure:

     

    Might also want the loader to point to the new SD version:

     

    Then recompile the application.

  • Thank you! Brilliant, worked perfectly. I am thoroughly impressed by Nordic's organization of the application code as they relate to the wireless communication stacks. The only additional modification I made to get it to compile was to comment out #include "nrf_sd_def.h" in sdk_resources.h (line 52):

    #if defined(SOFTDEVICE_PRESENT) || defined (BLE_STACK_SUPPORT_REQD) || defined (ANT_STACK_SUPPORT_REQD)
    //    #include "nrf_sd_def.h"
    #else

    Now as you may have guessed my final question pertains to SDK 16. I found the migration guide (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Fmigration.html&cp=5_1_1_8) and at a glance it does not seem like there is too much to change but I am new to your hardware. Are there compelling reasons as they relate to this example why we should change to SDK 16? The changelog doesn't really make it seem so:

    • Added support for the nRF52833 DK and nRF52833 SoC
    • Added support for Bluetooth LE SoftDevices version 7.0.1, as well as the new SoftDevice S113
    • Added an external Tile library and a corresponding example demonstrating the "find me" feature

    Thanks.

  • Are there compelling reasons as they relate to this example why we should change to SDK 16?

    No. The main new feature in SDK 16 is support for nRF52833. There are a couple of bugs fixes in SDK 16, but nothing major related to this example.

Reply Children
Related