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

nrf52840 uart0 and uart1 both used at the same time

Hi,

I want to use both UART0 and UART1 at the same time, and run the testing example from https://devzone.nordicsemi.com/f/nordic-q-a/25173/nrf52840-uart1-not-working-in-sdk-14 and it seems that the read data function from both UART is blocking until timeout, is there any other way for reading data without blocking. 

Thanks,

Parents
  • From the documentation is says:

    /**
     * @brief Function for reading from a serial port.
     *
     * @param p_serial   Serial port instance.
     * @param p_data     Receive buffer pointer.
     * @param size       Receive buffer size.
     * @param p_read     Amount of data actually read from the serial port.
     *                   NULL pointer can be passed.
     * @param timeout_ms Operation timeout, in milliseconds. Pass 0 to operate in
     *                   non blocking mode.
     *
     * @return Standard error code.
     * */
    ret_code_t nrf_serial_read(nrf_serial_t const * p_serial,
                               void * p_data,
                               size_t size,
                               size_t * p_read,
                               uint32_t timeout_ms);

    Wouldn't timeout_ms=0 do the trick?

  • Hi Keneth,

    After so many times testing, I found that the serial not work if the PC's transmission is fast(10ms probably) or the sending data size is greater than 10 bytes, do you have any ideas for that issue? thank you very much.

    Vernon

Reply Children
No Data
Related