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

Read uart data while advertising beacon

I want to use UART to read GPS data while advertising. After I add uart function to ble_beacon_example, UART API app_uart_get() always return NRF_ERROR_NOT_FOUND.What can I do? Board is nRF52-DK. SDK is nRF5_SDK_11.0.0_89a8197. This is my codemain.c

Parents
  • Hi,

    When app_uart_get return NRF_ERROR_NOT_FOUND it means that no byte is available in the RX buffer of the app_uart module. Make sure that you are actually sending data to the nRF52832 and that both the GPS module and the nRF52832 is configured with the same settings (Baud-rate, parity, flow-control) and connected correctly(RX_PIN_NUMBER/ TX_PIN_NUMBER). Regarding your code you should configure the uart event handler, uart_error_handle(), with the APP_UART_DATA_READY event, and call the app_uart_get() function every time you receive the APP_UART_DATA_READY event from the uart module. Take a look at e.g. the ble_app_uart example code to see how this is done.

Reply
  • Hi,

    When app_uart_get return NRF_ERROR_NOT_FOUND it means that no byte is available in the RX buffer of the app_uart module. Make sure that you are actually sending data to the nRF52832 and that both the GPS module and the nRF52832 is configured with the same settings (Baud-rate, parity, flow-control) and connected correctly(RX_PIN_NUMBER/ TX_PIN_NUMBER). Regarding your code you should configure the uart event handler, uart_error_handle(), with the APP_UART_DATA_READY event, and call the app_uart_get() function every time you receive the APP_UART_DATA_READY event from the uart module. Take a look at e.g. the ble_app_uart example code to see how this is done.

Children
No Data
Related