Re: AM335x BeagleBone SPI Issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/12/12 16:24, Jack Mitchell wrote:
On 11/12/12 15:22, Ben Gamari wrote:
Jack Mitchell <ml@xxxxxxxxxxxxxxxxxxx> writes:

Shubhro, Felipe,

Thank you, the reordering dma patch fixed the dma issue I was having!
However, the bad news, I now get the same results for the dma and
non-dma spidev test. While the scope shows the SPI clk and data is fine,
the reading from the program still shows 0x00 for all words.

Just to make sure this has been thought of: I've seen this sort of
behavior in the past when the CLK pin wasn't configured as an input.

Cheers,

- Ben


Ok, Ben, well spotted indeed! I changed the dtsi to use INPUT_PULLUP instead of OUTPUT_PULLUP and wallah!

  am3358_pinmux: pinmux@44e10800 {
    spi0_pins: pinmux_spi0_pins {
      pinctrl-single,pins = <
0x150 *0x30* /* spi0_sclk.gpio0_2, INPUT_PULLUP | MODE0 */<------------ changed to INPUT
        0x154 0x30      /* spi0_d0.gpio0_3, INPUT_PULLUP | MODE0 */
        0x158 0x10      /* spi0_d1.i2c1_sda, OUTPUT_PULLUP | MODE0 */
        0x15c 0x10      /* spi0_cs0.i2c1_scl, OUTPUT_PULLUP | MODE0 */
      >;
    };
    spi1_pins: pinmux_spi1_pins {
      pinctrl-single,pins = <
0x190 *0x33* /* mcasp0_aclkx.spi1_sclk, INPUT_PULLUP | MODE3 */ <------------ changed to INPUT
        0x194 0x33  /* mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 */
        0x198 0x13  /* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */
        0x19c 0x13  /* mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */
      >;
    };


root@beaglebone:~# ./spidev
spi mode: 0
bits per word: 16
max speed: 24000000 Hz (24000 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D
root@beaglebone:~# ./spidev_dma
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00
FF 00 FF 00 FF 00

We are in business!

Almost.

I then tried spi1 and received:

root@beaglebone:~# ./spidev -D /dev/spidev2.0
spi mode: 0
bits per word: 16
max speed: 24000000 Hz (24000 KHz)

FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF
root@beaglebone:~# ./spidev_dma -D /dev/spidev2.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
root@beaglebone:~#



My bad! The jumper bridge had come loose, it works now! Yippee!

root@beaglebone:~# ./spidev -D /dev/spidev2.0
spi mode: 0
bits per word: 16
max speed: 24000000 Hz (24000 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D
root@beaglebone:~#

Thanks everyone, and do I need to submit any patches to clear this all up?

Currently all I see is changing the clk pins from output to input (if this is a valid change?).

--

  Jack Mitchell (jack@xxxxxxxxxxx)
  Embedded Systems Engineer
  http://www.embed.me.uk

--

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux