Need help to get SPIDEV to work on RockPi 4B


Recommended Posts

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

 

Link to post
Share on other sites
Donate and support the project!

On 1/22/2021 at 5:06 PM, martinayotte said:

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

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

 

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
Link to post
Share on other sites
On 1/25/2021 at 10: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?

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).

 

Link to post
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...