Raspberry Pi 多罐总线 [关闭]

问题描述 投票:0回答:0

首先我真的不知道这是否属于这里,但我要发布,如果它不是输入它的最佳位置,请告诉在哪里做。

我使用的是 raspberryPi 4,我设计了一个自定义屏蔽,能够在我的 rpi 中有 4 条不同的 CANbus 线路,目前我已经能够使用以下代码尖峰创建这两个设备:

config.txt:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=24
dtoverlay=spi-bcm2835-overlay

当我使用 ip link 时,它向我显示了这些设备,所以我认为它能够与我的 pcb 中的 mcp2515 通信并找到它们。然后手动并在终端 i user

ip link set up can0 type can bitrate 1000000

完美运行,没有发现错误,然后我使用相同的命令:

ip link set up can1 type can bitrate 1000000

它不起作用,命令无限期地停留在那里,没有任何进展,所有其他 tty 会话也停止提供输出,我无法通过 ssh 连接。如果我改变我做事的顺序 can1 然后 can0,它对 can1 有效,然后我对 can0 得到同样的错误。有谁知道我做错了什么。我还包括了我设计和组装的 pcb 原理图的图像(我已经确认它不是一个糟糕的组装顺便说一句,硬件工作完美)。

如果这可以帮助您弄清楚,您将拥有 pcb 的完整原理图:

Aditional Pic in PCB

Input voltage converter 24 -> 3.3

Connectors

3 and 4 connection of spi to CAN

1 and 2 connection of spi to CAN

linux raspberry-pi linux-device-driver embedded-linux can-bus
© www.soinside.com 2019 - 2024. All rights reserved.