Hello,
In my project i am using nrf52840 with custom board, here i am using BLE UART to send the data from the mobile to device and sending data from another sensor board device to controller board over RS232 UART communication but i can able to send the data from the mobile to device over BLE UART but i couldn't receive the data sensor board to controller board this is the hurdle i am facing i have used the app_uart_get function also but it didn't work for me, In uart event handler also i have checked there is no any data received from the sensor board.
1. First thing how can i configure the TX,RX pins for example if i have used TX,RX pins as 6,8 then BLE UART is working fine but if i have changed it to custom board pins(RS232) 3,4 then its not work so please let me know how to configure the pins.??
2. is it possible to use two UARTs.??
thank you.
void uart_event_handle(app_uart_evt_t * p_event) { static uint8_t data_array[BLE_NUS_MAX_DATA_LEN]; static uint8_t index = 0; uint32_t err_code; NRF_LOG_INFO("I AM IN UART_EVENT_HANDLER"); NRF_LOG_FLUSH(); NRF_LOG_INFO("data_array:%d",data_array); NRF_LOG_FLUSH(); switch (p_event->evt_type) { case APP_UART_DATA_READY: UNUSED_VARIABLE(app_uart_get(&data_array[index])); NRF_LOG_INFO("s:%d",data_array); NRF_LOG_FLUSH(); index++; if ((data_array[index - 1] == '\n') || (data_array[index - 1] == '\r') || (index >= m_ble_nus_max_data_len)) { if (index > 1) { NRF_LOG_DEBUG("Ready to send data over BLE NUS"); NRF_LOG_HEXDUMP_DEBUG(data_array, index); 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; case APP_UART_COMMUNICATION_ERROR: APP_ERROR_HANDLER(p_event->data.error_communication); NRF_LOG_INFO("Communication error"); NRF_LOG_FLUSH(); break; case APP_UART_FIFO_ERROR: APP_ERROR_HANDLER(p_event->data.error_code); NRF_LOG_INFO("FIFO error"); NRF_LOG_FLUSH(); break; default: NRF_LOG_INFO(" defualt break"); break; } data_init(data_array); // memset(data_array,0,20); }