After an error frame, the trnasmitting node sends the packet again, but at the receiving nodes, the byte_cnt is not reset.
This gives wrong data in the received message. I fixed with resetting the byte_cnt every time the date length is received :
in can_bsp.v :
always @ (posedge clk or posedge rst) begin if (rst) byte_cnt <= 3'h0; else if (write_data_to_tmp_fifo) byte_cnt <=#Tp byte_cnt + 1'b1; else if ((sample_point & go_rx_crc_lim) || rx_dlc) byte_cnt <=#Tp 3'h0; end
instead of :
always @ (posedge clk or posedge rst) begin if (rst) byte_cnt <= 3'h0; else if (write_data_to_tmp_fifo) byte_cnt <=#Tp byte_cnt + 1'b1; else if (sample_point & go_rx_crc_lim) byte_cnt <=#Tp 3'h0; end
I'm not absolutely sure this will be the case in the last published version. In my system I removed the fifo for receiving messages...
Stefaan
After some messages received fifo messages are incorrect.i am not able to figure out the problem.i am suspecting the fifo implementation.is your code working without fifo.can you send me your code without the rxfifo.
my email id is barukula.ramesh@gmail.com
Thank you, Regards, Ramesh.B