Coder Social home page Coder Social logo

seeed-studio / pi-hats Goto Github PK

View Code? Open in Web Editor NEW
42.0 15.0 16.0 10.27 MB

The repository is the seeed studio's RPI hats driver.

Home Page: https://www.seeedstudio.com

License: MIT License

Shell 7.84% Makefile 0.63% C 87.56% C++ 3.97%
raspberry-pi

pi-hats's Introduction

pi-hats's People

Contributors

baorepo avatar linux-downey avatar pillar1989 avatar turmary avatar wangcoolc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pi-hats's Issues

a typo

cangen can0 -mv
candump can0

must be:
cangen can0 -mv
candump can1

mcp25xxfd spi0.0: CRC read error: computed: ec03 received: 0000 - data: be (CAN-HAT)

I installed the driver on RPi3B+ with kernel 4.19.75-v7+ #1270,
but the CAN0/CAN1 node are not found.
Below is fragment of dmesg about mcp25xxfd, who can tell me what happend?

[ 6.067273] mcp25xxfd spi0.0: CRC read error: computed: ec03 received: 0000 - data: be 00 04 00 00 00 00
[ 6.067290] mcp25xxfd spi0.0: CRC read of clock register resulted in a bad CRC mismatch - hw not found
[ 6.067306] mcp25xxfd spi0.0: Probe failed, err=84
[ 6.067365] mcp25xxfd: probe of spi0.0 failed with error -84
[ 6.101066] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 6.108743] mcp25xxfd spi1.0: CRC read error: computed: ec03 received: 0000 - data: be 00 04 00 00 00 00
[ 6.108759] mcp25xxfd spi1.0: CRC read of clock register resulted in a bad CRC mismatch - hw not found
[ 6.108775] mcp25xxfd spi1.0: Probe failed, err=84
[ 6.108840] mcp25xxfd: probe of spi1.0 failed with error -84

can1 receive sometime cannot receive time

code branch is master
can1 irq not deal

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152550] Process irq/168-mcp25xx (pid: 1035, stack limit = 0xf89bc868)

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 164.595616] Disabling IRQ #168

Your kernel headers for kernel 4.19.75-v8+ cannot be found at

When running "install.sh" on RPi4, I get this error:

Error! echo
Your kernel headers for kernel 4.19.75-v8+ cannot be found at
/lib/modules/4.19.75-v8+/build or /lib/modules/4.19.75-v8+/source.

Full log:

pi@raspberrypi:~/Desktop/can/pi-hats/CAN-HAT $ sudo ./install.sh
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
raspberrypi-kernel is already the newest version (1.20190925+1-1).
The following NEW packages will be installed:
  raspberrypi-kernel-headers
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.9 MB of archives.
After this operation, 163 MB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian buster/main armhf raspberrypi-kernel-headers armhf 1.20190925+1-1 [24.9 MB]
Fetched 24.9 MB in 13s (1,860 kB/s)
Selecting previously unselected package raspberrypi-kernel-headers.
(Reading database ... 94163 files and directories currently installed.)
Preparing to unpack .../raspberrypi-kernel-headers_1.20190925+1-1_armhf.deb ...
Unpacking raspberrypi-kernel-headers (1.20190925+1-1) ...
Setting up raspberrypi-kernel-headers (1.20190925+1-1) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.20.1-2).
Suggested packages:
  python3-apport menu
The following NEW packages will be installed:
  can-utils dkms
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 177 kB of archives.
After this operation, 715 kB of additional disk space will be used.
Get:1 http://mirrors.switch.ca/raspbian/raspbian buster/main armhf can-utils armhf 2018.02.0-1 [103 kB]
Get:2 http://mirrors.switch.ca/raspbian/raspbian buster/main armhf dkms all 2.6.1-4 [74.4 kB]
Fetched 177 kB in 1s (172 kB/s)
Selecting previously unselected package can-utils.
(Reading database ... 144752 files and directories currently installed.)
Preparing to unpack .../can-utils_2018.02.0-1_armhf.deb ...
Unpacking can-utils (2018.02.0-1) ...
Selecting previously unselected package dkms.
Preparing to unpack .../archives/dkms_2.6.1-4_all.deb ...
Unpacking dkms (2.6.1-4) ...
Setting up can-utils (2018.02.0-1) ...
Setting up dkms (2.6.1-4) ...
Processing triggers for man-db (2.8.5-2) ...

Creating symlink /var/lib/dkms/mcp2517fd/0.1/source ->
                 /usr/src/mcp2517fd-0.1

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area.....
make -j4 KERNELRELEASE=4.19.75+ -C /lib/modules/4.19.75+/build M=/var/lib/dkms/mcp2517fd/0.1/build......
cleaning build area....

DKMS: build completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=4.19.75-v7+ -C /lib/modules/4.19.75-v7+/build M=/var/lib/dkms/mcp2517fd/0.1/build......
cleaning build area...

DKMS: build completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=4.19.75-v7l+ -C /lib/modules/4.19.75-v7l+/build M=/var/lib/dkms/mcp2517fd/0.1/build.....
cleaning build area...

DKMS: build completed.
Error! echo
Your kernel headers for kernel 4.19.75-v8+ cannot be found at
/lib/modules/4.19.75-v8+/build or /lib/modules/4.19.75-v8+/source.
------------------------------------------------------
Please reboot your raspberry pi to apply all settings
Enjoy!
------------------------------------------------------

The CAN interface can not be found in "dmesg" or be brought up with "ip link"

Your kernel headers for kernel 4.19.118+ cannot be found at

Same issue as #5 but with a newer kernel.

DKMS: add completed.
Error! echo
Your kernel headers for kernel 4.19.118+ cannot be found at
/lib/modules/4.19.118+/build or /lib/modules/4.19.118+/source.
Error! echo
Your kernel headers for kernel 4.19.118-v7+ cannot be found at
/lib/modules/4.19.118-v7+/build or /lib/modules/4.19.118-v7+/source.
Error! echo
Your kernel headers for kernel 4.19.118-v7l+ cannot be found at
/lib/modules/4.19.118-v7l+/build or /lib/modules/4.19.118-v7l+/source.

The CAN interface can not be found in "dmesg" or be brought up with "ip link"

CAN-HAT can1 can not receive data after some time

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152284] Internal error: Oops: 5 [#1] PREEMPT SMP ARM

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152550] Process irq/168-mcp25xx (pid: 1035, stack limit = 0xf89bc868)

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152556] Stack: (0xab5e5c60 to 0xab5e6000)

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152568] 5c60: b8ed9d80 7f814c30 7f814ba4 00000040 ab5e5c94 ab5e5c80 8070b82c 8070c31c

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152581] 5c80: b8ed9d80 7f814c30 ab5e5cb4 ab5e5c98 8070b8a4 8070b808 b8ed9d80 b8ed9d80

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152593] 5ca0: 7f814ba4 00000040 ab5e5ccc ab5e5cb8 7f814c30 8070b864 80d07588 b8ed9d80

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152604] 5cc0: ab5e5cf4 ab5e5cd0 80725078 7f814bb0 7f818090 2f7bb189 ab5e5d0c 00000000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152616] 5ce0: 00000000 ba34f008 ab5e5d0c ab5e5cf8 80725110 80725024 00000000 00000000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152628] 5d00: ab5e5d44 ab5e5d10 80725220 807250d8 ffffe000 ba34f104 802115dc ba34f108

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152640] 5d20: 00000001 00000000 00000040 396c1000 0000012c 80c8e000 ab5e5de4 ab5e5d48

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152652] 5d40: 807264d8 8072516c 80853990 80d08494 80d07588 80ad38f0 80d075b0 ffffe000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152664] 5d60: 80d93a94 ba34f000 80d970dc 396c1000 80d05100 ffffca8f 80853b64 ab5e5d7c

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152675] 5d80: ab5e5d7c ab5e5d84 ab5e5d84 ab5e5d8c ab5e5d8c 00000000 8012704c ffffe000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152687] 5da0: 80d941d4 00000008 00208040 ffffe000 ab5e5de4 2f7bb189 80c84348 80c84348

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152699] 5dc0: 0000000c 00000003 80d07d14 80d93c84 00208040 ffffe000 ab5e5e3c ab5e5de8

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152711] 5de0: 801270b0 80726274 8071ca08 80211544 00000025 80a6c414 80aa8da4 80d03080

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152723] 5e00: 80d0308c 80aa8d98 80c8d100 00000000 ab5e5e3c ab5e4000 b8ed9d80 80d07588

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152736] 5e20: b49a8e9c b49a8000 00000000 00000040 ab5e5e54 ab5e5e40 801273e8 80126e2c

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152748] 5e40: 00000000 b8ed9d80 ab5e5e6c ab5e5e58 80723c88 8012735c 0000000f b8ed9d80

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152759] 5e60: ab5e5eac ab5e5e70 7f6dbb28 80723c54 fffffff8 0000000f b5f4b908 2f7bb189

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152771] 5e80: 80853efc b49a8b04 b49a8580 0000000b 7f6e105c b49a8694 00000001 ffff0ff3

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152783] 5ea0: ab5e5f04 ab5e5eb0 7f6db164 7f6db9b8 80512c20 b4ab62e0 b49a8c10 00000002

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152795] 5ec0: 7f6dfcb0 7f6dfc80 80d07588 7f6df438 b4ab6000 2f7bb189 ab5e5f24 acfa2980

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152807] 5ee0: b74c6200 acfa29a4 ffffe000 00000000 80187b64 00000001 ab5e5f24 ab5e5f08

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152819] 5f00: 80187b90 7f6daac4 b74c6200 acfa2980 acfa29a4 ffffe000 ab5e5f74 ab5e5f28

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152830] 5f20: 80187ee8 80187b70 80a71b10 80d07588 80d937a6 8014cd28 ab5e4000 00000000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152842] 5f40: 80187cc0 2f7bb189 80143720 b774d480 acfa2580 00000000 ab5e4000 acfa2980

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152854] 5f60: 80187da0 ab669734 ab5e5fac ab5e5f78 80143df0 80187dac b774d49c b774d49c

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152865] 5f80: 00000000 acfa2580 80143c84 00000000 00000000 00000000 00000000 00000000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152876] 5fa0: 00000000 ab5e5fb0 801010b4 80143c90 00000000 00000000 00000000 00000000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152886] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.152897] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 163.153340] Code: caffffeb e5960008 e3500000 0a000003 (e5904000)

Message from syslogd@raspberrypi at Sep 7 03:23:28 ...
kernel:[ 164.595616] Disabling IRQ #168

Lose frames during heavy traffic

We test the mcp2518fd version hardware, if 20ms and 10ms frames were sent to bus from vector vn5610, frame losing may be observed after about 1~2 minutes.

Seeed 2 Channel Shield CAN Bus Error (spi0.0 can0)

I am trying to test Seeed 2 Channel Shield. I installed CAN-HAT as follow:

$ git clone https://github.com/seeed-Studio/pi-hats
$ cd pi-hats/CAN-HAT
$ sudo ./install.sh
$ sudo reboot

$ sudo ip link set can0 up type can bitrate 250000
$ sudo ip link set can1 up type can bitrate 250000

can1 works fine as it prints out only a single line of can1 7DF [4] DE AD BE EF on the terminal when trying: cansend can1 7DF#DEADBEEF from a different machine through PEAK CAN interface.

But when I try the same to can0: cansend can0 7DF#DEADBEEF, the terminal reads the same message repeatedly for infinite times and it never stops until I escape:

...
can0  7DF   [4]  DE AD BE EF
can0  7DF   [4]  DE AD BE EF
can0  7DF   [4]  DE AD BE EF
can0  7DF   [4]  DE AD BE EF
can0  7DF   [4]  DE AD BE EF
can0  7DF   [4]  DE AD BE EF
can0  7DF   [4]  DE AD BE EF
can0  7DF   [4]  DE AD BE EF
...

and the following messages are shown

pi@raspberrypi:~ $ dmesg | grep spi
[    4.632813] mcp25xxfd spi0.0: MCP2517 successfully initialized.
[    4.803697] mcp25xxfd spi1.0: MCP2517 successfully initialized.
[   72.980247] mcp25xxfd spi0.0: Controller unexpectedly switched from mode 0 to 6
[  119.627107] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.639785] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.647272] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.647622] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.652326] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.678204] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.692710] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.767581] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.807058] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.812657] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[  119.832261] mcp25xxfd spi0.0 can0: CAN Bus error experienced
...

I am not sure if this is a HW or CAN-HAT problem.
Have anyone experienced the same or something similar?

Heavy traffic will trigger TEF interrupt (CAN-HAT)

when pressure test was performed, write() to can0 will stuck, and the "dmesg | grep spi" will report:

[13378.996137] mcp25xxfd spi0.0 can0: Something is wrong - we got a TEF interrupt but we were not able to detect a finished fifo
[13378.996181] mcp25xxfd spi0.0 can0: tefif: fifo 6 not pending - tef data: id: 00000301 flags: 00000c08, ts: d7649027 - this may be a problem with spi signal quality- try reducing spi-clock speed if this can get reproduced

will you kindly give a solution how to recover from this situation?

Heavy traffic makes errors and occurs frame drops (low Hz)

Hello , @marckleinebudde

I opened new issue #7 (comment)
Thanks for reply

I'm using rpi4 and 5.4.140-rt64 kernel + 2ch CAN bus FD shield

Linux ubuntu 5.4.140-rt64 #1 SMP PREEMPT_RT Sat Oct 16 17:57:52 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

and I follow this document

after heavy traffic , error frames are detected(PCAN-view) , and motor driver detect something wrong (bus off)
when I use PCAN(Peak CAN) with socketCAN I can get Hz (control and get feedback) I want (Under 1Mbps),
But using 2ch CAN bus FD shield, It has frame drops(low Hz) and Eventually, bus off motor with the lowest priority (same code)

here is my dmesg

[    0.000000] Linux version 5.4.140-rt64 (runner@fv-az42-775) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #1 SMP PREEMPT_RT Sat Oct 16 17:57:52 UTC 2021 (Ubuntu 5.4.0-1044.48-raspi 5.4.140)
[    3.225849] spi-bcm2835 fe204000.spi: could not get clk: -517
[   10.937930] spi_master spi0: will run message pump with realtime priority
[   11.022588] mcp251xfd spi0.1 can0: MCP2518FD rev0.0 (-RX_INT -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD c:40.00MHz m:20.00MHz r:17.00MHz e:0.00MHz) successfully initialized.
[   11.110721] mcp251xfd spi0.0 can1: MCP2518FD rev0.0 (-RX_INT -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD c:40.00MHz m:20.00MHz r:17.00MHz e:0.00MHz) successfully initialized.
[  763.834108] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=80 90 49 f0, CRC=0x5d94) retrying.
[ 1014.408947] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=80 e1 b1 45, CRC=0xc8f1) retrying.
[ 1145.472032] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=00 24 2b 7e, CRC=0x9b19) retrying.
[ 1162.026867] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=80 3f a3 a5, CRC=0x282a) retrying.
[ 1162.045392] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=00 8d ae a5, CRC=0x0ffe) retrying.
[ 1162.062180] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=00 cc b8 a5, CRC=0xfee9) retrying.
[ 1162.085613] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=80 1a c7 a5, CRC=0xf2eb) retrying.
[ 1162.095969] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=80 6c cd a5, CRC=0x4850) retrying.
[ 1162.096003] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=80 72 cd a5, CRC=0x49c8) retrying.
[ 1162.108837] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=00 46 d5 a5, CRC=0x1a64) retrying.
[ 1162.183280] mcp251xfd spi0.1 can0: CRC read error at address 0x0010 (length=4, data=80 b6 02 a6, CRC=0xe49e) retrying.

here is candump any,0~0,#FFFFFFFF -cexdtA

candump
``` (2023-02-06 16:04:21.785296) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:21.785374) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:21.785376) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:21.785849) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:21.785853) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:21.785856) can0 RX - - 20000004 [8] 00 20 00 00 00 00 80 00 ERRORFRAME controller-problem{tx-error-passive} error-counter-tx-rx{{128}{0}} (2023-02-06 16:04:21.785858) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:21.785861) can0 RX - - 20000004 [8] 00 08 00 00 00 00 7E 00 ERRORFRAME controller-problem{tx-error-warning} error-counter-tx-rx{{126}{0}} (2023-02-06 16:04:21.790969) can0 RX - - 20000004 [8] 00 40 00 00 00 00 5D 00 ERRORFRAME controller-problem{back-to-error-active} error-counter-tx-rx{{93}{0}} (2023-02-06 16:04:30.889786) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:30.889802) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:30.889805) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:30.889807) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:30.889812) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:30.889834) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:30.889836) can0 RX - - 20000004 [8] 00 08 00 00 00 00 78 00 ERRORFRAME controller-problem{tx-error-warning} error-counter-tx-rx{{120}{0}} (2023-02-06 16:04:30.889838) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:30.889840) can0 RX - - 20000004 [8] 00 20 00 00 00 00 80 00 ERRORFRAME controller-problem{tx-error-passive} error-counter-tx-rx{{128}{0}} (2023-02-06 16:04:30.889848) can0 RX - - 20000004 [8] 00 08 00 00 00 00 7F 00 ERRORFRAME controller-problem{tx-error-warning} error-counter-tx-rx{{127}{0}} (2023-02-06 16:04:30.894957) can0 RX - - 20000004 [8] 00 40 00 00 00 00 5F 00 ERRORFRAME controller-problem{back-to-error-active} error-counter-tx-rx{{95}{0}} (2023-02-06 16:04:33.818032) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:33.818045) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:33.818047) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:33.818050) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:33.818052) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:33.818053) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:33.818056) can0 RX - - 20000004 [8] 00 08 00 00 00 00 78 00 ERRORFRAME controller-problem{tx-error-warning} error-counter-tx-rx{{120}{0}} (2023-02-06 16:04:33.818059) can0 RX - - 20000088 [8] 00 00 90 00 00 00 00 00 ERRORFRAME protocol-violation{{tx-recessive-bit-error,error-on-tx}{}} bus-error (2023-02-06 16:04:33.818061) can0 RX - - 20000004 [8] 00 20 00 00 00 00 80 00 ERRORFRAME controller-problem{tx-error-passive} error-counter-tx-rx{{128}{0}} (2023-02-06 16:04:33.818246) can0 RX - - 20000004 [8] 00 08 00 00 00 00 7E 00 ERRORFRAME controller-problem{tx-error-warning} error-counter-tx-rx{{126}{0}} (2023-02-06 16:04:33.823254) can0 RX - - 20000004 [8] 00 40 00 00 00 00 5F 00 ERRORFRAME controller-problem{back-to-error-active} error-counter-tx-rx{{95}{0}} ```

==================================================================

and I checked phase-seg2 value ip -details link show can0 , which is 10 so, I set sjw as 5

ubuntu@ubuntu:~$ ip -details link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 65536
    link/can  promiscuity 0 minmtu 0 maxmtu 0 
    can <BERR-REPORTING,FD> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 1000 
	  bitrate 1000000 sample-point 0.750 
	  tq 25 prop-seg 14 phase-seg1 15 phase-seg2 10 sjw 5
	  mcp251xfd: tseg1 2..256 tseg2 1..128 sjw 1..128 brp 1..256 brp-inc 1
	  dbitrate 8000000 dsample-point 0.600 
	  dtq 25 dprop-seg 1 dphase-seg1 1 dphase-seg2 2 dsjw 1
	  mcp251xfd: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..256 dbrp-inc 1
	  clock 40000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 

sudo ip link set can0 up type can bitrate 1000000 sjw 5   dbitrate 8000000 restart-ms 1000 berr-reporting on fd on && sudo ifconfig can0 txqueuelen 65536

and tested again with candump any,0~0,#FFFFFFFF -cexdtA
it returns same result above and still same problem

CAN hat cannot send messages

Attempting to use cangen can0 -mv there are the following error messages reported by dmesg:

dmesg | grep can
[ 3.643575] mcp25xxfd_can: loading out-of-tree module taints kernel.
[ 51.220770] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
[ 94.347674] can: controller area network core (rev 20170425 abi 9)
[ 94.367269] can: raw protocol (rev 20170425)
[ 94.370485] mcp25xxfd spi0.0 can0: CAN Bus error experienced
[ 94.370747] mcp25xxfd spi0.0 can0: CAN Bus error experienced

Everything setup according to your instructions, terminators are turned on, power is applied via Raspberry PI's USB port.

Using seeed DS1307 with ROCK Board (Debian 11)

Hello,
I'm trying to run the RTC Clock into a rock board. I follow the install guide, but when I run and set hwclock, switch off the board and restart, the date of the hwclock stay at 2013-01-18 ...

I see the i2c address, while writing the command : sudo i2cdetect -y 1

The result is : 0x11 ( is it the good address ?? on tuto I read 0x68 ?? )

With this board I'm not sure about the installation. Is exist a way to check if the DS1307 is well installed ?

Thank for help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.