mcp2517fd: double transmitted message after BUS-OFF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Thomas,

I'm currently rewriting the mcp25xxfd CAN driver and observing a strange
effect on the mcp2517fd. I'll retest thi on the mcp2518fd later.

The test is to send CAN-2.0 frames at 500 kbit/s with a gap of ~100ms
with dlc=1 and incrementing CAN-ID and first data byte from can0 to
can1. Both interfaces are on the same host, both are mcp2517fd.

After some time I short CAN-H and CAN-L for several seconds, until this
problem occurs.

This is the log, ignore the fact that the CAN frames are shown as RX'ed
before TX'ed.

                                              CANID  DLC data[0]
>  (2019-12-09 19:09:04.583745)  can1  RX - -  047   [1]  47
>  (2019-12-09 19:09:04.583766)  can0  TX - -  047   [1]  47
>  (2019-12-09 19:09:04.683866)  can1  RX - -  048   [1]  48
>  (2019-12-09 19:09:04.683885)  can0  TX - -  048   [1]  48
>  (2019-12-09 19:09:05.384905)  can1  RX - -  048   [1]  48
>  (2019-12-09 19:09:05.485030)  can1  RX - -  049   [1]  49

The problem is, that can1 receives the message with CANID 048 two times.

Looking at the TEF Objects, it shows that the id=048 CAN frame is
recorded twice as send. TEF Object 0x0 and TEF Object 0x1 both have
id=0x48 and Sequence Number=0x48.

> [  125.607608] TEF Object: 0x00 (0x400)                                                                                                      
> [  125.611174]               id = 0x00000048                                                                                                 
> [  125.615190]            flags = 0x00009001
> [  125.619194]               ts = 0x344e4c79
> [  125.623195]              SEQ = 0x000048              Sequence
> [  125.627904] 
> [  125.629390] TEF Object: 0x01 (0x40c)  priv-HEAD  chip-TAIL  priv-TAIL  priv-FIFO-full
> [  125.637227]               id = 0x00000048
> [  125.641229]            flags = 0x00009001
> [  125.645244]               ts = 0x35fa2cba
> [  125.649249]              SEQ = 0x000048              Sequence
> [  125.653959] 
> [  125.655444] TEF Object: 0x02 (0x418)
> [  125.659011]               id = 0x00000049
> [  125.663012]            flags = 0x00009201
> [  125.667027]               ts = 0x36374a5b
> [  125.671029]              SEQ = 0x000049              Sequence
> [  125.675738] 
> [  125.677223] TEF Object: 0x03 (0x424)
> [  125.680789]               id = 0x00000043
> [  125.684805]            flags = 0x00008601
> [  125.688810]               ts = 0x331cb9e4
> [  125.692811]              SEQ = 0x000043              Sequence
> [  125.697543] 
> [  125.699029] TEF Object: 0x04 (0x430)
> [  125.702596]               id = 0x00000044
> [  125.706615]            flags = 0x00008801
> [  125.710620]               ts = 0x3359d7d5
> [  125.714636]              SEQ = 0x000044              Sequence
> [  125.719331] 
> [  125.720814] TEF Object: 0x05 (0x43c)
> [  125.724396]               id = 0x00000045
> [  125.728401]            flags = 0x00008a01
> [  125.732401]               ts = 0x3396f4d6
> [  125.736417]              SEQ = 0x000045              Sequence
> [  125.741112] 
> [  125.742595] TEF Object: 0x06 (0x448)
> [  125.746177]               id = 0x00000046
> [  125.750182]            flags = 0x00008c01
> [  125.754196]               ts = 0x33d41227
> [  125.758198]              SEQ = 0x000046              Sequence
> [  125.762892] 
> [  125.764391] TEF Object: 0x07 (0x454)
> [  125.767961]               id = 0x00000047
> [  125.771962]            flags = 0x00008e01
> [  125.775977]               ts = 0x34112f78
> [  125.779979]              SEQ = 0x000047              Sequence

In the TX Object 0x0 the id=0x48 is already overwritten by 0x50, but in
TX Object 0x1, we see id=0x49.

> [  125.802466] TX Object: 0x00 (0x460)
> [  125.805960]               id = 0x00000050
> [  125.809963]            flags = 0x0000a001
> [  125.813979]    SEQ_MCP2517FD = 0x000050              Sequence (MCP2517)
> [  125.819544]    SEQ_MCP2518FD = 0x000050              Sequence (MCP2518)
> [  125.825144]             data = 50
> [  125.828453] 
> [  125.829938] TX Object: 0x01 (0x470)  priv-HEAD  priv-TAIL  priv-FIFO-full
> [  125.836748]               id = 0x00000049
> [  125.840752]            flags = 0x00009201
> [  125.844772]    SEQ_MCP2517FD = 0x000049              Sequence (MCP2517)
> [  125.850340]    SEQ_MCP2518FD = 0x000049              Sequence (MCP2518)
> [  125.855920]             data = 49
> [  125.859234] 
> [  125.860719] TX Object: 0x02 (0x480)  chip-HEAD  chip-TAIL  chip-FIFO-empty
> [  125.867602]               id = 0x0000004a
> [  125.871607]            flags = 0x00009401
> [  125.875624]    SEQ_MCP2517FD = 0x00004a              Sequence (MCP2517)
> [  125.881189]    SEQ_MCP2518FD = 0x00004a              Sequence (MCP2518)
> [  125.886769]             data = 4a
> [  125.890083] 
> [  125.891567] TX Object: 0x03 (0x490)
> [  125.895062]               id = 0x0000004b
> [  125.899063]            flags = 0x00009601
> [  125.903064]    SEQ_MCP2517FD = 0x00004b              Sequence (MCP2517)
> [  125.908644]    SEQ_MCP2518FD = 0x00004b              Sequence (MCP2518)
> [  125.914227]             data = 4b
> [  125.917536] 
> [  125.919019] TX Object: 0x04 (0x4a0)
> [  125.922499]               id = 0x0000004c
> [  125.926512]            flags = 0x00009801
> [  125.930514]    SEQ_MCP2517FD = 0x00004c              Sequence (MCP2517)
> [  125.936093]    SEQ_MCP2518FD = 0x00004c              Sequence (MCP2518)
> [  125.941657]             data = 4c
> [  125.944979] 
> [  125.946463] TX Object: 0x05 (0x4b0)
> [  125.949943]               id = 0x0000004d
> [  125.953979]            flags = 0x00009a01
> [  125.957984]    SEQ_MCP2517FD = 0x00004d              Sequence (MCP2517)
> [  125.963549]    SEQ_MCP2518FD = 0x00004d              Sequence (MCP2518)
> [  125.969130]             data = 4d
> [  125.972444] 
> [  125.973928] TX Object: 0x06 (0x4c0)
> [  125.977426]               id = 0x0000004e
> [  125.981427]            flags = 0x00009c01
> [  125.985443]    SEQ_MCP2517FD = 0x00004e              Sequence (MCP2517)
> [  125.991010]    SEQ_MCP2518FD = 0x00004e              Sequence (MCP2518)
> [  125.996597]             data = 4e
> [  125.999906] 
> [  126.001389] TX Object: 0x07 (0x4d0)
> [  126.004886]               id = 0x0000004f
> [  126.008890]            flags = 0x00009e01
> [  126.012891]    SEQ_MCP2517FD = 0x00004f              Sequence (MCP2517)
> [  126.018471]    SEQ_MCP2518FD = 0x00004f              Sequence (MCP2518)
> [  126.024054]             data = 4f

Is this behaviour known, or even documented somewhere?

Feel free to call me if you need more details.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux