I am putting together two Raspberry Pi units as an work-related experiment (on my own time with my own money). One has a PICAN 3 HAT (for CAN), the other has a PICAN FD HAT (for CAN-FD). At the moment, both Pis are 4B 8GB models, which would be my target for the work-related experiment. If I keep these particular units (which I'd expect to do because it provides a development and test environment), I'll probably swap them with 4B 4GB models I have. I need these for CAN sniffing and injection, and I don't really anticipate needing a GUI. Given that CAN tops out at 1 Mbps and CAN-FD in automotive typically tops out under 8 Mbps, I don't anticipate needing a large RAM cache of messages; even an average microSD card should be able to sustain the I/O needed to write continuously (and of course I'll be using the filesystem, which has its own cache).
It's worth noting that at the moment, I'm running the 64-bit version of Raspberry Pi OS, which has been in beta for about 9 months. I haven't had any issues yet, but I haven't been hard on them yet.
One issue I ran into: the lack of availability of stacking headers for the PoE HAT. I prefer having the PoE HAT on all of my Pi 3B and 4B, for the convenience of always having PoE on-board (I don't need to carry a PoE splitter with me). Unfortunately it's hard to get the 4-pin stacking header from the usual suspects, and most of them are actually incorrect; they use extra-long pins despite the fact that nothing should plug into the 4-pin header except the PoE HAT. And the newer PoE+ HAT doesn't allow pass-through of the 4-pin header (no holes in the PoE+ HAT's PCB for the 4-pin).
I ordered stacking headers from The Pi Hut, despite knowing the 4-pin won't work with the PoE+ HAT. It took roughly 2 weeks for them to arrive. They work for stacking Pi 4B 8G, then original PoE HAT, then the PICAN FD, but require 15mm standoffs between the Pi 4B and the original Pi PoE board; not ideal but the upside is that it leaves room for shallow heatsinks on the SOC and other components while not hitting the PoE board's fan. The 4-pin stacking headers protrude well beyond the top of the original Pi PoE HAT PCB and should definitely be shorter. I'll cut and shape them and look for a more reasonable 4-pin header.
<soapbox>
I'm annoyed at the Pi Foundation regarding the PoE+ HAT. A number of problems have cropped up, which tells me they didn't learn enough from the problems with the original PoE HAT (Rev1). Users are reporting high power consumption at idle, high temperatures at idle, a louder fan, and horrible noises if the Pi is powered from USB-C while powered from PoE. That's in addition to the change that makes us search out new stacking connectors for the 4-pin PoE connection (and none of the usual suspects sell such a connector). Meanwhile, the reliable Rev 2 of the original Pi PoE HAT is not available everywhere. However, there's at least one reasonable (i.e. isolated) alternative (from Waveshare).</soapbox>
Sadly I'll be waiting a while for the stacking headers to arrive, since they're coming from Europe and I wasn't willing to pay for expedited shipping.
I'm using mostly-open cases for these. I need fairly easy access to the DB-9 and screw terminals on the CAN HATs, and there are no fully enclosed cases for my planned stackup (Pi 4, PoE HAT, CAN HAT) with precut holes in the right location for the DB-9 and screw terminals on the CAN HAT. Yet another situation where I wish I had a 3D printer. However, I don't know if we can use PoE for the target application at work. If there's no PoE HAT needed there, I can use an enclosure from copperhilltech.com. However, even those enclosures don't provide access to the CAN screw terminals or a 120 ohm termination jumper should we choose to solder one in place (sadly, right now the Seeed Studio CAN HAT with built-in switches for 120 ohm termination isn't available). In any case, I prefer PoE if available. An isolated version, of course. On a managed switch, it's just easier to deal with:
The stackup, once the stacking headers arrive, should look roughly like the images below. Raspberry Pi 4, PoE HAT, PICAN FD HAT):
For the intended target, we'll want a fully prepared spare. Fortunately this is easy to do; duplicate hardware, and a prepared microSD image that we'd maintain (which should not need to change very often). That image would contain standard Raspbian and some packaged software (Debian packges), whether just can-utils or our own. When we need to update, we should be able to do it remotely (standard apt get ... for things like can-utils and dpkg -i ... for anything we create.
Long term it might be nice to be able to stack an opto-isolated I/O board, just so we could see some of the tester actions that are not via a network bus. The alternative would be to have the tester send information via TCP or UDP, but there are latency variances that make that solution less desirable.
Why go through all the trouble? Well, I'd just like to be able to get CAN logs when a tester is having trouble, without jumping through hoops (and across more than 10 time zones) to get them. This lets us analyze some tester/DUT behavior from afar. It's not perfect but it will pay for itself the first time we need it; we spent a lot more in engineering hours trying to get useful log data from a recent tester to DUT issue than the cost of this setup. Our build was delayed by several days just trying to get a log that we could use to figure out what was wrong with the first issue encountered. Even if someone has to pull this device out of a tool box, blow the dust off and plug it in... it'd be way faster than what we recently experienced.
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
cases | OONO Mega semi-enclosed | OONO Mega | 3 | $17.90 | $53.70 |
Total | $53.70 |
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
RPI4-PICAN3-8 | Raspberry Pi 4 8GB with PICAN3 HAT | RPI4-PICAN3-8 | 1 | $205.95 | $205.95 |
CAN-FD HAT | PICAN-FD | PICAN-FD | 1 | $78.95 | $78.95 |
Total | $284.90 |
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
Raspberry Pi 4 8GB | Raspberry Pi 4 with 8GB RAM | RPI4 8GB | 1 | $74.99 | $74.99 |
PoE HAT | Raspberry Pi PoE HAT | Pi PoE HAT | 1 | $19.99 | $19.99 |
Total | $94.98 |
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
stacking headers for PoE HAT | 2x20 + 2x2 | PoE HAT stacking headers | 6 | $3.47 | $20.82 |
Total | $20.82 |
Vendor | Total |
---|---|
www.amazon.com | $53.70 |
copperhilltech.com | $284.90 |
www.microcenter.com | $94.98 |
thepihut.com | $20.82 |
Total | $454.40 |
#dtparam=spi=onAdd these lines:
# Enable PICAN FD dtoverlay=mcp251xfd,oscillator=16000000,interrupt=25 dtoverlay=spi-bcm2835-overlay
So far, yes.
% uname -a Linux raspberrypi 5.10.52-v8+ #1441 SMP PREEMPT Tue Aug 3 18:14:03 BST 2021 aarch64 GNU/Linux
% dmesg | egrep 'CAN|mcp' [ 4.968779] CAN device driver interface [ 5.022167] mcp251xfd spi0.0 can0: MCP2518FD rev0.0 (-RX_INT -MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD c:16.00MHz m:20.00MHz r:6.80MHz e:6.75MHz) successfully initialized.
% lsmod | grep can can_dev 36864 1 mcp251xfd
% ip link show type can 4: can0:mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10 link/can
% ifconfig can0 can0: flags=128Here's the parts list for the Raspberry Pi 4 8GB with PICAN FD and PoE HATs. This list doesn't include M2.5 screws for the PICAN FD HAT; you should get some with the PoE HAT as well as the PICAN FD HAT.mtu 16 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 68
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
M2.5 standoffs | 360 piece M2.5 brass standoff kit | 0329 | 1 | $23.29 | $23.29 |
case | OONO Mega semi-enclosed | OONO Mega | 1 | $17.90 | $17.90 |
microSD card | Samsung PRO Endurance 64GB | MB-MJ64GA/AM | 1 | $12.99 | $12.99 |
M2.5 thumb screw | M2.5x5mm knurled stainless steel thumb screw | SSS-SN25 | 1 | $9.39 | $9.39 |
Total | $63.57 |
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
CAN-FD HAT | PICAN-FD | PICAN-FD | 1 | $78.95 | $78.95 |
Total | $78.95 |
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
Raspberry Pi 4 8GB | Raspberry Pi 4 with 8GB RAM | RPI4 8GB | 1 | $74.99 | $74.99 |
PoE HAT | Raspberry Pi PoE HAT | Pi PoE HAT | 1 | $19.99 | $19.99 |
Total | $94.98 |
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
stacking headers for PoE HAT | 2x20 + 2x2 | PoE HAT stacking headers | 1 | $3.47 | $3.47 |
Total | $3.47 |
Part | Description | P/N | Qty. | Unit Price | Total |
---|---|---|---|---|---|
M4 25mm M/F brass standoff | M4 25mm M/F brass standoff | 971250474 | 4 | $2.34 | $9.36 |
M4 30mm F/F brass standoff | M4 30mm F/F brass standoff | 970300474 | 4 | $1.36 | $5.44 |
M4 thumb screw | nylon M4 slotted thumb screw | 50M040070T008 | 8 | $0.14 | $1.12 |
Total | $15.92 |
Vendor | Total |
---|---|
www.amazon.com | $63.57 |
copperhilltech.com | $78.95 |
www.microcenter.com | $94.98 |
thepihut.com | $3.47 |
www.digikey.com | $15.92 |
Total | $256.89 |