*apt-get install build-essential * 



*In 3.8.x spidev2.0 could be used on spi1, but with 4.1.x+ the "first" is 
spidev1 (even if spi1 over spi0..) > * 


* SPIDevice *busDevice = new SPIDevice(2,0); //Using second SPI bus (both 
loaded)*

*The code is trying to open /dev/spidev2.0, but it's not there*


*This should be your first worry-> open("/dev/spidev2.0", O_RDWR) = -1 
ENOENT (No such file or directory)*

Find out why your system thinks this file does not exist. As in perhaps it 
doesn't because you need to load a device tree file as mike mentioned 
above. But also as stated above, there can be many reasons why your 
application does not think this file exists.

So did you tell the BBB to load the spidev interface??? 

PS.. "4.1.12-ti-r29" was way before i fixed spi/dma..  So you really 
should upgrade: (unless you only plan to send 159 bytes over spi) 

cd /opt/scripts/tools/ 
git pull 
sudo ./update_kernel.sh --ti-rt-channel --lts-4_1 
cd ~/ 

git clone https://github.com/ 
<https://github.com/beagleboard/bb.org-overlays> --depth=1 
cd ./bb.org-overlays 
./dtc-overlay.sh 
./install.sh 

Then: 

sudo sh -c "echo 'cape_enable=bone_capemgr.
>> /boot/uEnv.txt" 

*Here is an update of the steps performed ...*

*1) I did an update on **apt-get install build-essential*

*2) Change code from ... **SPIDevice *busDevice = new SPIDevice(2,0)*

* to* *SPIDevice *busDevice = new SPIDevice(1,0)*

*3) Updated kernel and ./dtc overlay*

*OUTCOME: The SPIDEV2.0 problem went away – unfortunately shortly 
thereafter my BBB would no longer connect with ssh root@192.168.7.2 
<root@192.168.7.2>. I therefore reloaded back to what I started with 
originally as below.*

*Linux beaglebone 4.1.12-ti-r29 #1 SMP PREEMPT Mon Nov 9 22:46:19 UTC 2015 
armv7l GNU/Linux*

*Linux version 4.1.12-ti-r29 (root@a5-imx6q-wandboard-2gb) (gcc version 
4.9.2 (Debian 4.9.2-10) ) #1 SMP PREEMPT Mon Nov 9 22:46:19 UTC 2015*

*BeagleBoard.org Debian Image 2015-11-12*

*When I set out again to run natively on my BBB the error changed from ...*

*SPI: SPI_IOC_MESSAGE Failed: Bad file descriptor * 

*to * 

*SPI: SPI_IOC_MESSAGE Failed: Invalid argument * 

*and the SPIDEV2.0 of course went away with libEBBLibrary.so loading and 
SPIDEV1.0 now loading. That said there still remains to be a number of 
directories that are still missing. I am taking this latest error as a sign 
of progress, but I have yet to resolve it. I also should mention that I 
ruled out my laptop, and loading the same configuration on my clunker with 
the same outcome. Here is latests strace ... For brevity I removed portions 
of it because it repeats itself at nauseum.*



*SPI: SPI_IOC_MESSAGE Failed: Invalid argument*


root@beaglebone:~/exploringBB/chp09/LCDcharacter# ls

LCDApp LCDApp.cpp LCDProb build build_static

root@beaglebone:~/exploringBB/chp09/LCDcharacter# strace ./LCDApp

execve("./LCDApp", ["./LCDApp"], [/* 19 vars */]) = 0

brk(0) = 0x8b9000

uname({sys="Linux", node="beaglebone", ...}) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f4d000

access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)

open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3

fstat64(3, {st_mode=S_IFREG|0644, st_size=26752, ...}) = 0

mmap2(NULL, 26752, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f46000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp", 0xbea86370) = -1 ENOENT 
(No such file or directory)

open("/lib/arm-linux-gnueabihf/tls/v7l/neon/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/lib/arm-linux-gnueabihf/tls/v7l/neon", 0xbea86370) = -1 ENOENT (No 
such file or directory)

open("/lib/arm-linux-gnueabihf/tls/v7l/vfp/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/lib/arm-linux-gnueabihf/tls/v7l/vfp", 0xbea86370) = -1 ENOENT (No 
such file or directory)

open("/lib/arm-linux-gnueabihf/tls/v7l/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/lib/arm-linux-gnueabihf/tls/v7l", 0xbea86370) = -1 ENOENT (No such 
file or directory)

open("/lib/arm-linux-gnueabihf/tls/neon/vfp/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/linux-gnueabihf/tls/neon/vflib/armp", 0xbea86370) = -1 ENOENT (No 
such file or directory)

open("/lib/arm-linux-gnueabihf/tls/neon/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/lib/arm-linux-gnueabihf/tls/neon", 0xbea86370) = -1 ENOENT (No 
such file or directory)

open("/lib/arm-linux-gnueabihf/tls/vfp/libEBBLibrary.so", 
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

stat64("/lib/arm-linux-gnueabihf/tls/vfp", 0xbea86370) = -1 ENOENT (No such 
file or directory)

*open("/lib/arm-linux-gnueabihf/tls/libEBBLibrary.so", O_RDONLY|O_CLOEXEC) 
= -1 ENOENT (No such file or directory)*

open("/usr/lib/libEBBLibrary.so", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`m\0\0004\0\0\0"..., 
512) = 512

lseek(3, 95252, SEEK_SET) = 95252

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1200) = 1200

lseek(3, 63425, SEEK_SET) = 63425

read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 51) 
= 51

fstat64(3, {st_mode=S_IFREG|0644, st_size=96452, ...}) = 0

mmap2(NULL, 128964, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6f08000

mprotect(0xb6f17000, 65536, PROT_NONE) = 0

mmap2(0xb6f27000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0xb6f27000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/usr/lib/arm-linux-gnueabihf/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0 n\4\0004\0\0\0"..., 
512) = 512

lseek(3, 656784, SEEK_SET) = 656784

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1280) = 1280

lseek(3, 656208, SEEK_SET) = 656208

read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 51) 
= 51

fstat64(3, {st_mode=S_IFREG|0644, st_size=658064, ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f45000

mmap2(NULL, 749256, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6e51000

mprotect(0xb6eed000, 61440, PROT_NONE) = 0

mmap2(0xb6efc000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9b000) = 0xb6efc000

mmap2(0xb6f02000, 24264, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f02000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/libm.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0h<\0\0004\0\0\0"..., 
512) = 512

lseek(3, 405976, SEEK_SET) = 405976

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1160) = 1160

lseek(3, 405640, SEEK_SET) = 405640

read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 53) 
= 53

fstat64(3, {st_mode=S_IFREG|0644, st_size=407136, ...}) = 0

mmap2(NULL, 471184, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6ddd000

mprotect(0xb6e40000, 61440, PROT_NONE) = 0

mmap2(0xb6e4f000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x62000) = 0xb6e4f000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3

read(3, 
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\230\321\0\0004\0\0\0"..., 
512) = 512

lseek(3, 99900, SEEK_SET) = 99900

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1120) = 1120

lseek(3, 99568, SEEK_SET) = 99568

read(3, "A2\0\0\0aeabi\0\1(\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 51) 
= 51

fstat64(3, {st_mode=S_IFREG|0644, st_size=101020, ...}) = 0

mmap2(NULL, 165160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6db4000

mprotect(0xb6dcd000, 61440, PROT_NONE) = 0

mmap2(0xb6ddc000, 4096, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0xb6ddc000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0Mw\1\0004\0\0\0"..., 
512) = 512

lseek(3, 899996, SEEK_SET) = 899996

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
2880) = 2880

lseek(3, 896548, SEEK_SET) = 896548

read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\f"..., 53) = 
53

fstat64(3, {st_mode=S_IFREG|0755, st_size=902876, ...}) = 0

mmap2(NULL, 972200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6cc6000

mprotect(0xb6d9f000, 61440, PROT_NONE) = 0

mmap2(0xb6dae000, 12288, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd8000) = 0xb6dae000

mmap2(0xb6db1000, 9640, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6db1000

close(3) = 0

access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0EQ\0\0004\0\0\0"..., 
512) = 512

lseek(3, 100684, SEEK_SET) = 100684

read(3, 
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 
1520) = 1520

lseek(3, 65940, SEEK_SET) = 65940

read(3, "A4\0\0\0aeabi\0\1*\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\4\22"..., 53) 
= 53

fstat64(3, {st_mode=S_IFREG|0755, st_size=102204, ...}) = 0

mmap2(NULL, 139836, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xb6ca3000

mprotect(0xb6cb3000, 61440, PROT_NONE) = 0

mmap2(0xb6cc2000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0xb6cc2000

mmap2(0xb6cc4000, 4668, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6cc4000

close(3) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f44000

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f43000

set_tls(0xb6f434c0, 0xb6f50050, 0xb6f43bb8, 0xb6f434c0, 0xb6f50050) = 0

mprotect(0xb6dae000, 8192, PROT_READ) = 0

mprotect(0xb6cc2000, 4096, PROT_READ) = 0

mprotect(0xb6e4f000, 4096, PROT_READ) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f42000

mprotect(0xb6efc000, 16384, PROT_READ) = 0

mprotect(0xb6f4f000, 4096, PROT_READ) = 0

munmap(0xb6f46000, 26752) = 0

set_tid_address(0xb6f43068) = 586

set_robust_list(0xb6f43070, 12) = 0

rt_sigaction(SIGRTMIN, {0xb6ca7d9d, [], SA_RESTORER|SA_SIGINFO, 
0xb6cecae1}, NULL, 8) = 0

rt_sigaction(SIGRT_1, {0xb6ca7cbd, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 
0xb6cecae1}, NULL, 8) = 0

rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0

getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0

futex(0xb6f06ce8, FUTEX_WAKE_PRIVATE, 2147483647) = 0

futex(0xb6f06cdc, FUTEX_WAKE_PRIVATE, 2147483647) = 0

fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f4c000

write(1, "Starting EBB LCD Character Displ"..., 43Starting EBB LCD 
Character Display Example

) = 43

brk(0) = 0x8b9000

brk(0x8da000) = 0x8da000

open("/dev/spidev1.0", O_RDWR) = 3

ioctl(3, 0x40016b01, 0x8b901c) = 0

ioctl(3, 0x80016b01, 0x8b901c) = 0

ioctl(3, 0x40046b04, 0x8b9024) = 0

ioctl(3, 0x80046b04, 0x8b9024) = 0

ioctl(3, 0x40016b03, 0x8b9020) = 0

ioctl(3, 0x80016b03, 0x8b9020) = 0

ioctl(3, 0x40046b04, 0x8b9024) = 0

ioctl(3, 0x80046b04, 0x8b9024) = 0

ioctl(3, 0x40206b00, 0xbea86a30) = 1

nanosleep({0, 1520000}, NULL) = 0

ioctl(3, 0x40206b00, 0xbea86a30) = -1 EINVAL (Invalid argument)

dup(2) = 4

fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)

fstat64(4, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb6f4b000

_llseek(4, 0, 0xbea86910, SEEK_CUR) = -1 ESPIPE (Illegal seek)

write(4, "SPI: SPI_IOC_MESSAGE Failed: Inv"..., 46SPI: SPI_IOC_MESSAGE 
Failed: Invalid argument

) = 46

close(4) = 0

munmap(0xb6f4b000, 4096) = 0

nanosleep({0, 37000}, NULL) = 0

ioctl(3, 0x40206b00, 0xbea86a30) = -1 EINVAL (Invalid argument)

dup(2) = 4

fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)

fstat64(4, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0

*mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0xb6f4b000*



-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to