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.

AM625: SPI interface with w25q64 flash

Part Number: AM625
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I am trying to communicate w25q64 flash over spi.

my config flag is:

CONFIG_SPI_SPIDEV=y
CONFIG_SPI_DEBUG=y

CONFIG_SPI=y
CONFIG_SPI_MASTER=y

DTS for SPI.

main_spi1_pins_default: main-spi1-pins-default {
                pinctrl-single,pins = <
                        AM62X_IOPAD(0x0020, PIN_OUTPUT, 1) /* (J25) OSPI0_D5.SPI1_CLK */
                        AM62X_IOPAD(0x001c, PIN_OUTPUT, 1) /* (J23) OSPI0_D4.SPI1_CS0 */
                        AM62X_IOPAD(0x0034, PIN_OUTPUT, 1) /* (H21) OSPI0_CSn2.SPI1_CS1 */
                        AM62X_IOPAD(0x0024, PIN_OUTPUT, 1) /* (H25) OSPI0_D6.SPI1_D0 */
                        AM62X_IOPAD(0x0028, PIN_INPUT, 1) /* (J22) OSPI0_D7.SPI1_D1 */
                >;

};

&main_spi1 {
        pinctrl-names = "default";
        pinctrl-0 = <&main_spi1_pins_default>;
        cs-gpios =  <&main_gpio0 13 GPIO_ACTIVE_LOW>,
                    <&main_gpio0 7 GPIO_ACTIVE_HIGH>;
        spidev2@0 {
                compatible = "winbond,w25q64","jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <24000000>;
                status = "okay";
        };
        spidev2@1 {
                compatible = "winbond,w25q64","jedec,spi-nor";
                reg = <1>;
                spi-max-frequency = <24000000>;
                status = "okay";
        };

};

Output from dmesg
root@sm2s-am6254:~# dmesg | grep -i spi

[ 1.433581] spidev2@1 enforce active low on chipselect handle
[ 1.439592] omap2_mcspi 20110000.spi: registered master spi1
[ 1.439768] spi spi1.0: setup: speed 24000000, sample leading edge, clk normal
[ 1.439781] spi spi1.0: setup mode 0, 8 bits/w, 24000000 Hz max --> 0
[ 1.439995] spi-nor spi1.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00
[ 1.447074] omap2_mcspi 20110000.spi: registered child spi1.0
[ 1.447092] spi spi1.1: setup: speed 24000000, sample leading edge, clk normal
[ 1.447100] spi spi1.1: setup mode 0, 8 bits/w, 24000000 Hz max --> 0
[ 1.447254] spi-nor spi1.1: unrecognized JEDEC id bytes: 00 00 00 00 00 00
[ 1.454311] omap2_mcspi 20110000.spi: registered child spi1.1

Thank you,

Chintan

  • Hi Chintan,

                            AM62X_IOPAD(0x0020, PIN_OUTPUT, 1) /* (J25) OSPI0_D5.SPI1_CLK */
                            AM62X_IOPAD(0x001c, PIN_OUTPUT, 1) /* (J23) OSPI0_D4.SPI1_CS0 */
                            AM62X_IOPAD(0x0034, PIN_OUTPUT, 1) /* (H21) OSPI0_CSn2.SPI1_CS1 */
                            AM62X_IOPAD(0x0024, PIN_OUTPUT, 1) /* (H25) OSPI0_D6.SPI1_D0 */
                            AM62X_IOPAD(0x0028, PIN_INPUT, 1) /* (J22) OSPI0_D7.SPI1_D1 */

    Are these pinmux settings generated from SysConfig tool? Please use "PIN_INPUT" instead of "PIN_OUTPUT" on these pins.

  • Are these pinmux settings generated from SysConfig tool?
    no.

    I do as "PIN_INPUT" as you say. I am not getting result. :- 


    [ 1.413626] spi spi1.0: setup: speed 24000000, sample leading edge, clk normal
    [ 1.413640] spi spi1.0: setup mode 0, 8 bits/w, 24000000 Hz max --> 0
    [ 1.413886] spi-nor spi1.0: unrecognized JEDEC id bytes: ff ff ff ff ff ff
    [ 1.420968] omap2_mcspi 20110000.spi: registered child spi1.0
    [ 1.420986] spi spi1.1: setup: speed 24000000, sample leading edge, clk normal
    [ 1.420994] spi spi1.1: setup mode 0, 8 bits/w, 24000000 Hz max --> 0
    [ 1.421169] spi-nor spi1.1: unrecognized JEDEC id bytes: ff ff ff ff ff ff
    [ 1.428234] omap2_mcspi 20110000.spi: registered child spi1.1

    main_SPI1 there is two w25q64 flash IC connected.

    What I am missing. please help me.

    Thank you.

  • Hi,

    CONFIG_SPI_SPIDEV=y
    CONFIG_SPI_DEBUG=y
    CONFIG_MTD_JEDECPROBE=y
    CONFIG_FTL=y
    CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
    CONFIG_SPI_OMAP24XX=y

    Is there any thing that is miss to enable?

    [ 0.000000] GICv3: 256 SPIs implemented
    [ 0.000000] GICv3: 0 Extended SPIs implemented
    [ 1.117423] omap2_mcspi 4b00000.spi: registered master spi3
    [ 1.118446] omap2_mcspi 4b10000.spi: registered master spi4
    [ 1.119351] omap2_mcspi 20100000.spi: registered master spi2
    [ 1.119501] omap2_mcspi 20100000.spi: cs159 >= max 1
    [ 1.124485] spi_master spi2: spi_device register error /bus@f0000/spi@20100000/flash1@0
    [ 1.132487] spi_master spi2: Failed to create SPI device for /bus@f0000/spi@20100000/flash1@0
    [ 1.141888] omap2_mcspi 20110000.spi: registered master spi1
    [ 1.142034] omap2_mcspi 20110000.spi: cs144 >= max 1
    [ 1.147013] spi_master spi1: spi_device register error /bus@f0000/spi@20110000/flash2@0
    [ 1.155018] spi_master spi1: Failed to create SPI device for /bus@f0000/spi@20110000/flash2@0
    [ 1.164352] omap2_mcspi 20120000.spi: registered master spi5


  • Hi!

    Can you try probing the signals with a logic analyzer if you get any data on CLK/CS0/D0/D1? This will help narrowing down where the issue might be.

    Regards, Andreas

  • hello Andreas,

    SPI issue is resolved.. thanks for your support..

    Thank you,
    Chintan

  • Hi Chintan,

    can you please let me know what the issue was? It will be generally helpful to understand this.

    Thanks, Andreas

  • hello Andreas,

    There is hardware issue.
    actually IC is shorted..

    Thanks,
    Chintan