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

Want to use data for processing that I receive using UART.

Hi,

I am using UART example of SDK15.2(uart_pca1040). Actually i am sending data from Raspberry Pi to NORDIC nrf52832 using UART. Data which I transmit is well received and viewed using Putty window.

But I want to use this data for further processing in nordic alone.So where and how I can retrieve this data in my program?

Kindly Help.

  

Parents Reply
  • Hi.

    Do you mean the example found in the folder: <InstallFolder>\examples\peripheral\uart\ ?

    You can use the API function app_uart_get() and get bytes from UART, and store them in a struct for example.

    /**@brief Function for getting a byte from the UART.
     *
     * @details This function will get the next byte from the RX buffer. If the RX buffer is empty
     *          an error code will be returned and the app_uart module will generate an event upon
     *          reception of the first byte which is added to the RX buffer.
     *
     * @param[out] p_byte    Pointer to an address where next byte received on the UART will be copied.
     *
     * @retval NRF_SUCCESS          If a byte has been received and pushed to the pointer provided.
     * @retval NRF_ERROR_NOT_FOUND  If no byte is available in the RX buffer of the app_uart module.
     */
    uint32_t app_uart_get(uint8_t * p_byte);
    

    Best regards,

    Andreas

Children
No Data
Related