Hello All,
I am logging CAN messages and storing them on an SD card in the BusMaster format shown below. We log approximately 1Gbyte of data in an hour.
10:04:34:4234 Rx 1 0x0c060000 x 8 00 09 00 11 30 95 58 45
The data is stored every 4K, or once 64 CAN messages have been received. The reason is that we need to interrogate the messages to detect any sudden or unexpected errors in the system which causes it to crash.
The problem is that sometimes messages are missed, but there doesn’t seem to be a pattern to it. The time logging stops can be as much as 2 seconds. On a 2.9Gbyte file the following was found
Args 2 String 240309_1653.log
17:02:37:9210 Rx 1 0x00040139 x 8 bb b7 bb b7 bb b7 bb b7
17:02:39:8485 Rx 1 0x04240041 x 4 ac fd ff ff messages missed
17:08:00:8298 Rx 1 0x00220001 x 8 2f 01 00 00 99 02 00 00
17:08:02:7611 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00 messages missed
17:18:22:5850 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
17:18:24:5169 Rx 1 0x04000022 x 8 2a 4e 0e 00 03 01 00 00 messages missed
17:34:05:1581 Rx 1 0x00800202 x 8 00 00 00 00 00 00 00 00
17:34:07:0816 Rx 1 0x02800069 x 4 0a 00 00 00 messages missed
17:39:28:1262 Rx 1 0x04000022 x 8 2a 4e 0e 00 f1 00 00 00
17:39:30:0517 Rx 1 0x00800202 x 8 00 00 00 00 00 00 00 00 messages missed
17:44:50:7280 Rx 1 0x00220001 x 8 90 02 00 00 5b fb ff ff
17:44:52:6527 Rx 1 0x00260001 x 8 f4 ff f4 ff ea fc 00 00 messages missed
17:55:07:8407 Rx 1 0x02800069 x 4 0b 00 00 00
17:55:09:7673 Rx 1 0x04220041 x 4 19 06 00 00 messages missed
18:00:30:7010 Rx 1 0x00800002 x 8 68 c5 68 c5 68 c5 68 c5
18:00:32:6259 Rx 1 0x00200001 x 8 ed ff fe ff 00 00 00 00 messages missed
18:05:53:7022 Rx 1 0x00040239 x 8 bb b7 bb b7 bb b7 bb b7(Us)
18:05:55:6252 Rx 1 0x00800202 x 8 00 00 00 00 00 00 00 00 messages missed
18:11:16:7530 Rx 1 0x00200001 x 8 fd ff 03 00 00 00 00 00
18:11:18:6806 Rx 1 0x02800069 x 4 0b 00 00 00 messages missed
18:21:33:9236 Rx 1 0x00220001 x 8 1b 02 00 00 59 fa ff ff
18:21:35:8467 Rx 1 0x00260001 x 8 f1 ff f4 ff e0 fc 00 00 messages missed
18:26:56:7541 Rx 1 0x046a0131 x 8 f0 ff ff ff f3 ff ff ff
18:26:58:6797 Rx 1 0x00260001 x 8 f3 ff f9 ff e2 fc 00 00 messages missed
18:32:19:5836 Rx 1 0x00200001 x 8 00 00 01 00 ff ff 00 00
18:32:21:5073 Rx 1 0x00240001 x 8 c8 43 00 00 36 43 00 00 messages missed
18:42:36:5115 Rx 1 0x00200001 x 8 fc ff fc ff 00 00 00 00
18:42:38:4367 Rx 1 0x04620031 x 8 78 f6 11 15 2b c1 81 ba messages missed
18:58:45:1170 Rx 1 0x02800069 x 4 0c 00 00 00
18:58:47:0420 Rx 1 0x02800069 x 4 0c 00 00 00 messages missed
19:09:28:5426 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
19:09:30:4686 Rx 1 0x00220001 x 8 43 06 00 00 3d ee ff ff messages missed
19:14:25:6602 Rx 1 0x00200001 x 8 05 00 fc ff 00 00 00 00
19:14:27:5857 Rx 1 0x00240001 x 8 52 e3 ff ff f4 e2 ff ff messages missed
19:19:48:6378 Rx 1 0x00260001 x 8 c4 ff ec ff d6 fc 00 00
19:19:50:5631 Rx 1 0x00260001 x 8 ce ff ea ff ef fc 00 00 messages missed
19:25:11:7046 Rx 1 0x00020039 x 5 00 00 00 00 00
19:25:13:6285 Rx 1 0x00220001 x 8 35 06 00 00 3b ee ff ff messages missed
19:35:29:2773 Rx 1 0x00260001 x 8 cf ff ef ff e8 fc 00 00
19:35:31:2047 Rx 1 0x00200001 x 8 00 00 01 00 fd ff 00 00 messages missed
19:40:52:4892 Rx 1 0x00200001 x 8 03 00 06 00 02 00 00 00
19:40:54:4141 Rx 1 0x02800069 x 4 0e 00 00 00 messages missed
19:46:15:6871 Rx 1 0x04240041 x 4 b2 f6 ff ff
19:46:17:6104 Rx 1 0x00200001 x 8 fe ff 04 00 00 00 00 00 messages missed
File total line count 44761677 data line count 44761664
Other processing on the file shows that the time the messages are missed grows with the memory size used
16:54:08:1062 Rx 1 0x02800069 x 4 0d 00 00 00
16:54:08:1063 Rx 1 0x00000202 s 7 00 00 00 00 00 00 00
line count 16 time diff(Us) 100
16:54:08:1065 Rx 1 0x02800069 x 4 0d 00 00 00
16:54:08:1077 Rx 1 0x00000302 s 5 30 06 db cb 01
line 19 time diff(Us) 1200
16:54:08:1083 Rx 1 0x0c060000 x 8 06 45 4e 27 00 12 00 27
16:54:08:1103 Rx 1 0x02800069 x 4 0d 00 00 00
line 24 count time diff(Us) 2000
16:54:08:1117 Rx 1 0x00000302 s 5 30 06 db ca 01
16:54:08:1153 Rx 1 0x02800069 x 4 0d 00 00 00
line count 27 time diff(Us) 3600
16:54:08:1157 Rx 1 0x00000302 s 5 30 06 db ca 01
16:54:08:1195 Rx 1 0x00000202 s 7 00 00 00 00 00 00 00
line count 30 time diff(Us) 3800
16:54:08:1355 Rx 1 0x00000302 s 5 2d 06 db ca 01
16:54:08:1394 Rx 1 0x00000202 s 7 00 00 00 00 00 00 00
line count 44 time diff(Us) 3900
16:54:08:4503 Rx 1 0x02800069 x 4 0c 00 00 00
16:54:08:4553 Rx 1 0x02800069 x 4 0d 00 00 00
line count 274 time diff(Us) 5000
16:57:14:0504 Rx 1 0x00800002 x 8 68 c5 68 c5 68 c5 68 c5
16:57:15:9799 Rx 1 0x00260001 x 8 05 00 00 00 e6 fc 00 00
line count 744399 time diff(Us) 1929500
17:08:00:8298 Rx 1 0x00220001 x 8 2f 01 00 00 99 02 00 00
17:08:02:7611 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
line count 3471887 time diff(Us) 1931300
17:12:58:7548 Rx 1 0x00260001 x 8 09 00 fd ff e4 fc 00 00
17:13:00:6862 Rx 1 0x00000302 s 5 e7 05 db ca 01
line count 4727631 time diff(Us) 1931400
17:18:22:5850 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
17:18:24:5169 Rx 1 0x04000022 x 8 2a 4e 0e 00 03 01 00 00
line 6093391 time diff(Us) 1931900
File total line count 44761677 data line count 44761664
So I assume that it’s something to do with the way that the data is written to the SD card. I’ve tried opening new files every 24KB and that seemed to work, but is not an acceptable solution.
Could anyone suggest how I can find solution so that I can record all the messages without missing any. Would Raw writing work?
Regards
Ray
Using
Teensy 4.1,
Arduino compiler 2.0.4
SD card 16Gbyte configured as exFAT
I am logging CAN messages and storing them on an SD card in the BusMaster format shown below. We log approximately 1Gbyte of data in an hour.
10:04:34:4234 Rx 1 0x0c060000 x 8 00 09 00 11 30 95 58 45
The data is stored every 4K, or once 64 CAN messages have been received. The reason is that we need to interrogate the messages to detect any sudden or unexpected errors in the system which causes it to crash.
The problem is that sometimes messages are missed, but there doesn’t seem to be a pattern to it. The time logging stops can be as much as 2 seconds. On a 2.9Gbyte file the following was found
Args 2 String 240309_1653.log
17:02:37:9210 Rx 1 0x00040139 x 8 bb b7 bb b7 bb b7 bb b7
17:02:39:8485 Rx 1 0x04240041 x 4 ac fd ff ff messages missed
17:08:00:8298 Rx 1 0x00220001 x 8 2f 01 00 00 99 02 00 00
17:08:02:7611 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00 messages missed
17:18:22:5850 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
17:18:24:5169 Rx 1 0x04000022 x 8 2a 4e 0e 00 03 01 00 00 messages missed
17:34:05:1581 Rx 1 0x00800202 x 8 00 00 00 00 00 00 00 00
17:34:07:0816 Rx 1 0x02800069 x 4 0a 00 00 00 messages missed
17:39:28:1262 Rx 1 0x04000022 x 8 2a 4e 0e 00 f1 00 00 00
17:39:30:0517 Rx 1 0x00800202 x 8 00 00 00 00 00 00 00 00 messages missed
17:44:50:7280 Rx 1 0x00220001 x 8 90 02 00 00 5b fb ff ff
17:44:52:6527 Rx 1 0x00260001 x 8 f4 ff f4 ff ea fc 00 00 messages missed
17:55:07:8407 Rx 1 0x02800069 x 4 0b 00 00 00
17:55:09:7673 Rx 1 0x04220041 x 4 19 06 00 00 messages missed
18:00:30:7010 Rx 1 0x00800002 x 8 68 c5 68 c5 68 c5 68 c5
18:00:32:6259 Rx 1 0x00200001 x 8 ed ff fe ff 00 00 00 00 messages missed
18:05:53:7022 Rx 1 0x00040239 x 8 bb b7 bb b7 bb b7 bb b7(Us)
18:05:55:6252 Rx 1 0x00800202 x 8 00 00 00 00 00 00 00 00 messages missed
18:11:16:7530 Rx 1 0x00200001 x 8 fd ff 03 00 00 00 00 00
18:11:18:6806 Rx 1 0x02800069 x 4 0b 00 00 00 messages missed
18:21:33:9236 Rx 1 0x00220001 x 8 1b 02 00 00 59 fa ff ff
18:21:35:8467 Rx 1 0x00260001 x 8 f1 ff f4 ff e0 fc 00 00 messages missed
18:26:56:7541 Rx 1 0x046a0131 x 8 f0 ff ff ff f3 ff ff ff
18:26:58:6797 Rx 1 0x00260001 x 8 f3 ff f9 ff e2 fc 00 00 messages missed
18:32:19:5836 Rx 1 0x00200001 x 8 00 00 01 00 ff ff 00 00
18:32:21:5073 Rx 1 0x00240001 x 8 c8 43 00 00 36 43 00 00 messages missed
18:42:36:5115 Rx 1 0x00200001 x 8 fc ff fc ff 00 00 00 00
18:42:38:4367 Rx 1 0x04620031 x 8 78 f6 11 15 2b c1 81 ba messages missed
18:58:45:1170 Rx 1 0x02800069 x 4 0c 00 00 00
18:58:47:0420 Rx 1 0x02800069 x 4 0c 00 00 00 messages missed
19:09:28:5426 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
19:09:30:4686 Rx 1 0x00220001 x 8 43 06 00 00 3d ee ff ff messages missed
19:14:25:6602 Rx 1 0x00200001 x 8 05 00 fc ff 00 00 00 00
19:14:27:5857 Rx 1 0x00240001 x 8 52 e3 ff ff f4 e2 ff ff messages missed
19:19:48:6378 Rx 1 0x00260001 x 8 c4 ff ec ff d6 fc 00 00
19:19:50:5631 Rx 1 0x00260001 x 8 ce ff ea ff ef fc 00 00 messages missed
19:25:11:7046 Rx 1 0x00020039 x 5 00 00 00 00 00
19:25:13:6285 Rx 1 0x00220001 x 8 35 06 00 00 3b ee ff ff messages missed
19:35:29:2773 Rx 1 0x00260001 x 8 cf ff ef ff e8 fc 00 00
19:35:31:2047 Rx 1 0x00200001 x 8 00 00 01 00 fd ff 00 00 messages missed
19:40:52:4892 Rx 1 0x00200001 x 8 03 00 06 00 02 00 00 00
19:40:54:4141 Rx 1 0x02800069 x 4 0e 00 00 00 messages missed
19:46:15:6871 Rx 1 0x04240041 x 4 b2 f6 ff ff
19:46:17:6104 Rx 1 0x00200001 x 8 fe ff 04 00 00 00 00 00 messages missed
File total line count 44761677 data line count 44761664
Other processing on the file shows that the time the messages are missed grows with the memory size used
16:54:08:1062 Rx 1 0x02800069 x 4 0d 00 00 00
16:54:08:1063 Rx 1 0x00000202 s 7 00 00 00 00 00 00 00
line count 16 time diff(Us) 100
16:54:08:1065 Rx 1 0x02800069 x 4 0d 00 00 00
16:54:08:1077 Rx 1 0x00000302 s 5 30 06 db cb 01
line 19 time diff(Us) 1200
16:54:08:1083 Rx 1 0x0c060000 x 8 06 45 4e 27 00 12 00 27
16:54:08:1103 Rx 1 0x02800069 x 4 0d 00 00 00
line 24 count time diff(Us) 2000
16:54:08:1117 Rx 1 0x00000302 s 5 30 06 db ca 01
16:54:08:1153 Rx 1 0x02800069 x 4 0d 00 00 00
line count 27 time diff(Us) 3600
16:54:08:1157 Rx 1 0x00000302 s 5 30 06 db ca 01
16:54:08:1195 Rx 1 0x00000202 s 7 00 00 00 00 00 00 00
line count 30 time diff(Us) 3800
16:54:08:1355 Rx 1 0x00000302 s 5 2d 06 db ca 01
16:54:08:1394 Rx 1 0x00000202 s 7 00 00 00 00 00 00 00
line count 44 time diff(Us) 3900
16:54:08:4503 Rx 1 0x02800069 x 4 0c 00 00 00
16:54:08:4553 Rx 1 0x02800069 x 4 0d 00 00 00
line count 274 time diff(Us) 5000
16:57:14:0504 Rx 1 0x00800002 x 8 68 c5 68 c5 68 c5 68 c5
16:57:15:9799 Rx 1 0x00260001 x 8 05 00 00 00 e6 fc 00 00
line count 744399 time diff(Us) 1929500
17:08:00:8298 Rx 1 0x00220001 x 8 2f 01 00 00 99 02 00 00
17:08:02:7611 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
line count 3471887 time diff(Us) 1931300
17:12:58:7548 Rx 1 0x00260001 x 8 09 00 fd ff e4 fc 00 00
17:13:00:6862 Rx 1 0x00000302 s 5 e7 05 db ca 01
line count 4727631 time diff(Us) 1931400
17:18:22:5850 Rx 1 0x00800102 x 8 68 c5 68 c5 68 c5 00 00
17:18:24:5169 Rx 1 0x04000022 x 8 2a 4e 0e 00 03 01 00 00
line 6093391 time diff(Us) 1931900
File total line count 44761677 data line count 44761664
So I assume that it’s something to do with the way that the data is written to the SD card. I’ve tried opening new files every 24KB and that seemed to work, but is not an acceptable solution.
Could anyone suggest how I can find solution so that I can record all the messages without missing any. Would Raw writing work?
Regards
Ray
Using
Teensy 4.1,
Arduino compiler 2.0.4
SD card 16Gbyte configured as exFAT