mboehmer Posted March 12 Posted March 12 Hi, after a long time I started up my C4 and tried both the standard download kernel as well as a home compiled one. I need SPI on the C4, so I changed the device tree to meson-sm1-odroid-c4-spidev.dtb, and see spidev kernel modul loaded, but no driver, and I don't get any signals on the corresponding pins. Any help is appreciated - would be great to have SPI working again... See you, Michael 0 Quote
daniel_ Posted May 28 Posted May 28 Hello Michael, Unfortunately I am bit late to the party, but it seems that you have to specify fdtfile in armbianEnv.txt. The path needs to be amlogic/..., exactly like discovered in Otherwise you won't be able to boot and need to edit the file with another linux/unix. Add this to your /boot/armbianEnv.txt # Add to /boot/armbianEnv.txt fdtfile=amlogic/meson-sm1-odroid-c4-spidev.dtb overlays=spi0 spi-spidev spidev # TODO check which one is the right one ;) #param_spidev_spi_bus=0 # Not needed at least for spidev0.x Changing the status to "okay" in meson-sm1-odroid-c4.dtb does not do the trick, despite getting high hopes reading https://wiki.odroid.com/odroid-c4/application_note/gpio/spi#tab__odroid-c4. Nevertheless it can't hurt to check the status in meson-sm1-odroid-c4-spidev.dtd: fdtget /boot/dtb/amlogic/meson-sm1-odroid-c4-spidev.dtb /soc/bus@ffd00000/spi@15000 status fdtget /boot/dtb/amlogic/meson-sm1-odroid-c4-spidev.dtb /soc/bus@ffd00000/spi@15000/spidev@0 status Make sure to load the spidev kernel module at startup, i.e. by adding to /etc/modules # Append /etc/modules spidev Note: I did a diff between both de-compiled dtb files, but haven't checked yet, if something else could be affected by using the spidev variant. Hope this helps! I would highly appreciate it, if you could have a look into the overlays= / param_spidev_bus= and report your findings. Thanks in advance! Best, Daniel G. 0 Quote
mboehmer Posted May 30 Author Posted May 30 Will check after some other issues, thanks for your input! We use an Odroid C2 meanwhile, it is slow, but works. 0 Quote
mboehmer Posted September 14 Author Posted September 14 Let me revive this thread, finally I found time to get into the issue again. I use the latest C4 server image (Ubuntu 24.04). Changes made so far: I added a line fdtfile=amlogic/meson-sm1-odroid-c4-spidev.dtb into the armbianEnv.txt, which seems at least to load the spidev kernel module. A /dev/spidev0.0 is created, and I can use the standard test program found on https://github.com/KnCMiner/spi-test/blob/master/spi-test.c It seems to work, there are no errors invoking the program, but the I/Os of SPI stay inactive, no matter what I do. gpioinfo shows the lines on PIN_19, PIN_21, PIN_23 and PIN_24 as "unused": Seem that basically the SPI controller is working, but the I/O mux is not setup correctly. Anyone who can contribute here? I can test with logic analyzer, in case some input is given to me 0 Quote
mboehmer Posted September 15 Author Posted September 15 Thanks to Igor, I have a patch now in the build system (own branch - fix-spi-c4). Would be nice if someone could countercheck if that one also works in other place than mine. 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.