For several months now, it has become impossible to buy a Raspberry Pi from official resellers, this situation has a very heavy impact on the world of makers and industries, also on our business. After weeks of searching we have found an alternative Single Board Computer compliant with a part of our boards ROCK 4 SE.
ROCK 4 SE is a Single Board Computer (SBC) in an ultra small form factor that offers class leading performance and an extensive range of expansion ports. The ROCK 4 SE offers professionals, industrial OEMs, IoT enthusiasts, hobbyists, PC DIY enthusiasts and makers a reliable and extremely capable platform for building and tinkering their ideas into reality. ROCK 4 SE is available in 4GB LPDDR4 RAM option.
The complete features are described on official wiki
If you check the Rock 4 board pinout carefully, you can discover that it is not fully complaint with Raspberry Pi, our boards Dual Can requires the following peripherals:
- SPI with 2 Chip select on pins 19, 21, 23, 24 and 26
- I2C for RTC on pins 3 and 5
- 2 interrupts on pins 15 and 22
On the following table you can see that the second SPI chip select is not available on pin 26 for ROCK 4 SE board.
It is possible to install 3 different Operating Systems:
Android, Debian and Ubuntu Server.
For our test we have downloaded Ubuntu Server 20, follow the official wiki for SD card preparation.
Login with user rock and password rock
Modify file /boot/hw_intfc.conf. Set “on” to enable the optional hardware interfaces while set “off” to disable.
sudo nano /boot/hw_intfc.conf
Enable the following overlays:
intfc:i2c7=on
intfc:spi1=on
intfc:dtoverlay=mcp2515-can0-SG
Save and exit and reboot the board with sudo reboot
Overlay customizationThe Ubuntu image contains the following overlay dtbo files (dts file download)
at24c02.dtbo
console-on-ttyS4.dtbo
console-on-ttyS2.dtbo
cpufreq.dtbo
devspi1.dtbo
devspi2.dtbo
imx219.dtbo
pcie-gen2.dtbo
raspberrypi-7-inch-lcd.dtbo
rk3399-usb-host.dtbo
rk3399-usb-otg.dtbo
rock-4c-plus-raspberrypi-7inch-touchscreen.dtbo
rock-4c-plus-radxa-display-8hd.dtbo
rock-4c-plus-radxa-display-10hd.dtbo
spi1-waveshare35c.dtbo
spi1-waveshare35b-v2.dtbo
spi1-flash.dtbo
spi1-mcp2515-can0.dtbo
two-color-led.dtbo
w1-gpio4-30.dtbo
The spi1-mcp2515-can0.dtbois not correct has the following problem: clock-frequency = <12000000>; Our board works with a 16 Mhz oscillator, then we must generate a custom file mcp2515-can0-SG.dtbo.
For dtbo generation you must install the device tree compiler
sudo apt update
sudo apt install device-tree-compiler
sudo apt install can-utils
cd /boot/overlays
sudo /usr/bin/dtc -I dts -O dtb -o mcp2515-can0-SG.dtbo -I dts mcp2515-can0-SG.dts
sudo reboot
After the board startup use the following command to start can0 interface
sudo ip link set can0 up type can bitrate 1000000
ifconfig
Test 1: Raspberry Pi CAN TX —-> Rock Pi CAN RX
Raspberry Pi run the command
cangen can1
instead on Rock Pi run
candump can0
If the device trees on both boards are correctly configured and the can adapters are correctly connected you can see the message log under candump terminal.
For further details visit our web page
Comments