Issue with reading JEDEC ID in Zephyr

alireza_asvady
Posts: 1
Joined: Fri Mar 27, 2026 3:03 am

Issue with reading JEDEC ID in Zephyr

Postby alireza_asvady » Sat Mar 28, 2026 4:24 pm

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 45 times

Who is online

Users browsing this forum: meta-externalagent, Semrush [Bot] and 20 guests