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

Running ble_app_uart on nrf52832 DK using the nrf52840 Bluetooth Dongle instead of a USB cable

I have an nrf52832 DK, which when on, constantly obtains and sends accelerometer data from an IMU to whatever BT device it is connected to. I also have an nrf52840 Bluetooth dongle.

I want to run the ble_app_uart app on my PC and get the data from the nrf52832 DK (using the bluetooth dongle to connect PC to DK instead of a USB connection)

I have researched extensively and have found examples on :-

  1. How to connect the nrf52832 DK to my PC using a USB cable, and then run ble_app_uart. 
  2. How to configure only the BT dongle (code blinky example to turn dongles light on or off)

However, none of these two examples are useful to me because

  1. One of my restrictions is that I cant use a USB cable to program my nrf52832 DK, so all examples that use a USB cable are automatically voided.
  2.  I need to use the BT Dongle as just a means to connect to my nrf52832 DK, thus all examples that use the dongle to program on it are also voided.
  • I had tried doing this before, to no avail. However I will try it again. According to this explanation, going from the UUIDs in the image I have attached, I have set the following UUIDs

    #define BLE_UUID_NUS_SERVICE           0x11F9               /**< The UUID of the Nordic UART Service. */
    #define BLE_UUID_NUS_RX_CHARACTERISTIC 0x11FA               /**< The UUID of the RX Characteristic. */
    #define BLE_UUID_NUS_TX_CHARACTERISTIC 0x11FB               /**< The UUID of the TX Characteristic. */

    Yet, I am getting the same error. 

    One doubt that I do have is - do we not have to change any of these constants - 

    1. NUS_BASE_UUID
    2. BLE_UUID_CCCD
    3. BLE_UUID_CHARACTERISTIC
    4. BLE_CCCD_NOTIFY

    And in nRFConnect I had to write a string using TX characteristic, (the string was 0x300400844203FD), here I am doing it like this and was wondering if it was okay - 

    (void) ble_nus_c_string_send("0x300400844203FD", sizeof("0x300400844203FD"));

    Thank you.

  • #define BLE_UUID_NUS_SERVICE           0x11F9               /**< The UUID of the Nordic UART Service. */
    #define BLE_UUID_NUS_RX_CHARACTERISTIC 0x11FA               /**< The UUID of the RX Characteristic. */
    #define BLE_UUID_NUS_TX_CHARACTERISTIC 0x11FB               /**< The UUID of the TX Characteristic. */

    The UUIDs above are correct, but you also need to update NUS_BASE_UUID so it corresponds with your base UUID:

    // Based UUID: 12b5xxxx-ed67-4276-8e6d-7072eb0edfa9 
    #define NUS_BASE_UUID    {{0xa9, 0xdf, 0x0e, 0xeb, 0x72, 0x70, 0x6d, 0x8e, 0x76, 0x42, 0x67, 0xed, 0x00, 0x00, 0xb5, 0x12}} /**< Used vendor specific UUID. */

  • Thanks a lot for letting me that, after two weeks I am finally able to discover the services! 

    The last thing that remains is continuously obtaining the accelerometer values from the nRF52832 and printing them. Right now, I think I am able to discover both the RX and the TX services, however, when I press "Enter" to enable notifications on UART TX Characteristics, the console just says that it received an unhandled event. You can see the problem in the attached screenshot. 

    I suspect this might be because of the line  containing ble_nus_c_string_send as I mentioned before.

    (void) ble_nus_c_string_send("0x300400844203FD", sizeof("0x300400844203FD"));

    Thank you.

  • That's some progress at least Slight smile The un-handled event number 0x3C is for BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE, and is safe to ignore. This event is raised once the write command (ble_nus_c_string_send()) has been received by the peripheral as you can see from the message sequence chart here: GATTC Characteristic Value Write Without Response

    Have you debugged the peripheral to check if the notifications get enabled or not?

  • Have you debugged the peripheral to check if the notifications get enabled or not?

    I'm sorry, I tried to figure it out, but I don't understand how to debug the peripheral to check if the notifications are enabled. 

Related