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

nRF Uart v2.0 not Receiving

I am using the eval board, sdk v5.2.0, s110 v5.0 and a galaxy nexus with the UART Nordic app. I have not been able to receive any data on the android end. After

void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)

is called i turn toggle an led. I can verifty that when i type something in my android device that it receives the message because the led will toggle. However i never get any messages back.

Much Thanks,

Nick

Parents
  • Hi, are you using a terminal on your computer to pick up the data received by your board? There is no automatic echoing implemented in ble_app_uart, so it does in other words not respond to received strings via ble. There is a startup message on the board, but it is only sent over the UART when the application starts.

    Assuming that you didn't use a terminal. What you need to do is opening the corresponding com port in a terminal with 38400 baud rate and 1 stop bit.

    Best regards,

    Vidar

    Edit: Code snippet to echo rx data to tx

    void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)
      {  
          uint32_t err_code;
          /*Echo incoming data*/
          err_code = ble_nus_send_string(&m_nus, p_data, length);
    
          //err_code = ble_nus_send_string(&m_nus, p_data, length);
          
          if (err_code != NRF_ERROR_INVALID_STATE)
             {
                  APP_ERROR_CHECK(err_code);
             }
       }
    
  • The android app is capable of receiving data from a device with an UART BLE service implemented. It does however require the peripheral to try to send data to the central (UART 2.0 app). This is not the case if you are using the ble_app_uart project in your peripheral firmware which only relays received data to the UART.

    So the fact that the LED actually starts to blink, indicates that your code works as intended.

    if you want data from the peripheral sent to the phone you have to either program the peripheral firmware to respond to incoming data or send data through the UART connection.

    If this doesn’t help, I might be able to provide a better answer if you are able to provide me with more details of what you are trying to achieve and more about your setup.

    I see that you are having issues with a production device, what kind of issues are there, and what are you trying to debug with the UART service?

Reply
  • The android app is capable of receiving data from a device with an UART BLE service implemented. It does however require the peripheral to try to send data to the central (UART 2.0 app). This is not the case if you are using the ble_app_uart project in your peripheral firmware which only relays received data to the UART.

    So the fact that the LED actually starts to blink, indicates that your code works as intended.

    if you want data from the peripheral sent to the phone you have to either program the peripheral firmware to respond to incoming data or send data through the UART connection.

    If this doesn’t help, I might be able to provide a better answer if you are able to provide me with more details of what you are trying to achieve and more about your setup.

    I see that you are having issues with a production device, what kind of issues are there, and what are you trying to debug with the UART service?

Children
No Data
Related