So, I am developing an application where I will use uart to transmit some data from the PC to the nrf board. The issue is that the data I am transferring is quite large (64KB). I have written a code that would work in terms of communication, but I seriously suspect that not all data has been transmitted. Please see the attached as an example:
#define UART_TX_BUF_SIZE 256 /**< UART TX buffer size. */
#define UART_RX_BUF_SIZE 256 /**< UART RX buffer size. */
// allocate space for the binary data
char bin_data[65536];
// function that handles receiving message from PC: as noted, I will basically pass my bin_data to the below function for getting data from the PC
bool receiveMessage(char * buffer, int start_index, bool cmd_flag) {
while (app_uart_get(&cr) != NRF_SUCCESS);
buffer[start_index] = cr;
. ..
}
I am wondering what's the solution to receive full 65536 bytes from the PC? I have tested my code such that I know the message are all correct when they are less than the buffer size.
Thanks,
Jinyue