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

uart receive interrupt

OS in development environment :Windows7
HARD :(Taiyo Yuden)EBSHSN Series Evaluation Board : Central / Peripherals
CPU :(Nordic) nRF52832 / ARMR Cortex-M4F 32 bit processor 28-pin Land Grid Array / 15GPIOs / SWD
Soft Ver:nRF5_SDK_15.3.0_59ac345

Is UART reception data stored in the reception buffer when "uart_event_handle ()" is executing and waiting for BLE transmission?

  • Yokokawa-san,

    Can you please give us more context on the application you are making?

     

    Is UART reception data stored in the reception buffer when "uart_event_handle ()" is executing and waiting for BLE transmission?

    which uart_event_handle function are you referring to? is it in the main.c in ble_app_uart_c example? if yes, then it is saved in the data_array defined at the beginning of the function.

  • It uses uart_event_handle () of ble_app_uart.
    The following processing is executed in the interrupt.
    Multiple bytes could not be read.
    --------------------------------------------------------------
    switch (p_event->evt_type)
    {
        case APP_UART_DATA_READY:
            for (index = 0; index < m_ble_nus_max_data_len ; index ++)
            {
                 err_code = app_uart_get(&data_array[index]);
                 if(err_code != NRF_SUCCESS){
                      break;
                 }
            }
            if(index != 0){
                do
                {
                    uint16_t length = (uint16_t)index;
                    err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle);
                    if ((err_code != NRF_ERROR_INVALID_STATE) &&
                               (err_code != NRF_ERROR_RESOURCES) &&
                               (err_code != NRF_ERROR_NOT_FOUND))
                    {
                        APP_ERROR_CHECK(err_code);
                    }
                } while (err_code == NRF_ERROR_RESOURCES);
                index = 0;
            }
            break;
    --------------------------------------------------------------
    Is there a way to read multiple bytes?

Related