SPI not working after upgrade to ubuntu 18.04 with patched kernel from ppa

Previously, I had ubuntu 16.04 with a patched 4.4 kernel and my code ran fine on the UP board, data being sent over SPI worked well.
I now upgraded to 18.04 and installed the patched kernel from the ppa and enabled spidev2.1 as a kernel boot param. I'm able to see /dev/spidev2.0 and /dev/spidev2.1, but when i run my code to communicate over SPI, i dont get any data back at all even though it succeeds in opening SPI.
What is the correct way to use SPI now? Did something change that I missed?
Comments
-
I was able to use SPI on Ubuntu 18.04 with upboard kernel 4.15 from ppa.
But I have used it from a kernel driver (mcp2515) and not spidev. -
@rreignier said:
I was able to use SPI on Ubuntu 18.04 with upboard kernel 4.15 from ppa.
But I have used it from a kernel driver (mcp2515) and not spidev.can you share more information about using the mcp2515 kernel driver? thx
-
@tdudz said:
can you share more information about using the mcp2515 kernel driver? thxSure, I have used this module from @nukular https://forum.up-community.org/discussion/comment/9298/#Comment_9298 in a
mcp2515_init.c
file.
Then add a simpleMakefile
:obj-m += mcp2515_init.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
Then:
$ sudo apt install build-essential linux-headers-$(uname -r) $ make $ sudo insmod mcp2515_init.ko busnum=2 chip_select=1 gpio_int=25 $ sudo ip link set can0 up type can bitrate 500000
Categories
- 301 All Categories
- 104 Announcements & News
- 51 Product News - New Product/Product Change Notice/ End-of-life
- 184 Welcome Developers!
- 52 Unboxing & Project Sharing
- 24 Tech Updates
- 550 UP Products
- 1 UP Xtreme i12
- UP Squared Pro 7000
- 1 UP Element i12 Edge
- 11 UP Squared V2
- 26 UP 4000
- 24 UP Xtreme i11
- 34 UP Squared 6000
- 44 UP Squared Pro
- 140 UP Xtreme
- 819 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 221 UP Core
- 3 UP Xtreme Lite
- 43 UP AI Edge
- 215 Starter Kits & Peripheral