Some bugs:
Arrays in C start at index zero. You write to index 1 to 8, instead of 0 to 7:
i++; Rx_buf_F0[i] = ...
You should declare all variables shared between main and and ISR
volatile
to protect against incorrect compiler optimizations. Also, it would seem that you have no semaphores to protectrx_fifo_F0
. Accesses to that variable will not be atomic, so if you have no semaphores you will get intermittent bugs where random garbage suddenly appears in that variable.data
is 4 bytes large yet you write to index 3 to 7.for(int k=3;k<7;k++) data[k]=Rx_buf_F0[k];
Might be more, but these are all severe bugs.