LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Not able to make node for SPI (https://www.linuxquestions.org/questions/linux-newbie-8/not-able-to-make-node-for-spi-765033/)

makphy 10-28-2009 09:42 AM

Not able to make node for SPI
 
Hello,

I am working on phyCORE-iMX31 (ARM11) board. I loaded the driver for SPI (Serial Peripheral Interface)on to the board. I am not able to make node for SPI using
mknod -m777 /dev/spi_0 c 153 0
After the execution of the above statement, the node is being listed in the device list. But using this node in my application code it gives error
spi_0:No such file or directory
Please guide me how to make a node for SPI.

Thanks.

blackhole54 10-30-2009 01:24 AM

Quote:

Originally Posted by makphy (Post 3735327)
After the execution of the above statement, the node is being listed in the device list. But using this node in my application code it gives error
spi_0:No such file or directory

In your application, did you specify /dev/spi_0 or just spi_0?

makphy 11-01-2009 10:47 PM

I specified it as /dev/spi_0 in my application. After loading the driver for SPI on the board and making node, it is being listed. But while using it's showing "No such device or address". Another problem is that after rebooting the board, the node get removed from the /dev directory.

blackhole54 11-02-2009 01:24 PM

Quote:

Originally Posted by makphy (Post 3740720)
"No such device or address".

That's not quite the same message you listed earlier. Do you know if the wording for that message is coming from the OS or your application?

Quote:

Another problem is that after rebooting the board, the node get removed from the /dev directory.
My guess is that is being done by the udev system. But I still haven't gotten familiar with udev. You might try do a search on something like "udev" and "persistent nodes".

makphy 11-03-2009 01:59 AM

The message "No such device or address" is generated by OS. As per your suggestion I'll look for 'udev' and 'persistent nodes'. But still the main problem is how to made that node working. Later on I'll try to make it permanent.

blackhole54 11-04-2009 05:38 PM

Sorry, I don't know what your problem might be. If the ls -l command shows the node as being a character node with the correct major and minor numbers, then I think the mknod command worked correctly.

This page contains a description of the meaning of the error message (and also explains why I was getting picky about exactly what it said):

Quote:

"No such device or address", ENXIO, means that your attempt got down to the driver, which said no hardware was present. If the device node was missing you would have gotten ENODEV, "No such file or directory".
Which sounds to me like you wouldn't even get that message if the node had not been created properly since you then wouldn't even be able to talk to the driver. That's probably the most help I can give you.


All times are GMT -5. The time now is 06:30 AM.