How to enable SPI on Orange PI PC+ in Armbian?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















I'm trying to get SPI working on my board.
That's what I came up:



  • SPI is not enabled by default in armbian, we need to enable it first
    (enable corresponding DT overlay)

  • in linux SPI can only be accessed via /dev/spidev*.* files

  • if I don't see any spi devices in my dev folder then SPI is not enabled on my board

  • in the latest versions of armbian spi can be enabled in armbain-config (under
    System/Hardware/spi-spidev)

  • in previous versions it was needed to decompile /boot/script.bin into fex file,  enable SPI there and compile it back

I did clean install of Armbian Bionic (I also did try Stretch earlier), updated it and enabled spi-spidev,  restarted the board but still got no spidev files. 



Here is my armbianmonitor log.
That's how I check if SPI is enabled:



dima@orangepipcplus:~$ cat /boot/armbianEnv.txt
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
rootfstype=ext4
overlays=spi-add-cs1 spi-jedec-nor spi-spidev
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
dima@orangepipcplus:~$ ls /dev/*spi*
ls: cannot access '/dev/*spi*': No such file or directory


BTW, my goal is to create smart home project with nrf24l01 communication, but I'm stuck on script error that says could not open /dev/spidev0.0 (not exact paste)



So my question is: how to enable spi so that /dev/spidev*.* files will appear?










share|improve this question



















  • 1





    I would guess you would need to edit a dts compile it to a dtb, then swap it with the one uboot is useing (might need to remake a initial-ram-disk if that is in use, and recompile the kernel)

    – user1133275
    Jan 22 at 21:38















1















I'm trying to get SPI working on my board.
That's what I came up:



  • SPI is not enabled by default in armbian, we need to enable it first
    (enable corresponding DT overlay)

  • in linux SPI can only be accessed via /dev/spidev*.* files

  • if I don't see any spi devices in my dev folder then SPI is not enabled on my board

  • in the latest versions of armbian spi can be enabled in armbain-config (under
    System/Hardware/spi-spidev)

  • in previous versions it was needed to decompile /boot/script.bin into fex file,  enable SPI there and compile it back

I did clean install of Armbian Bionic (I also did try Stretch earlier), updated it and enabled spi-spidev,  restarted the board but still got no spidev files. 



Here is my armbianmonitor log.
That's how I check if SPI is enabled:



dima@orangepipcplus:~$ cat /boot/armbianEnv.txt
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
rootfstype=ext4
overlays=spi-add-cs1 spi-jedec-nor spi-spidev
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
dima@orangepipcplus:~$ ls /dev/*spi*
ls: cannot access '/dev/*spi*': No such file or directory


BTW, my goal is to create smart home project with nrf24l01 communication, but I'm stuck on script error that says could not open /dev/spidev0.0 (not exact paste)



So my question is: how to enable spi so that /dev/spidev*.* files will appear?










share|improve this question



















  • 1





    I would guess you would need to edit a dts compile it to a dtb, then swap it with the one uboot is useing (might need to remake a initial-ram-disk if that is in use, and recompile the kernel)

    – user1133275
    Jan 22 at 21:38













1












1








1


1






I'm trying to get SPI working on my board.
That's what I came up:



  • SPI is not enabled by default in armbian, we need to enable it first
    (enable corresponding DT overlay)

  • in linux SPI can only be accessed via /dev/spidev*.* files

  • if I don't see any spi devices in my dev folder then SPI is not enabled on my board

  • in the latest versions of armbian spi can be enabled in armbain-config (under
    System/Hardware/spi-spidev)

  • in previous versions it was needed to decompile /boot/script.bin into fex file,  enable SPI there and compile it back

I did clean install of Armbian Bionic (I also did try Stretch earlier), updated it and enabled spi-spidev,  restarted the board but still got no spidev files. 



Here is my armbianmonitor log.
That's how I check if SPI is enabled:



dima@orangepipcplus:~$ cat /boot/armbianEnv.txt
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
rootfstype=ext4
overlays=spi-add-cs1 spi-jedec-nor spi-spidev
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
dima@orangepipcplus:~$ ls /dev/*spi*
ls: cannot access '/dev/*spi*': No such file or directory


BTW, my goal is to create smart home project with nrf24l01 communication, but I'm stuck on script error that says could not open /dev/spidev0.0 (not exact paste)



So my question is: how to enable spi so that /dev/spidev*.* files will appear?










share|improve this question
















I'm trying to get SPI working on my board.
That's what I came up:



  • SPI is not enabled by default in armbian, we need to enable it first
    (enable corresponding DT overlay)

  • in linux SPI can only be accessed via /dev/spidev*.* files

  • if I don't see any spi devices in my dev folder then SPI is not enabled on my board

  • in the latest versions of armbian spi can be enabled in armbain-config (under
    System/Hardware/spi-spidev)

  • in previous versions it was needed to decompile /boot/script.bin into fex file,  enable SPI there and compile it back

I did clean install of Armbian Bionic (I also did try Stretch earlier), updated it and enabled spi-spidev,  restarted the board but still got no spidev files. 



Here is my armbianmonitor log.
That's how I check if SPI is enabled:



dima@orangepipcplus:~$ cat /boot/armbianEnv.txt
verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
rootfstype=ext4
overlays=spi-add-cs1 spi-jedec-nor spi-spidev
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
dima@orangepipcplus:~$ ls /dev/*spi*
ls: cannot access '/dev/*spi*': No such file or directory


BTW, my goal is to create smart home project with nrf24l01 communication, but I'm stuck on script error that says could not open /dev/spidev0.0 (not exact paste)



So my question is: how to enable spi so that /dev/spidev*.* files will appear?







armbian






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 24 at 17:45









Rui F Ribeiro

40k1479135




40k1479135










asked Jan 22 at 21:31









rattrapperrattrapper

10613




10613







  • 1





    I would guess you would need to edit a dts compile it to a dtb, then swap it with the one uboot is useing (might need to remake a initial-ram-disk if that is in use, and recompile the kernel)

    – user1133275
    Jan 22 at 21:38












  • 1





    I would guess you would need to edit a dts compile it to a dtb, then swap it with the one uboot is useing (might need to remake a initial-ram-disk if that is in use, and recompile the kernel)

    – user1133275
    Jan 22 at 21:38







1




1





I would guess you would need to edit a dts compile it to a dtb, then swap it with the one uboot is useing (might need to remake a initial-ram-disk if that is in use, and recompile the kernel)

– user1133275
Jan 22 at 21:38





I would guess you would need to edit a dts compile it to a dtb, then swap it with the one uboot is useing (might need to remake a initial-ram-disk if that is in use, and recompile the kernel)

– user1133275
Jan 22 at 21:38










1 Answer
1






active

oldest

votes


















0














Okay, this was really stupid. I just needed to read about Device Tree overlays carefully.



I didn't set the required SPI parameter param_spidev_spi_bus. Here is my armbianEnv.txt now:



verbosity=1
logo=disabled
console=both
disp_mode=1920x1080p60
overlay_prefix=sun8i-h3
rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
rootfstype=ext4
overlays=spi-spidev
param_spidev_spi_bus=0
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u


Note that armbain-config does not set this parameter, so you can't get SPI working using this tool only. So for now it's easier just to edit armbianEnv.txt directly.






share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f496070%2fhow-to-enable-spi-on-orange-pi-pc-in-armbian%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Okay, this was really stupid. I just needed to read about Device Tree overlays carefully.



    I didn't set the required SPI parameter param_spidev_spi_bus. Here is my armbianEnv.txt now:



    verbosity=1
    logo=disabled
    console=both
    disp_mode=1920x1080p60
    overlay_prefix=sun8i-h3
    rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
    rootfstype=ext4
    overlays=spi-spidev
    param_spidev_spi_bus=0
    usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u


    Note that armbain-config does not set this parameter, so you can't get SPI working using this tool only. So for now it's easier just to edit armbianEnv.txt directly.






    share|improve this answer



























      0














      Okay, this was really stupid. I just needed to read about Device Tree overlays carefully.



      I didn't set the required SPI parameter param_spidev_spi_bus. Here is my armbianEnv.txt now:



      verbosity=1
      logo=disabled
      console=both
      disp_mode=1920x1080p60
      overlay_prefix=sun8i-h3
      rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
      rootfstype=ext4
      overlays=spi-spidev
      param_spidev_spi_bus=0
      usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u


      Note that armbain-config does not set this parameter, so you can't get SPI working using this tool only. So for now it's easier just to edit armbianEnv.txt directly.






      share|improve this answer

























        0












        0








        0







        Okay, this was really stupid. I just needed to read about Device Tree overlays carefully.



        I didn't set the required SPI parameter param_spidev_spi_bus. Here is my armbianEnv.txt now:



        verbosity=1
        logo=disabled
        console=both
        disp_mode=1920x1080p60
        overlay_prefix=sun8i-h3
        rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
        rootfstype=ext4
        overlays=spi-spidev
        param_spidev_spi_bus=0
        usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u


        Note that armbain-config does not set this parameter, so you can't get SPI working using this tool only. So for now it's easier just to edit armbianEnv.txt directly.






        share|improve this answer













        Okay, this was really stupid. I just needed to read about Device Tree overlays carefully.



        I didn't set the required SPI parameter param_spidev_spi_bus. Here is my armbianEnv.txt now:



        verbosity=1
        logo=disabled
        console=both
        disp_mode=1920x1080p60
        overlay_prefix=sun8i-h3
        rootdev=UUID=09e9478d-c7f2-4b16-a2d7-66f5313ff813
        rootfstype=ext4
        overlays=spi-spidev
        param_spidev_spi_bus=0
        usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u


        Note that armbain-config does not set this parameter, so you can't get SPI working using this tool only. So for now it's easier just to edit armbianEnv.txt directly.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 27 at 12:38









        rattrapperrattrapper

        10613




        10613



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f496070%2fhow-to-enable-spi-on-orange-pi-pc-in-armbian%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay