Page 1 of 1

Issue with reading JEDEC ID in Zephyr

Posted: Sat Mar 28, 2026 4:24 pm
by alireza_asvady
Hi,

I am using Zephyr in my project with an external NOR flash (W25Q256) connected to SPI2. I can successfully read, write, and erase the flash, and I am also able to read the JEDEC ID using a simple custom function.
I decided to use NVS to store configuration data, so I updated my device tree as shown below:

&spi2 {
status = "okay";
pinctrl-0 = <&spim2_default>;
pinctrl-names = "default";
cs-gpios = <&gpio0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;

w25q256: flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <1000000>;
// spi-hold-cs;
label = "W25Q64JV";
jedec-id = [ef 40 17];
size = <0x800000>;
spi-cpol;
spi-cpha;
};
};

However, during boot, when the ESP32 attempts to read the JEDEC ID, it returns 0. I analyzed the SPI signals using a logic analyzer and observed an unexpected rising edge on CS between the command (0x9F) and the three response bytes.
Could you please help me understand what might be causing this issue and how to fix it?
pulse.jpg
pulse.jpg (41.42 KiB) Viewed 46 times