my PCB board uses nRF9161 SiP. The flash chip is W25N02KVZEIR.
on the PCB board, here are the wiring to spi flash chip,
P0.26 to CS#, P0.27 to CLK, P0.28 to MOSI, P0.29 to MOSO, P0.30 to WP# and P0.31 to HOLD#.
I created the build configuration based on nRF9161DK_nRD9161_ns. For the detail, please check the attached zip file.
After I did pristine build and flash the firmware to the board, I got this running error as below,
*************************
[00:00:00.250,152] [0m<dbg> os: setup_thread_stack: stack 0x20001d80 for thread 0x20000798: obj_size=1024 buf_start=0x20001d80 buf_size 1024 stack_ptr=0x20002180[0m
[00:00:00.250,183] [0m<dbg> os: setup_thread_stack: stack 0x20001c40 for thread 0x20000718: obj_size=320 buf_start=0x20001c40 buf_size 320 stack_ptr=0x20001d80[0m
[00:00:00.250,213] [0m<dbg> clock_control: clkstarted_handle: lfclk: Clock started[0m
[00:00:00.250,244] [0m<dbg> os: setup_thread_stack: stack 0x20001140 for thread 0x20000238: obj_size=768 buf_start=0x20001140 buf_size 768 stack_ptr=0x20001440[0m
[00:00:00.250,366] [0m<dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200020a8 - rx_bufs 0x200020b0 - 1[0m
[00:00:00.250,396] [0m<dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200020b8 (2), current_rx 0x200020b8 (2), tx buf/len 0x200020a0/1, rx buf/len 0x200020a0/1[0m
[00:00:00.250,457] [0m<dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0x200020ef/1[0m
[00:00:00.250,457] [0m<dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0x200020ef/1[0m
[00:00:00.250,518] [0m<dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0[0m
[00:00:00.250,518] [0m<dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0[0m
[00:00:00.250,549] [0m<dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0[0m
[00:00:00.250,610] [0m<dbg> spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x200020c0 - rx_bufs 0x200020c8 - 1[0m
[00:00:00.250,610] [0m<dbg> spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x200020d0 (2), current_rx 0x200020d0 (2), tx buf/len 0x200020b8/1, rx buf/len 0x200020b8/1[0m
[00:00:00.250,671] [0m<dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0x20002104/3[0m
[00:00:00.250,701] [0m<dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0x20002104/3[0m
[00:00:00.250,762] [0m<dbg> spi_nrfx_spim: spi_context_update_tx: tx buf/len 0/0[0m
[00:00:00.250,762] [0m<dbg> spi_nrfx_spim: spi_context_update_rx: rx buf/len 0/0[0m
[00:00:00.250,793] [0m<dbg> spi_nrfx_spim: finish_transaction: Transaction finished with status 0[0m
[00:00:00.250,823] [1;31m<err> spi_nor: Device id 00 ef aa does not match config ef aa 22[0m
*** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
*** Using Zephyr OS v4.0.99-a0e545cb437a ***
[00:00:00.250,915] [0m<dbg> os: k_sched_unlock: scheduler unlocked (0x20000798:0)[0m
***** Hub SPI flash tester version: 1.0.4 ****
--- SPI Flash Verification Started ---
ERROR: Flash device 'W25N02KV' is not ready.
************************
The error is "spi_nor: Device id 00 ef aa does not match config ef aa 22". Somehow, the manufacturer ID is wrong.
I wrote the separte testing firmware to check all spi flash chip control pins from P0.26 to P0.31. All these pins works properly and the signal is very clean. The spi flash chip and nRF9161 SiP chip are powered by 3.3V. The power source is very clean on Osiloscope.
Do you have any idea why I cannot get the correct manufacturer id? anything wrong in my configurations or the c codes?