This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358 SPI1 read always 0



Hi.

    i use ti-processor-sdk-linux-am335x-evm-02.00.00.00 for my beaglebone black board and want to use SPI peripheral。

    i enable SPI1 in dts and add SPI1 pin mux like this:

pinctrl-single,pins = <
    0x190 ( PIN_OUTPUT | MUX_MODE3 ) /* (A13) mcasp0_aclkx.spi1_sclk */
    0x194 ( PIN_INPUT | MUX_MODE3 ) /* (B13) mcasp0_fsx.spi1_d0 */
    0x198 ( PIN_OUTPUT | MUX_MODE3 ) /* (D12) mcasp0_axr0.spi1_d1 */
    0x19c ( PIN_OUTPUT | MUX_MODE3 ) /* (C12) mcasp0_ahclkr.spi1_cs0 */
>;

finally,i short SPI1_D0 and SPI1_D1 ,use spidev_test -D /dev/spidev1.0 BUT IT ALWAYS RETURN 0.

i check signal via oscilloscope and find that SPI1_SCK、SPI1_D1、SPI1_CS is OK,then i connect SPI1_D0 to Vdd,it also return 0.

i add some debug info in driver  that when write a message,it will print SPI1 register value like

[   15.721310] 0x481a0114 = 0x00000001
[   15.724826] 0x481a0124 = 0x00000000
[   15.728324] 0x481a0128 = 0x00000001
[   15.731839] 0x481a012c = 0x201103fc
[   15.735337] 0x481a0130 = 0x00000002
[   15.738834] 0x481a0134 = 0x00000501 

i don't know who to solve it, can you help me.

sorry for my pool english

thx

  • Change: 0x190 ( PIN_OUTPUT | MUX_MODE3 ) /* (A13) mcasp0_aclkx.spi1_sclk */
    to: 0x190 ( PIN_INPUT | MUX_MODE3 ) /* (A13) mcasp0_aclkx.spi1_sclk */

    See Note 1 below Table 24-4 from the AM335X TRM Rev. M for explanation.

    NOTE: You can use the search bar on top of the forum window to find threads with problems similar to yours and respectively solutions.