send data from ble to ble with UART

I'd like to know whether the cetnral get the data from peripheral or not.
I'm using UART, it connects mcu(stm32f4) to ble module (nrf52832) and ble module gets the sensed data.
Those data should be sent to other ble module (nrf52840) with NUS.
I'm checking the data is sent from nrf52832 (peripehral) to nrf52840 (central) with RTT viewer.
Using BLE in nrf connect program, I make the nrf52840 is central (adapter) and the nrf52832 is peripheral, after scanning and connecting.
I send the hex data in peripheral, such as 31 (0x31) in TX (Write) characteristic, I can see this value in RTT viewer, it is printed there.
Should I connect the j link to nrf52840 for checking if the sent data is writtien to it or not?
I don't know how to know it.

Also, what should I do if I want to send the data from central to peripheral?

And, is it correct that using UART/NUS for sending the data from ble to another ble? it should be bidirectional (read and write).

Parents
  • Hello,

    And, is it correct that using UART/NUS for sending the data from ble to another ble? it should be bidirectional (read and write).

    Is the nRF52832 peripheral device a DK, or custom hardware?
    If it is a DK you can connect it to a computer and see the data it has received written out on a serial terminal. The default function of the ble_app_uart application is to output any data it receives over BLE to its UART.

    Also, what should I do if I want to send the data from central to peripheral?

    You can then use the peripheral's RX characteristic, instead of the TX characteristic. So the central will perform a write to the peripheral.

    Should I connect the j link to nrf52840 for checking if the sent data is writtien to it or not?

    BLE is a lossless protocol, so data can not be lost in the link. Either it will make it across to, and be acknowledged by the peer device, or the connection will be terminated (by the connection supervision timeout). So, if the connection persists, and you keep feeding data into your Central UART successfully, then you can be reasonably sure that this data makes it across to the other device.
    However, to be sure, could you perhaps scope the UART pins of your peripheral device, to see what it is outputting? Or, could you blink a LED whenever data is received, perhaps?

    Best regards,
    Karl

Reply
  • Hello,

    And, is it correct that using UART/NUS for sending the data from ble to another ble? it should be bidirectional (read and write).

    Is the nRF52832 peripheral device a DK, or custom hardware?
    If it is a DK you can connect it to a computer and see the data it has received written out on a serial terminal. The default function of the ble_app_uart application is to output any data it receives over BLE to its UART.

    Also, what should I do if I want to send the data from central to peripheral?

    You can then use the peripheral's RX characteristic, instead of the TX characteristic. So the central will perform a write to the peripheral.

    Should I connect the j link to nrf52840 for checking if the sent data is writtien to it or not?

    BLE is a lossless protocol, so data can not be lost in the link. Either it will make it across to, and be acknowledged by the peer device, or the connection will be terminated (by the connection supervision timeout). So, if the connection persists, and you keep feeding data into your Central UART successfully, then you can be reasonably sure that this data makes it across to the other device.
    However, to be sure, could you perhaps scope the UART pins of your peripheral device, to see what it is outputting? Or, could you blink a LED whenever data is received, perhaps?

    Best regards,
    Karl

Children
No Data
Related