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

Sending information over Nordic UART

Hello,

I am using nrf52832 Dev Kit and am attempting to send information using the ble_app_uart example under SDK version 15 (I don't know the exact rev, but I downloaded it fairly recently in January).

The example uses the terminal (I'm using PuTTY) to send the data; any data must be typed into the terminal to trigger the APP_UART_DATA_READY event. I have tried using app_uart_put() to trigger the event but it doesn't seem to trigger it. Is there is a way to trigger that event besides typing into the terminal?

I have also seen a couple references to LF (see references below). The first reference mentions that it terminates the data stream and the other mentions something similar to my problem and the fix was to add LF to the end of the transmission. What is the LF that is being referenced and how do I add it?

Thanks for any help!

References: 

1. https://devzone.nordicsemi.com/f/nordic-q-a/30044/uart-api-explanation-fifo

2. devzone.nordicsemi.com/.../cannot-receive-uart-on-ble_app_uart-with-nrf52382

Parents
  • In the main application file of Nordic UART located at nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart\main.c:  Line 520

    The characters from the terminal are registered into data_array[index] until someone press a newline '\n' or a carriage return '\r' or you have already typed 20 characters as shown in the code 

            case APP_UART_DATA_READY:
                UNUSED_VARIABLE(app_uart_get(&data_array[index]));
                index++;
    
                if ((data_array[index - 1] == '\n') ||
                    (data_array[index - 1] == '\r') ||
                    (index >= m_ble_nus_max_data_len))
                {
                  ...
                  ...
                  ble_nus_data_send

    You can ofcourse change that logic to transmit over BLE as your receive from UART

Reply
  • In the main application file of Nordic UART located at nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart\main.c:  Line 520

    The characters from the terminal are registered into data_array[index] until someone press a newline '\n' or a carriage return '\r' or you have already typed 20 characters as shown in the code 

            case APP_UART_DATA_READY:
                UNUSED_VARIABLE(app_uart_get(&data_array[index]));
                index++;
    
                if ((data_array[index - 1] == '\n') ||
                    (data_array[index - 1] == '\r') ||
                    (index >= m_ble_nus_max_data_len))
                {
                  ...
                  ...
                  ble_nus_data_send

    You can ofcourse change that logic to transmit over BLE as your receive from UART

Children
No Data
Related