无法在BeagleBone Green Wireless上配置SPI0 [英] Cannot configure SPI0 on BeagleBone Green Wireless
问题描述
注意:所选答案是解决问题的原始答案,有关更多详细信息,请参见下面的其他答案.
我无法在BeagleBone Green Wireless(BBGW)上配置SPI0.我正在尝试不使用覆盖而仅使用纯DeviceTree来实现这一目标.
I'm not able to configure SPI0 on my BeagleBone Green Wireless (BBGW). I'm trying to achieve this without using overlays, only pure DeviceTree.
/dev/spidev1.0
和/dev/spidev1.1
在那里,但是任何I/O都会返回垃圾.
/dev/spidev1.0
and /dev/spidev1.1
are there, but any I/O returns garbage.
连接到SCLK的示波器大部分显示噪声,这是图片(每张图片的时间范围不同).
Oscilloscope connected to SCLK displays mostly noise, here are pictures (each in different time scale).
.dts/.dtsi的重要部分:
Important parts of my .dts/.dtsi:
&am33xx_pinmux {
bb_spi0_pins: pinmux_bb_spi0_pins {
pinctrl-single,pins = <
BONE_P9_22 ( PIN_INPUT_PULLUP | MUX_MODE0 ) // SCLK
BONE_P9_21 ( PIN_INPUT_PULLUP | MUX_MODE0 ) // MISO
BONE_P9_18 ( PIN_OUTPUT_PULLUP | MUX_MODE0 ) // MOSI
BONE_P9_17 ( PIN_OUTPUT_PULLUP | MUX_MODE0 ) // CS0
>;
};
};
&spi0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_spi0_pins>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "linux,spidev";
spi-max-frequency = <16000000>;
reg = <0>;
};
channel@1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "linux,spidev";
spi-max-frequency = <16000000>;
reg = <1>;
};
};
更多信息:
More info:
- 我没有使用可用的
am335x-bone-pinmux-spi0.dtsi
,因为它启用了时钟相移(spi-cpha
) - 我打算使用SPI与DWM1000通讯
- 我正在使用带有上述DWM1000,一个电源转换器和2个电机驱动器的自定义斗篷,它们连接到P8连接器上的PRU引脚
- 完整的覆盖文件: https://github.com/GroupOfRobots/RobotConfig/tree/v3/DevTree
-
uEnv.txt
: https://github.com/GroupOfRobots/RobotConfig/blob/v3/uEnv.txt - 系统:
Debian 9.0 (testing)
- 内核:
4.4.80-ti-rt-r116
(我也尝试过使用不同的内核,但是我需要ti-rt
分支之一)
- I didn't use the available
am335x-bone-pinmux-spi0.dtsi
as it enables the clock phase shift (spi-cpha
) - I'm intending to use the SPI to communicate with a DWM1000
- I'm using a custom cape with the said DWM1000, a power converter and 2 motor drivers connected to PRU pins on P8 connector
- Full overlay files: https://github.com/GroupOfRobots/RobotConfig/tree/v3/DevTree
uEnv.txt
: https://github.com/GroupOfRobots/RobotConfig/blob/v3/uEnv.txt- system:
Debian 9.0 (testing)
- kernel:
4.4.80-ti-rt-r116
(I've tried on different ones too, but I need one of theti-rt
branch)
PS.我知道它是BBGW而不是BBB,但是BBG/BBGW还没有标签.
PS. I know it's BBGW not BBB but there are no tags for BBG/BBGW (yet).
更新:
该行为已在其他内核上被验证为相同,即:
The behaviour was verified to be the same on other kernels, namely:
- 4.4.85-armv7-x14
- 4.4.84-ti-r120
- 4.4.85-bone19
另外,我还用跳线将MISO和MOSI(P9上的引脚18和21)连接在一起,然后运行了spidev_test
,结果如下:
Additionally I've connected together MISO and MOSI (pins 18 and 21 on P9) with a jumper wire and ran spidev_test
, here are the results:
$ sudo ./spidev_test -v -p "abcdefghijklmnopqrstuvwxyz1234\xde\xad"
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 31 32 33 34 DE AD | abcdefghijklmnopqrstuvwxyz1234ޭ
RX | 03 0C 0F 30 33 3C 3F C0 C3 CC CF F0 F3 FC FF 00 03 0C 0F 30 33 3C 3F C0 C3 CC 03 0C 0F 30 FC F3 | ...03<?�������.....03<?���...0��
我无法用它做任何事,但是我几乎可以确定这不是由于时钟线上的电容器所致,该电容器在本次测试中未使用.
I can't make anything out of it, but it makes me almost sure it's not due to the capacitors on clock line, which is unused in this test.
推荐答案
我遇到了同样的问题,我使用的是adafruit-spi0叠加层,但无法正常工作.我能够在从属spi设备上发送数据,并且接收到的数据还可以,但是当第二个设备将数据发送回BBGW时,我没有收到我发送的值.
I had the same problem, i was using adafruit-spi0 overlays and i couldn't get it working. I was able to send the data on a slave spi device and the recieved data was ok, but when the second device sends the data back to my BBGW i was not getting the values that i have sent.
这就是我解决的方法,spi0 clk上有两个电容器100pf,它们会引起反射,从而导致双时钟数据,您需要将其删除.
This is how i solved this, there are two capacitors 100pf on the spi0 clk they are causing reflections resulting in double-clocked data, you need to remove them.
我的董事会是从一家老牌工作室订购的.
My board was oredered from seeed studio.
这篇关于无法在BeagleBone Green Wireless上配置SPI0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!