Jump to content

SPI communication nonfunctional, no data received


ygoe

Recommended Posts

(Finally this forum lets me enter a new topic. It's failing most of the time, making it really hard to solve my actual problem if the infrastructure also fails.)

 

I'm using an Orange Pi Zero board and try to make it talk to a radio module via SPI. The whole thing already works on a Raspberry Pi so the module and cabling is correct. But the module doesn't respond to requests on the Orange Pi. Since this doesn't do anything, I searched for issues like this and along the way found an SPI loopback tool. I tried it and it returned all zeros. The tool readme suggests that the MOSI and MISO pins are not connected, but they are. I checked and resoldered those pins and connected both with a jumper. The hardware is 100% correct. It must be the software that doesn't understand the SPI interface here. The same tool shows a correct echo on the RasPi.

 

I also found another topic here about the Allwinnder H6 chip where a patch in Armbian was necessary to resolve the same issue. I couldn't respond there due to a permanent forum outage and then lost the link. So I believe that the same error is in the Orange Pi Zero image. I didn't understand what was changed there, something deep within the system.

 

The armbianmonitor -u command failed with an internal server error response, so I uploaded the logs elsewhere. The Google form in front of this bug report recommended paste.debian.net but that service is unsuitable because its length limit of 150 kB is not sufficient.

Link to comment
Share on other sites

I guess you mean the param_spidev_spi_bus parameter? Sorry, I've pasted the complete file in the other response that never made it to the forum. Here is the file /boot/armbianEnv.txt:

 

verbosity=1
logo=disabled
console=serial
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
overlays=spi-spidev usbhost2 usbhost3
param_spidev_spi_bus=0
rootdev=UUID=4a65461e-d8ac-4d8f-94c0-05ecd12f6d58
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

 

I used armbian-config to enable SPI and also read that I need to manually add this parameter to the file. That's where I am now. I followed the pinout from this image (and many others which look the same): O03j0.jpg

 

I have now also verified that the pins work correctly as GPIO with the spi overlay disabled. So it's not a hardware failure. The software just isn't sending any SPI signal. SCLK, MOSI and CS0 remain low at all times when sending to SPI.

Link to comment
Share on other sites

I have found the solution. The bus number must be 1, not 0 as explained everywhere. This will create the device /dev/spidev1.0 instead of spidev0.0 and applications must be adapted. But with this modification I can access the SPI device.

 

So here's the relevant overlay configuration in /boot/armbianEnv.txt:

overlays=spi-spidev
param_spidev_spi_bus=1

 

And the SPI interface can be used only under this path: /dev/spidev1.0

 

Who knows where that bus number 0 leads to...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines