Hi,
my system to test CDC Kinetis MK20DX256VLL7, with C# VS2013,
whats problems:
send frame 128 bytes ARM/ PC = ok
send frame 16 bytes PC/ARM = ok
send frame 32 bytes PC/ARM = OK..failures....OK
send frame 128 bytes PC/ARM = Many failures.
all buffers in arm = 128 bytes CDC1_DATA_BUFF_SIZE 128 and others.
simple test:
Visual Studio: serialPort1.Write( str_OutBuffer, 0, 128 ); // sendo to ARM
ARM:
loop:
if (CDC1_App_Task(cdc_buffer, sizeof(cdc_buffer))!=ERR_BUSOFF){
if (CDC1_GetCharsInRxBuf()!=0){ // if have bytes received <-------
lenth = CDC1_GetCharsInRxBuf(); get numbers bytes in buffer received
clear_bufstr( 128); //clear buffer + add ( '\0' )
val = bytetochar( lenth ); // convert byte to char(X2)
buf_str[0] = (byte) (val>>8);
buf_str[1] = (byte) (val);
buf_str[127]='#';
WAIT1_Waitms(5);
CDC1_SendString( buf_str); // send to PC = ok
}
}
results:
arm received: 0x20,0x80,0x40,0x60,0x10.....
how to maker protocols to frame 128 bytes ( char/2 = 64 bytes Hex )
thanks,
Carlos.