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
- All Categories
- 63 Announcements & News
- 48 Product News - New Product/Product Change Notice/ End-of-life
- 96 Welcome Developers!
- 45 Unboxing & Project Sharing
- 22 Tech Updates
- 3.4K UP Products
- 15 UP 7000
- 1 UP Squared i12
- 11 UP Xtreme i12
- 13 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 23 UP Squared V2
- 65 UP 4000
- 23 UP Xtreme i11
- 34 UP Squared 6000
- 56 UP Squared Pro
- 136 UP Xtreme
- 820 UP Squared
- 1.4K UP Board
- 74 UP Core Plus
- 217 UP Core
- 3 UP Xtreme Lite
- 40 UP AI Edge
- 264 Starter Kits & Peripheral