I am using nRF52832 with UARTE with EasyDMA and communication speed of 912kB/s
I am wondering how I can increase the transmission speed using nrf_drv_uart_tx() in app_uart.c directly because app_uart_put() only puts one byte per time.
I tried doing using nrf_drv_uart_tx() directly with the length set to 4 bytes but this causes the Bluetooth device to not advertise anymore.
– do I need to use nrf_drv_uart_tx() in app_uart_fifo.c ?
– do I need to make changes on MCU side?
– Or Do you have an example code using nrf_drv_uart_tx() for faster UART transmission?
My code:
———————————-
for(i=0; i <= UINT32_DataSize-4; i += 4) /* must have at least 4 bytes left */
{
while (app_uart_put_4(vBYTE_BuffToSend + i) != NRF_SUCCESS);
}——————————-
uint32_t app_uart_put_4(uint8_t *byte_4)
{
memcpy(tx_buffer_4, byte_4, 4);
#if defined(ENABLE_LOG_BCP)
NRF_LOG_ERROR("vBYTE_BuffToSend value = %d", tx_buffer_4[3]);
#endif
// max size of tx_buffer is #define UARTE0_EASYDMA_MAXCNT_SIZE 8
ret_code_t ret = nrf_drv_uart_tx(&app_uart_inst, tx_buffer_4, 4);
if (NRF_ERROR_BUSY == ret)
{
return NRF_ERROR_NO_MEM;
}
else if (ret != NRF_SUCCESS)
{
return NRF_ERROR_INTERNAL;
}
else
{
return NRF_SUCCESS;
}
}