LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-27-2013, 01:25 AM   #1
georgewhr
Member
 
Registered: Nov 2012
Location: SF Bay Area
Posts: 47

Rep: Reputation: Disabled
can't open a spi device in /dev


I manually insmod spidev(device driver) and spi_bcm2708(controller driver) successfully.
In "/proc/devices" shows the spi major number is 153, I did"mknod /dev/spidev0.0 c 153 0". Trying to test whether I can open the device,which points to spidev module.

I write a simple test program to try to open the deivice, however it failed, the file descriptor is less than 0

Any people know why I can't open a device ?

#include <stdio.h>

#define device "spidev0.0"

void main(int argc,char **argv)
{
int fd = open(device,argv);
if(fd<0)
printf("cant");


}
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to open audio device (/dev/dsp): No such device stevesk Slackware 6 01-01-2009 06:29 AM
cdrecord: No such device. Cannot open '/dev/pg0'. Cannot open SCSI driver. hnshashi Linux - Newbie 3 08-14-2008 01:54 AM
startx --> (EE) xf86OpenSerial: Cannot open device /dev/input/mice No such device. TB2 Linux - Software 2 04-04-2007 05:11 PM
Failed to open device /dev/usb/ttyUSB0: No such device efm Linux - Newbie 2 04-04-2005 08:46 PM
loop: can't open device /dev/loop0: No such device or address miaviator278 Linux - Security 3 06-09-2004 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration