Help with GPIO and SPI on Wandboard Dual

Discuss Ubuntu related items.

Help with GPIO and SPI on Wandboard Dual

Postby dhruvbaldawa » Mon Mar 02, 2015 4:59 pm

Hi,
I have Wandboard Dual and I have managed to flash Ubuntu 14.04.1 with 3.19 kernel on to it. I followed the tutorial here: eewiki.net/display/linuxonarm/Wandboard
I have been struggling on these last few bits for my project,

1. Access GPIO pins via /sys/class/gpio/. I have enabled CONFIG_GPIO_SYSFS but I see gpiochip0, gpiochip32, gpiochip64, etc. I want to them to be like gpio0_0, gpio0_1
2. I also need help in configuring SPI in similar way, have access to /dev/spidev0.0. Currently I see an empty directory of spidev in /sys/class

Thanks.
dhruvbaldawa
 
Posts: 2
Joined: Mon Mar 02, 2015 4:54 pm

Re: Help with GPIO and SPI on Wandboard Dual

Postby Tapani » Mon Mar 09, 2015 2:42 am

To get the GPIOs to /sys/class/gpio you have to "export" them there. This is usually done by the kernel.
You can sometimes trigger the export from userland by commands like
Code: Select all
echo 56 > /sys/class/gpio/export


The mapping between one GPIO number and GPIO for bank and number is: (bank-1)*32 + number.

Read the GPIO tutorial at http://wiki.wandboard.org/External_gpio

The spidev sounds like your udev is not configured properly (or that you don't have spidev enabled in your kernel).
Tapani
 
Posts: 712
Joined: Tue Aug 27, 2013 8:32 am

Re: Help with GPIO and SPI on Wandboard Dual

Postby dhruvbaldawa » Mon Mar 23, 2015 1:34 pm

Thanks.

For SPI, I have enabled CONFIG_SPI_SPIDEV=y in the config and I also have udev rules in /etc/udev/rules.d to enabled spidev. Do I have to recompile the device tree or something like that? Its not enabled in the default 3.0 kernel provided by Wandboard.
dhruvbaldawa
 
Posts: 2
Joined: Mon Mar 02, 2015 4:54 pm

Re: Help with GPIO and SPI on Wandboard Dual

Postby Tapani » Tue Apr 07, 2015 12:38 pm

Sorry for the late response:
for SPIDEV you might need to recompile the kernel. After that it should work (as you know) after modifying your udev rules.
Tapani
 
Posts: 712
Joined: Tue Aug 27, 2013 8:32 am


Return to Software - Ubuntu

Who is online

Users browsing this forum: No registered users and 7 guests