Jump to content

Need help to get SPIDEV to work on RockPi 4B


Recommended Posts

Posted

Hi

 

I'm trying to get the SPI ports to work in a RockPi 4B board.

 

I've done the following:

  • Installed the Armbian_20.11.6_Rockpi-4b_focal_legacy_4.4.213.img.xz image

Edited

armbianEnv.txt

overlays=spi-spidev
param_spidev_spi_bus=0
  • There is a entry at: /sys/class/spidev/spidev0.0, but nothing at /dev/spidev/

 

Next, I built libmraa, which fails to run any examples with SPI, as it can initialize any SPI devices.

 

What am I missing, Hope you can help me

 

Posted (edited)
  On 1/22/2021 at 4:06 PM, martinayotte said:

It won't appear as subfolder, but as direct node /dev/spidev0.0 ...

Also, check with "dmesg | grep spi" ...

Expand  

 

Hi, thanks for the swift answer, wasn't expecting that.

 

There are no nodes named /dev/spidev0.0 (or similar).

 

I get the following from dmesg|grep spi (slightly cropped)

 

[...] rockchip-spi ff1c0000.spi: no high_speed pinctrl state
[...] ffffffc0f7f737f8: buggy DT: spidev listed directly in DT
[...] WARNING: at drivers/spi/spidev.c:722
/skipping some lines/
[...] rockchip-pinctrl pinctrl: pin gpio3-7 already requested by ff1c0000.spi; cannot claim for fe30000.ethernet

 

I should say that the device is only connected to wifi and not ethernet. Hope you can push in the right direction.

 

 

Edited by xkcd
Add info on /dev/spidev0.0
Posted
  On 1/22/2021 at 11:56 AM, xkcd said:

param_spidev_spi_bus=0

Expand  

Are you sure you are actually using SPI 0?

It's not routed out to GPIO pins and its pins are indeed used by ethernet interface.

Shouldn't you set bus 2 or 1 according to which GPIO pins you decided to use?

Posted
  On 1/25/2021 at 9:02 AM, piter75 said:

Are you sure you are actually using SPI 0?

It's not routed out to GPIO pins and its pins are indeed used by ethernet interface.

Shouldn't you set bus 2 or 1 according to which GPIO pins you decided to use?

Expand  

I'm not sure of anything. That's is why I asked here. I can't understand what I'm doing wrong or are supposed to do.

 

I tried to use SPI bus 1 as suggested here:

but that leads to a kernel panic when I reboot (how does one get out of these, without writing a new image).

 

Posted

Pin 19, 21, 23, 24 are laid out directly to the pins of SPI device on board.   spi bus 1 (Function1),   although I have never tried this.

Posted

Thanks for the reply. I'm not even at a state where can get one single SPI device to work. Either nothing shows up under /dev or kernel panic.

 

Is there some other image that is better to use?

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines