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

how to send uart data over ble with nrf52840 dongle

I'm working on pca10059(nRF52840 dongle) to send UART data over bluetooth to another device.

My test environment is,

Arduino Uno to send uart signal using "mySerial.write("Hello World\n");",

pca10059 device that I'm trying to develop to send uart data above to another device over bluetooth,

another pca10059 device to receive the data over bluetooth and send Serial signal to see the data on PC to make sure the "Hello World" travels fine.

(1) I've modified the project in example/ble_peripheral/ble_app_uart to send arbitrary data(series of uint8_t signal) to another dongle and I could see the data in Python IDLE.

(2) I've checked the arduino wiring is correct by testing a project below link.

https://devzone.nordicsemi.com/f/nordic-q-a/56406/how-to-set-up-a-simple-uart-connection-between-nrf-52840-dongle-and-a-microcontroller-e-g-arduino

I've changed the code (1) a little bit to see if I could send uart to the other dongle. It didn't work.

Most of what I've done is changing the TX RX pin number to suit wiring setup.

What's hard to understand is the project already has uart_event_handle function in the main.c and it uses ble_nus_data_send function just like (1) but it seems it's not responding to uart signal sent from arduino or it's not sending the received uart signal.

uart_init() was also called to activate uart.

Although I couldn't check arduino's uart signal, I'm quite sure (2) project's success in test indicates it's not a problem of connection or arduino code. Correct me if I'm wrong.

Parents
  • Hello, 

    (1) I've modified the project in example/ble_peripheral/ble_app_uart to send arbitrary data(series of uint8_t signal) to another dongle and I could see the data in Python IDLE.

    The ble_app_uart example already sends arbitrary (received over UART) uint8_t data to the connected device. Do you mean that you modified it to work with the nRF52840 Dongle (PCA10059)? Did you make any other changes to its functionality?

    I've changed the code (1) a little bit to see if I could send uart to the other dongle. It didn't work.

    How did you change the code, what functionality were you looking to implement, and what did you observe when it did not work?

    Most of what I've done is changing the TX RX pin number to suit wiring setup.

    It would be great if you could be explicit here. What changes did you make, and how is your test setup currently wired (a schematic would be very helpful to see)?

    What's hard to understand is the project already has uart_event_handle function in the main.c and it uses ble_nus_data_send function just like (1) but it seems it's not responding to uart signal sent from arduino or it's not sending the received uart signal.
    Although I couldn't check arduino's uart signal, I'm quite sure (2) project's success in test indicates it's not a problem of connection or arduino code. Correct me if I'm wrong.

    Do you receive any indication from your dongle that an UART message has been received? The best way to check this is to have it connected to a logical analyzer, but if you do not have access to one you could also for testing purposes have the dongle loop back the received message. I.e if it receives a UART tranmission, it should send it back again immediately before continuing with its application execution.
    It is always scary to assume that a certain operation or codeblock has executed successfully, without actually knowing.
    Could you share this part of the code with me, possibly?

    On a general note I would highly recommend acquiring and using the nRF52840 Development Kit for development, rather than the dongles. The dongle is a great companion to the DK during development, but a DK is much easier to work with and debug - especially so because of the on-board debugger.
    When working with the dongle it is recommended to have a look through the Dongle Programming Tutorial - but since you have already achieved the code modification and functionality in your (1) description, I suppose you know many of these things already.

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Reply
  • Hello, 

    (1) I've modified the project in example/ble_peripheral/ble_app_uart to send arbitrary data(series of uint8_t signal) to another dongle and I could see the data in Python IDLE.

    The ble_app_uart example already sends arbitrary (received over UART) uint8_t data to the connected device. Do you mean that you modified it to work with the nRF52840 Dongle (PCA10059)? Did you make any other changes to its functionality?

    I've changed the code (1) a little bit to see if I could send uart to the other dongle. It didn't work.

    How did you change the code, what functionality were you looking to implement, and what did you observe when it did not work?

    Most of what I've done is changing the TX RX pin number to suit wiring setup.

    It would be great if you could be explicit here. What changes did you make, and how is your test setup currently wired (a schematic would be very helpful to see)?

    What's hard to understand is the project already has uart_event_handle function in the main.c and it uses ble_nus_data_send function just like (1) but it seems it's not responding to uart signal sent from arduino or it's not sending the received uart signal.
    Although I couldn't check arduino's uart signal, I'm quite sure (2) project's success in test indicates it's not a problem of connection or arduino code. Correct me if I'm wrong.

    Do you receive any indication from your dongle that an UART message has been received? The best way to check this is to have it connected to a logical analyzer, but if you do not have access to one you could also for testing purposes have the dongle loop back the received message. I.e if it receives a UART tranmission, it should send it back again immediately before continuing with its application execution.
    It is always scary to assume that a certain operation or codeblock has executed successfully, without actually knowing.
    Could you share this part of the code with me, possibly?

    On a general note I would highly recommend acquiring and using the nRF52840 Development Kit for development, rather than the dongles. The dongle is a great companion to the DK during development, but a DK is much easier to work with and debug - especially so because of the on-board debugger.
    When working with the dongle it is recommended to have a look through the Dongle Programming Tutorial - but since you have already achieved the code modification and functionality in your (1) description, I suppose you know many of these things already.

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Children
No Data
Related