OpenCores

byte count when recovering from error frame

Back to bugtracker overview.

Information:
Type :: BUG
Status :: OPENED
Assigned to ::

Description:
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

Comments:

barukula, ramesh Jun 17, 2010
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

Post a comment:
Login to post comments!

Back to bugtracker overview.

© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.