Hi All! I picked up the ODROID M2 because it’s pretty quick, has a dedicated video card, and can be equipped with their CAN-FD module. (MCP251xfd) I installed ODROID’s Android 13 image. These are steps:
Install the Android Developer kit on your PC. It has a utility you will need.
Connect ODROID M2 to your normal (Windows) PC with a USB-C cable. This will allow you to use your PC to connect to ODROID M2.
From PowerShell, type:
adb devices
If your PC and Android are connected, it should say something like this:
List of devices attached
001E065504E7 device
Open VI and edit this file to enable the CAN-FD module:
vi /fat/config.txt
Find the line that says “overlays=” and add “canfd0” inside it. Mine looks like this:
overlays=“i2c0 i2c1 spi0 uart0 canfd0”
Save and reboot. :wq! (or :q! if you don’t want to save)
reboot now
When Android comes back, get back into Powershell and then the adb shell
adb shell
Check if your new device experienced errors during boot:
dmesg | grep mcp
If everything went well, you should see:
[ T1] mcp251xfd spi0.0 can0: MCP2517FD rev0.0 (-RX_INT +MAB_NO_WARN +CRC_REG +CRC_RX +CRC_TX +ECC -HD c:20.00MHz m:10.00MHz r:8.50MHz e:0.00MHz) successfully initialized.
Now bring UP the new device from adb shell. This command requires Super User permissions:
su
ip link set can0 up type can bitrate 500000 dbitrate 2000000 fd on
Trust, but verify:
ip -details link show can0
Mine looks like this: (ignore my error-warning, I caused that from playing with the CAN wires)
odroidm2:/ $ ip -details link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-WARNING (berr-counter tx 119 rx 0) restart-ms 0
bitrate 500000 sample-point 0.875
tq 50 prop-seg 17 phase-seg1 17 phase-seg2 5 sjw 1
mcp251xfd: tseg1 2..256 tseg2 1..128 sjw 1..128 brp 1..256 brp-inc 1
dbitrate 2000000 dsample-point 0.700
dtq 50 dprop-seg 3 dphase-seg1 3 dphase-seg2 3 dsjw 1
mcp251xfd: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..256 dbrp-inc 1
clock 20000000numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
If everything worked, try to send data:
cansend can0 123#DEADBEEF
or receive data:
cansniffer can0
The ODROID M2 is not a certified Android product, so Google Play will reject you. To get around that, find your unique Google Services Framework Android ID:
su
sqlite3 /data/user/0/com.google.android.gsf/databases/gservices.db "select * from main where name = \"android_id\";"
It will return a long string of numbers. Copy and save these!
Now, go to this web site to register your new outlaw Android device with Google Play:
Now install RealDash from Google Play store. Then from Garage, select:
Adapters (CAN/LIN)
SocketCAN
If I’ve forgot anything, please let me know and I’ll modify my post to correct. Sorry this post was long. Hopefully it was clear and I didn’t forget anything.