Hey,
So I compiled this little spidev_test.c and changed the device to 0,0 with this output:
>$ sudo spitest/a.out
>spi mode: 0
>bits per word: 8
>max speed: 500000 Hz (500 KHz)
>can't send spi message: Invalid argument
last couple of lines when running it in strace:
*******************
set_tls(0x4000f800, 0x4000fed8, 0x40093048, 0x4000f800, 0x4000f138) = 0
mprotect(0x40304000, 8192, PROT_READ) = 0
mprotect(0x40092000, 4096, PROT_READ) = 0
munmap(0x4016a000, 18824) = 0
open("/dev/spidev0.0", O_RDWR) = 3
ioctl(3, 0x40016b01, 0x111ea) = 0
ioctl(3, 0x80016b01, 0x111ea) = 0
ioctl(3, 0x40016b03, 0x111dc) = 0
ioctl(3, 0x80016b03, 0x111dc) = 0
ioctl(3, 0x40046b04, 0x111e0) = 0
ioctl(3, 0x80046b04, 0x111e0) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4008d000
write(1, "spi mode: 0\n", 12spi mode: 0
) = 12
write(1, "bits per word: 8\n", 17bits per word: 8
) = 17
write(1, "max speed: 500000 Hz (500 KHz)\n", 31max speed: 500000 Hz (500 KHz)
) = 31
ioctl(3, 0x40206b00, 0xbef206c0) = -1 EINVAL (Invalid argument)
dup(2) = 4
fcntl64(4, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
brk(0) = 0x1b1a000
brk(0x1b3b000) = 0x1b3b000
fstat64(4, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4013b000
_llseek(4, 0, 0xbef20598, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(4, "can't send spi message: Invalid "..., 41can't send spi message: Invalid argument
) = 41
close(4) = 0
munmap(0x4013b000, 4096) = 0
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid() = 1994
tgkill(1994, 1994, SIGABRT) = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++
*******************************************************
Is the cubieboard handling spi different in respect to the raspi?
thanks for any directions!
jeroen