WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Is SPI on piCore-6.1beta1 for RPi2 working?  (Read 3306 times)

Offline spinosa

  • Newbie
  • *
  • Posts: 2
Is SPI on piCore-6.1beta1 for RPi2 working?
« on: April 16, 2015, 03: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!

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Is SPI on piCore-6.1beta1 for RPi2 working?
« Reply #1 on: April 16, 2015, 03: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
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline spinosa

  • Newbie
  • *
  • Posts: 2
Re: Is SPI on piCore-6.1beta1 for RPi2 working?
« Reply #2 on: April 18, 2015, 06: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.