I am running mbed-OS-5 on a NUCLEO-STM32F767ZI based board.
We communicate to the board through an ethernet connection using PuTTY.
I am wanting to print out information to the PuTTY console, however much of the data does not get printed out. It seems that the print statements that execute, i.e. output data to the PuTTY console, varies with each run, where everytime I run, the missing data varies (missing print statements varies).
I am using the following 2 statements to perform printing:
-
sprintf(Auto_Response, "N: n =<%i>\r\n", n);
-
client_sock[socket].send(Auto_Response, strlen(Auto_Response));
where we declared:
-
TCPSocket client_sock[2];
-
char[64] AutoResponse;
I am wondering if I can add a pause after the 2nd statement (the client_sock) statement, if that would allow enough time for the data to output to the PuTTY console, because perhaps the program is running too fast, that those output statements don’t have enough time to execute.
Does this assessment sound correct? i.e. need like a pause statement to allow the “client_sock” statement to execute and send that string to the PuTTY console?