Hi,
I am having troubles trying to load an out-of-tree module from this particular tutorial:
SPI Device Driver Tutorial - Linux Device Driver Tutorial Part 47 (embetronicx.com)
I am getting the error “omap2_mcspi 481a0000.spi: chipselect 0 already in use”
I think that means another driver is using chipselect 0. So, I rebuilt the kernel and made most SPI modules loadable instead of installed <*>. The one that seems to be causing trouble is spi_omap2_mcspi module. When the module is enabled, it seems to be using chipselect 0. When it is disabled, I get “SPI Master not found”. *spidev doesn’t seem to make any difference whether it is loaded or not, and neither do the overlays. I have tried enabling a disabled the overlays. I also noticed that both “spi_omap2_mcspi” and “spidev” have to be loaded in order for the spi devices to show up in /dev/.
I rebuilt the module using the correct kernel headers.
I loading the module using $sudo insmod spissd1306.ko
Loading and unloading modules is as simple as $sudo modprobe and $sudo rmmod
I recently upgrade the Kernel to 5.10.168-ti-r61 and Debian to 11.6 (Bullseye)
I don’t know if that has anything to do with it, but I posted it here anyways.
$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[1b1122751f7051bd8996f353756ba6ff30e71820]
eeprom:[A335BNLT00C03318BBBK16E8]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600)]:[location: dd MBR]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-00002-g07d5700e21 (Mar 06 2020 - 11:24:55 -0600)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.bb.org-overlays]
UBOOT: Loaded Overlay:[BB-SPIDEV0-00A0]
UBOOT: Loaded Overlay:[BB-SPIDEV1-00A0]
kernel:[5.10.168-ti-r61]
nodejs:[v12.22.12]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-SPIDEV0-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/BB-SPIDEV1-00A0.dtbo]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-customizations]:[1.20221108.0-0~buster+20221108]
pkg:[bb-usb-gadgets]:[1.20220816.0-0~buster+20220816]
pkg:[bb-wl18xx-firmware]:[1.20221201.0-0~buster+20221201]
pkg:[kmod]:[28-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100]
dmesg | grep remote
[ 11.101067] remoteproc remoteproc0: wkup_m3 is available
[ 49.855158] remoteproc remoteproc0: powering up wkup_m3
[ 49.867038] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[ 49.902449] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 86.263745] remoteproc remoteproc1: 4a334000.pru is available
[ 86.334608] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[ 0.179277] platform 4a326004.pruss-soc-bus: Cannot lookup hwmod 'pruss'
[ 86.263745] remoteproc remoteproc1: 4a334000.pru is available
[ 86.334608] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pinctrl-single
[ 9.431486] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 9.433202] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_03'
[ 9.433229] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
<***Removed Pins for brevity ***>
[ 12.000132] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END
[
Thank you,