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.

Orangepi zero mainline kernel both spi cs pins on spi1

Featured Replies

I want to drive 2 SPI devices on my orangepi zero. I enabled `spi-spidev` and `spi-add-cs1` overlays and set `param_spidev_spi_bus` to 1. But by I still get only `/dev/spi1.0` available. When I add `param_spidev_spi_cs=1`, I get `/dev/spi1.1` but `/dev/spi1.0` disappears. Do I see it correctly that I can choose *either* `/dev/spi1.0` *or* `/dev/spi1.1` but not both with that overlay?

How can I activate both cs pins? There are a bunch of example custom files out there, but none are meant specifically for the setup where I need spi1 (instead of spi0) and need to use a GPIO pin for cs1. And I can't really find any docs on how to write my own overlay. So any help is appreciated.

 

  • Author

OK, lol, I figured it out.

 

I created a file (in my homedir on the orangepi) called spi-double-spidev-cs.dt` with the folliowing content:

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun8i-h3";

        fragment@0 {
                target = <&spi1>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";

                        spidev@0 {
                                reg = <0>; /* Chip Select 0 */
                                compatible = "spidev";
                                spi-max-frequency = <1000000>;
                                status = "okay";
                        };

                        spidev@1 {
                                reg = <1>; /* Chip Select 1 */
                                compatible = "spidev";
                                spi-max-frequency = <1000000>;
                                status = "okay";
                        };
                };
        };
};

 

 

Then I enabled that overlay with `armbian-add-overlay spi-double-spidev-cs.dts`. This automatically compiles the overlay and adds it to `/boot/armbianEnv.txt`. Just make sure you add the following parameter to `/boot/armbianEnv.txt` as well:

param_spidev_spi_bus=1

 

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.