Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No /dev/spidevA.B #22

Open
xboxplayer9889 opened this issue Mar 1, 2022 · 2 comments
Open

No /dev/spidevA.B #22

xboxplayer9889 opened this issue Mar 1, 2022 · 2 comments

Comments

@xboxplayer9889
Copy link

I tried to compile and insert in Mageia Linux 5.15.23-desktop-1.mga8 and an old computer with Debian Linux too. The Debian could compile and start /dev/spidev0.0-2 auto, but Mageia doesn't creates spidev devices.

`make

Error! Unknown action specified: spi-ch341-usb
make -C /lib/modules/5.15.23-desktop-1.mga8/build M=/root/gschorcht/spi-ch341-usb-master modules
make[1]: Entering directory '/usr/src/kernel-5.15.23-desktop-1.mga8'

Error! Unknown action specified: spi-ch341-usb
CC [M] /root/gschorcht/spi-ch341-usb-master/spi-ch341-usb.o

Error! Unknown action specified: spi-ch341-usb
MODPOST /root/gschorcht/spi-ch341-usb-master/Module.symvers
CC [M] /root/gschorcht/spi-ch341-usb-master/spi-ch341-usb.mod.o
LD [M] /root/gschorcht/spi-ch341-usb-master/spi-ch341-usb.ko
make[1]: Leaving directory '/usr/src/kernel-5.15.23-desktop-1.mga8'
`
after loading spi-ch341-usb.ko new spi devices appears in /sys/class/spi_master/spi0 but no /dev/spidev.

`journalctl -ae

kernel: usbcore: registered new interface driver spi-ch341-usb
kernel: usb 1-9: new full-speed USB device number 6 using xhci_hcd
kernel: usb 1-9: New USB device found, idVendor=1a86, idProduct=5512, bcdDevic>
kernel: usb 1-9: New USB device strings: Mfr=0, Product=0, SerialNumber=0
kernel: spi-ch341-usb 1-9:1.0: ch341_cfg_probe: output cs0 SPI slave with cs=0
kernel: spi-ch341-usb 1-9:1.0: ch341_cfg_probe: output cs1 SPI slave with cs=1
kernel: spi-ch341-usb 1-9:1.0: ch341_cfg_probe: output cs2 SPI slave with cs=2
kernel: spi-ch341-usb 1-9:1.0: ch341_cfg_probe: input gpio4 gpio=0 irq=0 (hwi>
kernel: spi-ch341-usb 1-9:1.0: ch341_cfg_probe: input gpio5 gpio=1 irq=1
kernel: spi-ch341-usb 1-9:1.0: ch341_spi_probe: SPI master connected to SPI bu>
kernel: spi-ch341-usb 1-9:1.0: ch341_spi_probe: SPI device /dev/spidev0.0 crea>
kernel: spi-ch341-usb 1-9:1.0: ch341_spi_probe: SPI device /dev/spidev0.1 crea>
kernel: spi-ch341-usb 1-9:1.0: ch341_spi_probe: SPI device /dev/spidev0.2 crea>
kernel: spi-ch341-usb 1-9:1.0: ch341_usb_probe: connected`

@xboxplayer9889
Copy link
Author

I can create it manually
echo spidev > /sys/bus/spi/devices/spiB.C/driver_override echo spiB.C > /sys/bus/spi/drivers/spidev/bind

https://www.kernel.org/doc/html/latest/spi/spidev.html

And now I found: https://github.com/dimich-dmb/spi-ch341-usb#using-spi-slaves

@xboxplayer9889
Copy link
Author

xboxplayer9889 commented Mar 5, 2022

Although I can compile and load driver, there is some error maybe I did something not well, but I cannot access anything on spidev0.0 with:

  • Debian 4.19.0-0.bpo.18-686-pae 4 usable GPIOs? #1 SMP Debian 4.19.208-1~deb9u1 (2021-10-10) i686 GNU/Linux
  • Mageia Linux 5.15.23-desktop-1.mga8

I can connect AT25DF321A to ch341a-SPIinterface and flashrom can read/write it on its builtin spi (ch341_spi) but no flash found on linux_spi:dev=/dev/spidev0.0.
I tried to read id from C but debian always read FF FF FF FF, Mageia gives error.
I tried avrdude mod with linuxspi, but couldn't found atmel chips on both Linuxes above.

Can anybody help which device/ic works and how to access it through this spi-dev driver?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant