I'm trying out to operate an external flash and first thing to try before anything was the spi_flash sample.
*** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
w25q16jw@0 SPI flash testing
==========================
Perform test on single sector
Test 1: Flash erase
Flash erase succeeded!
Test 2: Flash write
Attempting to write 4 bytes
Data read does not match data written!!
000ff000 wrote 55 read ff MISMATCH
000ff001 wrote aa read ff MISMATCH
000ff002 wrote 66 read ff MISMATCH
000ff003 wrote 99 read ff MISMATCH
While it says erase operation succeeded? writing fails. I question if flash erase operation was actually done. The flash memory is powered by LDO2 of NPM1300 and in case I disable it, the erase operation never happens as the device never become ready and the application does not continue. Below you can find the device tree details and the additional configuration applied to spi_flash example.
&qspi { status = "ok"; pinctrl-0 = <&qspi_default>; pinctrl-1 = <&qspi_sleep>; pinctrl-names = "default", "sleep"; w25q16jw: w25q16jw@0 { status = "ok"; compatible = "nordic,qspi-nor"; reg = <0>; sck-frequency = <80000000>; jedec-id = [ef 60 15]; size = <DT_SIZE_M(16)>; has-dpd; writeoc = "pp4io"; readoc = "read4io"; t-enter-dpd = <3000>; t-exit-dpd = <30000>; }; };