Setting Up udev rules for multiple canbus interfaces

Wow. You put in a lot of effort into this.

It’s looking good but there are a number of issues that need to be discussed.

I think the best way to comment is to start with the section header and then the point.

CAN bus: The Briefest of Introductions

As one adds more peripherals to a printer

Do we add “peripherals” to a printer or “devices” or “parts” or “enhancements”? “Peripheral” just doesn’t seem like the right word to me.

What is CAN bus

The linear topology of CAN bus means that each device on the bus communicates with every other device. This is in contrast to a star topology, where each device communicates with a central hub, and the hub communicates with each device.

Could I suggest adding a graphic for this?

CAN bus is terminated at both ends of the line. This termination helps to reduce ringing on the line, and is usually achieved by placing a 120Ω resistor between can_h and can_l. CAN bus may also be terminated in a split termination scheme, in which two 60Ω resistors are connected in series between can_h and can_l, and a capacitor connected to ground is placed between them.

No, the termination resistors attenuate signal reflections coming back from the end of the network.

Split termination is done to reduce pick up of high frequency noise and is tricky to get right. It is very easy to end up with your cables ringing if you don’t ground the network components correctly.

Not every MCU is CAN bus capable. Many STM32 and SAM MCUs implement CAN bus in hardware. CAN bus is implemented in software (in the PIO cores) on RP2040.

I’m debating on whether or not to suggest this paragraph be dropped. What goes in and out of a CAN transceiver is simply NRZ Serial - theoretically any MCU with a UART can communicate with a CAN transceiver but will require more software than one with dedicated hardware to provide the Data Link Layer support.

The Seeed Studio CAN Bus Transceiver:

Uses a Microchip MCP2551 Serial to CAN bus interface chip. There are also Arduino CAN shields that use the Arduino’s Serial or SPI interfaces.

Wiring/Topology

Again, I think a diagram of what the network looks like.

As a general rule of thumb, the standard recommends that a stub should be no longer than 0.3m (30 cm) when using a 1Mbps signaling rate

??? Where do you get that “general rule of thumb”? That’s an antenna that will very easily pickup fairly low frequency noise - especially in a printer with steppers. Personally, I recommend no stubs longer than 1" (2.54cm).

Many STM devices may be configured to output the CAN bus signal on the USB port, and these devices allow connecting those directly, avoiding searching for available pins and soldering all together.

This isn’t correct. USB is USB. CAN is CAN. They do NOT have the same electrical specifications and are not interchangeable.

Toolhead Boards

Can I suggest that you make the point that CAN devices are not hot swappable before you say that “allowing for such things as different toolheads to be swapped out easily and quickly”.

Topologies

Sorry, for being blunt but there are a lot of mistakes in basic understanding in this section. You really need to go through your scenarios with other people who implement CAN and understand the different scenariors.

Again, you cannot pass CAN on USB C or any other flavor of USB. Maybe you can provide a reference to a “CAN Distribution board” that you think provides this functionality. This error in understanding is repeated throughout the section.

With regards to U2C boards, can I suggest that you read through my discussion with NAPCAL last week here:

With regards to the U2C boards with “USB” connectors, I suggest that you review NAPCAL’s block diagram of them:

This is why I only recommend Canable boards because they don’t have the confusing weirdness of the BTT and other boards.

Sorry for dumping on you. What you’re doing is extremely valuable but you need to first set up a CAN bus with different devices for each of the scenarios that you present so that you have a better understanding of how CAN is wired and works.