0

I have a device designed for RPi that supports SPI.

The software for this device provided by the vendor relies on /dev/spidev0.0 for communication, ie. it's a user space lib.

What's confusing is that /dev/spidev0.0 (and incidentally /dev/spidev0.1) is created on boot even though SPI is not enabled in raspi-config.

Case 1 - SPI enabled in raspi-config: - /dev/spidev0.x appear whether or not device is attached

Case 2 - SPI disabled in raspi-config: - /dev/spidev0.x appears only if device is attached

I am not aware of any plug-and-play for SPI, so am confused why these character devices appear automatically in case 2 when the device is attached.

Note that there is no vendor driver installed (kernel module etc). This is a clean Raspbian dist.

Please help me understand what is happening or where to look further!

migrated from serverfault.com Aug 23 '17 at 13:19

This question came from our site for system and network administrators.

  • What SPI device do you attach? – joan Aug 23 '17 at 18:03
  • Hi, it is an industrial networking board from Hilscher - a netHAT. But my question is really more general -- under what circumstances could /dev/spidev0.x be created when SPI is not enabled in raspi-config and there is no vendor software installed? – jugglingcats Aug 23 '17 at 21:30
  • When a HAT asks for the driver to be loaded. – joan Aug 23 '17 at 22:00
-2

Thanks to @joan. The full documentation is here: https://github.com/raspberrypi/hats, but here is the essential info:

B+ HAT requirements

A board can only be called a HAT if:

  • It conforms to the basic add-on board requirements
  • It has a valid ID EEPROM (including vendor info, GPIO map and valid device tree information).
  • It has a full size 40W GPIO connector.
  • It follows the HAT mechanical specification
  • It uses a GPIO connector that spaces the HAT between 10mm and 12mm from the Pi (i.e. uses spacers between 10mm and 12mm). If back powering via the GPIO connector the HAT must be able to supply a minimum of 1.3A continuously to the Pi (but ability to supply 2A continuously recommended).

Of course users are free to put an ID EEPROM on boards that don't otherwise conform to the remainder of the specifications - in fact we strongly encourage this; we just want things called HATs to be a known and well-specified entity to make life easier for customers, particularly the less technical ones.

  • Welcome! Please take the tour and visit the helpcenter. Whilst this may theoretically answer the question, it is preferable to include the essential parts of the answer here, and provide the link for reference. In fact we're enforcing this policy: please edit so that the answer stands on its own should the link break in the future. If it is not edited within 48 hours it will be converted to Community Wiki. – Ghanima Aug 25 '17 at 16:14

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.