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

Cannot receive data from smartphone with nRF52 DK and ble_app_uart_pca10040e_s112

Hello, I would like to utilize UART and NUS to both send and receive data using the ble_app_uart example as a starting point. I have tried connecting to the nRF52 DK with both the iOS nRF Connect and nRF Toolbox UART applications. However, after successfully connecting, it does not appear as if the nRF52 DK is receiving any data I send from iOS.

I am running the debugger within Segger Embedded Studios. I can easily send data using "ble_nus_data_send()" function, which is printed on the UART console on my phone, but I cannot figure out how to read data sent from my phone to the nRF52 DK. I believe the "nus_data_handler" function should read data received from the smartphone,  and print it back using "app_uart_put", but this is not happening. The nRF52 application does not throw any errors, and I have verified that "nus_data_handler" is entered, but what I send from my phone is never printed to any console. Perhaps I don't understand function "app_uart_put"?

Any help to read messages sent from smartphone to nRF52DK and then print them to the console within the debugger would be great.

Parents
  • Nevermind, I figured out my own problem Slight smile just have to iterate through "p_evt->params.rx_data.p_data[i]" array and manually log the data yourself, or send back to smartphone, or whatever you want to do.

    Still confused as to what "app_uart_put" does, if anybody could enlighten me that would be fantastic. What are the differences between "ble_nus_data_send" and "app_uart_put"? app_uart_put can only put one byte at a time, whereas ble_nus_data_send takes the entire data array as a parameter. Why would you ever want to send data with app_uart_put?

Reply
  • Nevermind, I figured out my own problem Slight smile just have to iterate through "p_evt->params.rx_data.p_data[i]" array and manually log the data yourself, or send back to smartphone, or whatever you want to do.

    Still confused as to what "app_uart_put" does, if anybody could enlighten me that would be fantastic. What are the differences between "ble_nus_data_send" and "app_uart_put"? app_uart_put can only put one byte at a time, whereas ble_nus_data_send takes the entire data array as a parameter. Why would you ever want to send data with app_uart_put?

Children
Related