2

This is the Linux:

PRETTY_NAME="Debian GNU/Linux 8 (jessie)"

NAME="Debian GNU/Linux"

VERSION_ID="8"

VERSION="8 (jessie)"

ID=debian

The Kernel version is:

4.1.15-gcfb25fd

And this is the Hardware platform: http://variwiki.com/index.php?title=DART-6UL

So I am familiar with SPI interface (I have developed SPI drivers for microcotrollers).

I found out nodeJs package for SPI but it requires SPIDEV in /dev/ directory, which is missing in the device list.

After some research I found out that I can rebuild the Kernel with new configuration so the SPIDEVx can appear in the device list. But this seems to more laborious approach. I have to install everything again.

Is it possible to write a C program to utilize the SPI interface on the installed OS/ I found out there is spidev.h file in /ust/include/linux/spi/ but it contains only typedefs and macros, no function declarations.

What would you advice me? What would be the least painful approach?

1

Briefly: You'll need device nodes in /dev to have user application use SPI. It doesn't matter of you use NodeJS or a C program to access those devices. And yes, /usr/include/linux/spi/ will only include the typedefs to use the device node. This will also be used by the NodeJS package, or any other userland package.

The device nodes in /dev are the kernel drivers that do the hardware access. If your current kernel is not configured for them, you need to configure it. In the best case, you just have to change the device tree. You may have to compile additional modules (which can e.g. be done with DKMS under Debian). You may also have to compile the complete kernel. Which of those applies depends on your current kernel configuration, which you have told us nothing about.

Any in case, you never have to "install everything again". Even if you need to compile the whole kernel, just install the new kernel and reboot.

  • I was looking for a device tree configuration file(*.dtb), but didn't find any. Is it possible this file to be missing? – Rikotech Aug 9 '18 at 16:00
  • I'm not familiar enough with DART-6UL to know how they do this in this platform. You installed the Debian that is available on the page you linked? Have you examined the configuration of the kernel that was included? – dirkt Aug 9 '18 at 17:14
  • Yes but it is preinstalation configuration. I am trying to avoid kernel rebuild ( if possible) . – Rikotech Aug 9 '18 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.