{blast -- forgot to use email reply, so I'm going to be dinged by the
autoresponder again <G>}On Fri, 22 Nov 2019 01:54:48 -0800 (PST), in gmane.comp.hardware.beagleboard.user [email protected] wrote: >Hi, > >I'm trying to use spi1 on a BeagleBone Black. Since I don't know how to >deal with cape manager and to load dtbo files I decided to modify >am335x-boneblack.dts file. DTS file ><https://www.dropbox.com/s/s4vdtpebwo56fxu/am335x-boneblack.dts?dl=0> Also >I've learnt that I needed to deactivate HDMI and MCASP0. Despite so >/dev/spi1 device is not created. > You haven't mentioned compiling your modified DTS file... Really, if you can understand the device tree source enough to modify it, compile it, and place it into the correct location for subsequent boots, playing with /boot/uEnv.txt should be trivial... >The results of the commands below would indicate that the dts file is >properly modified but it seems there is still missing something. I've used >buildroot (LTS version) configured as "beaglebone_defconfig" > >[root@buildroot]# find / -name spi1 >/sys/devices/platform/ocp/481a0000.spi/spi_master/spi1 >/sys/class/spi_master/spi1 >/sys/firmware/devicetree/base/__symbols__/spi1 >/sys/firmware/devicetree/base/aliases/spi1 > Even the STOCK LXQT image (I have done nothing with device trees) https://debian.beagleboard.org/images/bone-debian-9.9-lxqt-armhf-2019-08-03-4gb.img.xz shows debian@beaglebone:~$ sudo find / -iname "spi1" [sudo] password for debian: /sys/devices/platform/ocp/48030000.spi/spi_master/spi1 /sys/class/spi_master/spi1 /sys/firmware/devicetree/base/__symbols__/spi1 /sys/firmware/devicetree/base/aliases/spi1 debian@beaglebone:~$ so your above check is likely meaningless. The following rambling is being done with the IoT image (I'd thought it might have already disabled HDMI, but nooooo....) https://elinux.org/BeagleBone_Black_Enable_SPIDEV appears to be quite out-of-date, since everything they mention finding via "ls" is shown without ever changing a device tree. And especially the echo BB-SPI1-01 > /sys/devices/bone_capemgr.*/slots as there is no capemgr directory in /sys/devices anymore. There is one in /sys/firmware/devicetree/base https://groups.google.com/forum/#!topic/beagleboard/RShjePl0noY is more up-to-date with current images >[root@buildroot]# find / -name spidev@1 >/sys/firmware/devicetree/base/ocp/spi@481a0000/spidev@1 No such critter... Actually, no .../spidev@anything (there ARE .../channel@0 and .../channel@1 ) And to confuse matters it appears that OVERLAY /dev BB-SPIDEV0-00A0 /spidev1.x BB-SPIDEV1-00A0 /spidev2.x Disabling all the system overlays and adding the SPIDEV overlays (difference in /boot/uEnv.txt shown next) debian@beaglebone:~$ diff /boot/uEnv.txt mod_uEnv.txt 19c19,20 < #uboot_overlay_addr4=/lib/firmware/<file4>.dtbo --- > uboot_overlay_addr4=/lib/firmware/BB-SPIDEV1-00A0.dtbo > uboot_overlay_addr5=/lib/firmware/BB-SPIDEV0-00A0.dtbo 28,32c29,33 < #disable_uboot_overlay_emmc=1 < #disable_uboot_overlay_video=1 < #disable_uboot_overlay_audio=1 < #disable_uboot_overlay_wireless=1 < #disable_uboot_overlay_adc=1 --- > disable_uboot_overlay_emmc=1 > disable_uboot_overlay_video=1 > disable_uboot_overlay_audio=1 > disable_uboot_overlay_wireless=1 > disable_uboot_overlay_adc=1 debian@beaglebone:~$ seems to work (once I figured out I had /spidev1.x jumpered wrong for the test program) Note: other than the "disable" lines above, the spi overlays were not mandatory -- config-pin is sufficient! #/dev/spidev1.x debian@beaglebone:~$ sudo config-pin p9_21 spi debian@beaglebone:~$ sudo config-pin p9_18 spi debian@beaglebone:~$ sudo config-pin p9_17 spi_cs debian@beaglebone:~$ sudo config-pin p9_22 spi_sclk #/dev/spidev2.x debian@beaglebone:~$ sudo config-pin p9_30 spi debian@beaglebone:~$ sudo config-pin p9_29 spi debian@beaglebone:~$ sudo config-pin p9_28 spi_cs debian@beaglebone:~$ sudo config-pin p9_31 spi_sclk #with jumper p9_21 <> p9_18 and p9_30 <> p9_29 #even without having the book, you can get/build the test program # http://exploringbeaglebone.com/source/ debian@beaglebone:~$ ./exploringBB/chp08/spi/spidev_test/spidev_test -D /dev/spidev2.0 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz) FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DE AD BE EF BA AD F0 0D debian@beaglebone:~$ ./exploringBB/chp08/spi/spidev_test/spidev_test -D /dev/spidev1.0 spi mode: 0 bits per word: 8 max speed: 500000 Hz (500 KHz) FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DE AD BE EF BA AD F0 0D debian@beaglebone:~$ HMMM! looks like "sudo" wasn't needed anymore, either. SEQUENCE to enable both SPI devices!: EDIT /boot/uEnv.txt CHANGE #disable_uboot_overlay_video=1 TO disable_uboot_overlay_video=1 REBOOT EXECUTE... (I put them into a shell script as I was doing so many reboots) debian@beaglebone:~$ cat setspi.sh #!/usr/bin/env bash #/dev/spidev1.x aka overlay spidev0 config-pin p9_21 spi config-pin p9_18 spi config-pin p9_17 spi_cs config-pin p9_22 spi_sclk #/dev/spidev2.x aka overlay spidev1 Conflicts with HDMI overlay config-pin p9_30 spi config-pin p9_29 spi config-pin p9_28 spi_cs config-pin p9_31 spi_sclk (if you do not disable video, the above will result in errors for pins 28, 29, and 31, used by HDMI) debian@beaglebone:~$ ./setspi.sh P9_29 pinmux file not found! sudo: no askpass program specified, try setting SUDO_ASKPASS Cannot write pinmux file: /sys/devices/platform/ocp/ocp*P9_29_pinmux/state P9_28 pinmux file not found! sudo: no askpass program specified, try setting SUDO_ASKPASS Cannot write pinmux file: /sys/devices/platform/ocp/ocp*P9_28_pinmux/state P9_31 pinmux file not found! sudo: no askpass program specified, try setting SUDO_ASKPASS Cannot write pinmux file: /sys/devices/platform/ocp/ocp*P9_31_pinmux/state Putting the SPIDEV overlays into /boot/uEnv.txt will result in locking the pins to SPI, removing them from config-pin set-up. -- Dennis L Bieber -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/kk3mtedan2c0q9k433kpe4i72o07ab77p6%404ax.com.
