I can successfully use SPI1 (/dev/spidev0.0) on Apalis TK1 under L4T. SPI1 signals are connected to X27 connector, where I put my SPI slave device.
I noticed, there are two more SPI devices on the module (let´s say SPI2 at /dev/spidev1.2 and SPI3 at /dev/spidev3.0). SPI2 should be accessible on cap. touch connector X24 on IXORA, where I would like to use it for other purposes.
But I cannot even open SPI2 or SPI3 port with simple code, which is working for SPI1.
little code here:
int fd_spi = open(“/dev/spidev0.0”, O_RDWR); //fd_spi gets positive value
int fd_spi = open(“/dev/spidev1.2”, O_RDWR); //fd_spi gets -1
int fd_spi = open(“/dev/spidev3.0”, O_RDWR); //fd_spi gets -1
So, are the SPI2 and SPI3 not usable I my HW/SW configuration, or am I missing something?
May be SPI2 could be blocked by working driver for K20 Companion MCU.
Thank you for the article. Now I see, that spidev1.2 cannot be used.
As stated in Environment section, I am using Apalis TK1 with IXORA V1.1A carrier board.
I followed installation procedure a installed Jetpack 3.1 (ubuntu 14.04.5).
I wrote simple function to run SPI1 (spidev0.0), I can open a send some bytes. I can see it running by watching HW pins (SPI1_CLK pin = pin 221 on X1 connector of Apalis TK1).
But SPI2 (TK1 port name = SPI4C ) (spidev3.0) I cannot even open. Open function returns -1. SPI2 CLK pin is on pin 235 of X1 connector on TK1.
Originally I was only curious, if there is some incompatibility because of ubuntu/JetPack.
I will probably use just one SPI bus, because I get no luck with the second one.
I wrote simple function to run SPI1 (spidev0.0), I can open a send some bytes. I can see it running by watching HW pins (SPI1_CLK pin = pin 221 on X1 connector of Apalis TK1).
But SPI2 (TK1 port name = SPI4C ) (spidev3.0) I cannot even open. Open function returns -1. SPI2 CLK pin is on pin 235 of X1 connector on TK1.
For me, that works just fine. This using an Apalis TK1 V1.2A running BSP 2.8b3 with JetPack 3.1.
Originally I was only curious if there is some incompatibility because of ubuntu/JetPack.
Not that we are aware of.
I will probably use just one SPI bus, because I get no luck with the second one.
Both should really be working just fine.
I assume you did start your user space spidev application with proper root privileges (e.g. using sudo)?
When I started to play with other SPI channels, I accidentally set rules for THS2 and THS3 instead of SPI2 and SPI3. But until now, I was rock solid convinced It was correct.
It was your remind about the privileges, which made me do this check, than turn pale and do easy fix.