When using serial communication between DSP F28379d and MATLAB / Simulink using C Mex functions, certain moments present errors in the received control variables.
For reading and writing on the serial port I use the commands "serialSendBuff((unsigned char *)&Id_bits,2)" and "serialReceiveBuff((unsigned char *)&Vd_bits,2)".
In this situation, what is the best strategy to identify the error and correct it?
I see two alternatives. First alternative, use the values from the previous step of the variables with error. Second alternative, ask the DSP to resend these variables?
Is there another possibility? What is the most common to be done?