NOR FLASH W25Q16 Zephyr example cannot bind device

Hi, I trying to run the spi_flash example form zephyr.

My sdk in 1.9.1 - nrf52840 in a custom board.

I have tried everything and I always get the same result:

JEDEC SPI-NOR SPI flash testing
==========================
SPI flash driver W25Q16 was not found!
[00:00:00.317,291] [1;31m<err> spi_nor: Device id 00 00 00 does not match config ef 40 15

And I  don't see any activity with the oscilloscope in the memory's pins, the CS is always at VCC.

FACT 1:

I have tried another example using the nrfx SPIM driver and I see the corresponding signals (CS MOSI MISO, etc). So, this is not a hardware error.

Here you have my DTS CONFIG for the SPI and the flash mem:

&spi1 {
    compatible = "nordic,nrf-spi";
    status = "okay";
    sck-pin = <19>;
    mosi-pin = <23>;
    miso-pin = <21>;

    cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; /* CS pin array assignament */

    w25q16: w25q16@0 {
            compatible = "jedec,spi-nor";
            reg = <0>;
            spi-max-frequency = <80000000>;
            label = "W25Q16";
            jedec-id = [ef 40 15]; /* Check datasheet */
            size = <16777216>;
            reset-gpios = <&gpio0 20 0>;
    };
};

Also my proj.conf:

CONFIG_STDOUT_CONSOLE=y
CONFIG_FLASH=y
CONFIG_SPI=y
CONFIG_PM_DEVICE=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_GPIO=y
CONFIG_RTT_CONSOLE=y
CONFIG_LOG=y
CONFIG_FLASH_LOG_LEVEL_DBG=y

Also I have followed this thread: https://devzone.nordicsemi.com/f/nordic-q-a/75393/how-to-get-started-with-zephyr-fs-on-external-nor-flash and others without any promising result. Please HELP!!!

Related