Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: spinosa on April 16, 2015, 12:04:31 PM

Title: Is SPI on piCore-6.1beta1 for RPi2 working?
Post by: spinosa on April 16, 2015, 12:04:31 PM
Hi.

I am using a RPi2 with piCore-6.1beta1_v7-SSH for RPi2. So far I got everything set up and running to successfully compile my C program which uses the WiringPi lib to access SPI (it is running perfectly on Raspbian).
However, when I run the program I get the message "Unable to open SPI device: No such file or directory".
The command
Code: [Select]
sudo modprobe spidev.ko gives
Code: [Select]
modprobe: module spidev.ko not found in modules.depWhen I try
Code: [Select]
sudo gpio load spi I get
Code: [Select]
modprobe: module spidev not found in modules.dep
modprobe: can't load module spi_bcm2708 (kernel/drivers/spi/spi-bcm2708.ko.gz): No such device
gpio: Unable to load spi_bcm2708

Does SPI generally work with that piCore image for RPi2 or is it missing?
Can I load the module somehow?

Thanks!
Title: Re: Is SPI on piCore-6.1beta1 for RPi2 working?
Post by: bmarkus on April 16, 2015, 12:54:48 PM
Hi

spidev.ko is built into the kernel, no need for modprobe. SPI must be enabled in config.txt explicitely. Add the following line:

Code: [Select]
dtparam=spi=on
Please read /mnt/mmcblk0p1/overlays/README about Device Tree config. This can be useful too:

https://www.raspberrypi.org/forums/viewtopic.php?t=97314
Title: Re: Is SPI on piCore-6.1beta1 for RPi2 working?
Post by: spinosa on April 18, 2015, 03:51:18 AM
Thanks! Works like a charm!

It is impressive how big the performance difference is between Raspbian and piCore. On piCore my application needs around ten times less resoucres and runs like pseudo real-time. Impossible on Raspbian.