Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need help to get SPIDEV to work on RockPi 4B

Featured Replies

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

 

  • Author
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

On 1/22/2021 at 12:56 PM, xkcd said:

param_spidev_spi_bus=0

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?

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

 

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.

  • Author

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.