Issue of Nordic AT45 DataFlash driver demo on (nrf9160dk/nrf9160) board.

Hello,

I am trying to play the AT45 DataFlash driver by directly copying the sample code from nRF connect SDK v2.9.1 (C:\ncs\v2.9.1\zephyr\samples\drivers\spi_flash_at45).

Board target: nrf9160dk/nrf9160.

I did not modify anything in the sample code.

I used the nrf9160dk_nrf9160.overlay as default:

&pinctrl {
    spi3_default_alt: spi3_default_alt {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
                <NRF_PSEL(SPIM_MOSI, 0, 12)>,
                <NRF_PSEL(SPIM_MISO, 0, 13)>;
        };
    };

    spi3_sleep_alt: spi3_sleep_alt {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
                <NRF_PSEL(SPIM_MOSI, 0, 12)>,
                <NRF_PSEL(SPIM_MISO, 0, 13)>;
            low-power-enable;
        };
    };
};

&spi3 {
    pinctrl-0 = <&spi3_default_alt>;
    pinctrl-1 = <&spi3_sleep_alt>;
    pinctrl-names = "default", "sleep";
    cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>,
           <&gpio0 10 GPIO_ACTIVE_LOW>;

    at45db0: at45db041e@0 {
        compatible = "atmel,at45";
        reg = <0>;
        spi-max-frequency = <15000000>;
        jedec-id = [1f 24 00];
        size = <4194304>;
        sector-size = <65536>;
        block-size = <2048>;
        page-size = <256>;
        enter-dpd-delay = <2000>;
        exit-dpd-delay = <35000>;
        status = "disabled";
    };

    at45db1: at45db321e@1 {
        compatible = "atmel,at45";
        reg = <1>;
        spi-max-frequency = <15000000>;
        jedec-id = [1f 27 01];
        size = <33554432>;
        sector-size = <65536>;
        block-size = <4096>;
        page-size = <512>;
        use-udpd;
        enter-dpd-delay = <1000>;
        exit-dpd-delay = <180000>;
        status = "okay";
    };
};

&uart0 {
    /*
     * Only TX is used in this sample, so disable RX to prevent UART
     * receiver from being enabled and consuming power.
     */
    disable-rx;
};

For the hardware, I used AT45DB321E-MHF-T chip and wired it to my nRF9160 DK followed by above pin layout.

However, the diver is not working and cannot retrieve the correct data as expected:

[00:00:00.301,055] <err> spi_flash_at45: Wrong JEDEC ID: 00 00 00, expected: 1F 27 01
*** Booting nRF Connect SDK v2.9.1-60d0d6c8d42d ***
*** Using Zephyr OS v3.7.99-ca954a6216c9 ***
DataFlash sample on nrf9160dk
at45db321e@1: device not ready.

I used the oscilloscope to probe the CS pin. The signal was staying HIGH when the board power on but never go LOW when the board flashed.

Has anyone ever made this demo working?

Related