Martin Petrašovský Posted March 5 Posted March 5 (edited) I am experiencing an issue with my Rock Pi S. When using SPI1, I am not observing any CLK output signal on pin GPIO3_B3, which I have verified with an oscilloscope. Other signals such as MOSI, MISO, and CS are functioning correctly. I have found that this issue does not occur in the older kernel 4.4.143-65-rockchip-g58431d38f8f3. However, when using the latest Armbian 25.2.2 Bookworm Minimal / IOT image, this problem arises. Could someone please assist me in resolving this problem? Edited March 5 by Martin Petrašovský 0 Quote
brentr Posted March 5 Posted March 5 I will have a look at this over the weekend. Could you provide source code for your test case? 0 Quote
Martin Petrašovský Posted March 12 Author Posted March 12 Hi, did you manage to find out where the problem is? I use this code for testing: https://github.com/KnCMiner/spi-test 0 Quote
Cromefire_ Posted 13 hours ago Posted 13 hours ago (edited) I also have the same problem, it used to work fine with an older version of armbian and the old 4.4 Kernel, but after an upgrade it just stopped working. The following should serve as a test when connection MOSI and MISO: ~# dd if=/dev/urandom bs=1 count=16 status=none | spi-pipe -d /dev/spidev1.0 -s 1000000 -b 16 | hexdump -C Querying my MCP3008 it just returns all zeros: ~# printf '\x01\x80\x00' | spi-pipe -d /dev/spidev1.0 -s 100000 -b 3 | hexdump -C 00000000 00 00 00 |...| 00000003 I'm using the following DT: /dts-v1/; /plugin/; /{ metadata { title = "Enable spidev on SPI1"; compatible = "unknown"; category = "misc"; exclusive = "GPOI3_B2", "GPOI3_B3", "GPOI3_B4", "GPOI3_B5"; description = "Enable spidev on SPI1 on pin 39, 40, 41 & 42."; }; }; &spi1 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&spi1_clk &spi1_csn0 &spi1_miso &spi1_mosi>; #address-cells = <1>; #size-cells = <0>; spidev@0 { compatible = "rockchip,spidev", "armbian,spi-dev"; reg = <0>; spi-max-frequency = <50000000>; }; }; The SPI is showing up, but it's just always producing zeros, it seems there's just something wrong with a newer SPI driver or something, maybe a new kernel upstream fix or kernel patch is needed here. I sadly don't have a backup of the old image to test with, but it the same rust software I wrote that worked before, doesn't work anymore now and it can't even talk to itself anymore. I don't have an oscilloscope to see exactly whats going on, but something funky is happening with the clock signal indeed: ~# cat /sys/kernel/debug/clk/clk_spi1/clk_rate 108333334 Max clock should be 50M as per the DTS file, but it seems the driver just ignores this. Event though spi-config shows something else (when reconfiguring it): /dev/spidev1.0: mode=0, lsb=0, bits=8, speed=100000, spiready=0 I also don't find any way to build an old kernel 4.4 image anymore (the legacy branch doesn't exist anymore), so I can't do that either and the edge-based Kernel 6.18.0-rc6-edge-rockchip64 also don't bring any improvements it seems. Edited 13 hours ago by Cromefire_ spi-config output 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.