<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123524/spi_nor-device-id-00-ef-aa-does-not-match-config-ef-aa-22</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Aug 2025 07:16:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123524/spi_nor-device-id-00-ef-aa-does-not-match-config-ef-aa-22" /><item><title>RE: spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/thread/545311?ContentTypeID=1</link><pubDate>Tue, 12 Aug 2025 07:16:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da991a44-1d08-4bf8-91ad-3a125db5a285</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am glad to hear that you found a solution, and things are running as they should now!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/thread/545262?ContentTypeID=1</link><pubDate>Mon, 11 Aug 2025 17:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3608a419-ae67-4c3f-92a8-d2787d294398</guid><dc:creator>Mike Zhao</dc:creator><description>&lt;p&gt;The firmware is now functioning correctly after implementing a workaround for an incompatibility between the nRF Connect SDK and the Winbond W25N02KV SPI NAND flash chip. Hardware diagnostics confirmed all pins are working properly.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Root Cause:&lt;/b&gt; The issue stems from a protocol mismatch in the SPI communication. The nRF Connect SDK&amp;#39;s standard &lt;code&gt;spi_nor&lt;/code&gt; driver is not directly compatible with the W25N02KV chip&amp;#39;s response behavior.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The driver&amp;#39;s &lt;code&gt;spi_nor_read_jedec_id&lt;/code&gt; function sends a command and expects an immediate 3-byte device ID in reply.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;However, the W25N02KV chip responds with a single dummy byte before transmitting the 3-byte ID.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This behavior is consistent across all read operations, causing data misalignment.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Resolution:&lt;/b&gt; A successful workaround was implemented with the following code modifications:&lt;/p&gt;
&lt;ol start="1"&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;spi_nor_read_jedec_id&lt;/code&gt; function was modified to read and discard the initial dummy byte before processing the device ID.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The application-level &lt;code&gt;flash_read&lt;/code&gt; functions were also updated to discard this leading dummy byte from the incoming data stream.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These changes have resolved the issue and restored full functionality.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/thread/545241?ContentTypeID=1</link><pubDate>Mon, 11 Aug 2025 14:21:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75c68c41-f7e9-421a-80a4-a941536cb150</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you scoped the SPI pins to see if they behave as expected, ie. correspond with the log output?&lt;/p&gt;
&lt;p&gt;Can you please share what changes you&amp;#39;ve done to the board files?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/thread/545081?ContentTypeID=1</link><pubDate>Fri, 08 Aug 2025 16:47:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7471bf2b-42d7-4eca-a3ea-0d76386d699c</guid><dc:creator>Mike Zhao</dc:creator><description>&lt;p&gt;Hi Hakon,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your quick response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As what you mentioned above, I also tried to add the following 2 lines to my prj.conf file, but the testing result is same. The firmware is still not able to read the manufacturer ID properly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CONFIG_TFM_SECURE_UART=n&lt;br /&gt;CONFIG_TFM_LOG_LEVEL_SILENCE=y&lt;/p&gt;
&lt;p&gt;I config my board based on nRF9161DK_nRF9161_ns. For the detail, you can check test_spi_flash.zip which I uploaded early.&lt;/p&gt;
&lt;p&gt;In my overlay file, I disabled the following devices,&lt;/p&gt;
&lt;p&gt;******&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;spi3&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart0&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart1&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;uart2&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;i2c2&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;status&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;disabled&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;******&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I also redefined uart3 as following,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; uart3_default: &lt;/span&gt;&lt;span&gt;uart3_default&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;group1&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;psels&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_TX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;4&lt;/span&gt;&lt;span&gt;)&amp;gt;, &amp;lt;&lt;/span&gt;&lt;span&gt;NRF_PSEL&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;UART_RX&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;)&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;So, it should not have conflict configuration to&amp;nbsp;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#.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Do you have any advice?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/thread/545066?ContentTypeID=1</link><pubDate>Fri, 08 Aug 2025 13:12:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f715e1b8-8426-4f1b-bc0e-2556cb253e1e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How do you build your board? Is it based on &amp;quot;nrf9161dk/nrf9161&amp;quot; board? If so, the UARTs are used for your pins:&lt;/p&gt;
[quote user=""]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#.[/quote]
&lt;p&gt;This means that any multi-image build must also have these uart&amp;#39;s either redefined or disabled.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did you try this?&lt;/p&gt;
[quote user="hkn"]If you use the board nrf9161dk/nrf9161, ie. the secure image of the board, does it work as expected then?[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/thread/544986?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2025 17:47:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:655ad1f9-1806-4438-86b2-1c256f6e0c08</guid><dc:creator>Mike Zhao</dc:creator><description>&lt;p&gt;I run the spi flash sample firmware on nRF9161DK board without problem. I am able to read, write and erase the&amp;nbsp;gd25wb256 NOR flash chip.&lt;/p&gt;
&lt;p&gt;Follow your suggestion, I added the following 3 lines to my app.overlay file and did pristine build to the sample project. Flash the firmware to my customize board. The problem is same.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;has-dpd;&lt;br /&gt; t-enter-dpd = &amp;lt;3000&amp;gt;;&lt;br /&gt; t-exit-dpd = &amp;lt;40000&amp;gt;;&lt;/p&gt;
&lt;p&gt;*** &amp;lt;err&amp;gt; spi_nor: Device id 00 ef aa does not match config ef aa 22&lt;/p&gt;
&lt;p&gt;From this error message, it seems that the code is able to read 3 bytes data from flash chip(W25N02KV), just the first byte is incorrect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any other advice?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: spi_nor: Device id 00 ef aa does not match config ef aa 22</title><link>https://devzone.nordicsemi.com/thread/544889?ContentTypeID=1</link><pubDate>Thu, 07 Aug 2025 08:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29247387-6f24-439d-8eda-d9d54019a531</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]nRF9161DK_nRD9161_ns[/quote]
&lt;p&gt;If you use the board nrf9161dk/nrf9161, ie. the secure image of the board, does it work as expected then?&lt;/p&gt;
&lt;p&gt;If yes, then I suspect there&amp;#39;s a pinconflict between tfm and the non-secure app, which is usually the uart:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_TFM_SECURE_UART=n
CONFIG_TFM_LOG_LEVEL_SILENCE=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]The error is &amp;quot;&lt;span&gt;spi_nor: Device id 00 ef aa does not match config ef aa 22&amp;quot;. Somehow, the manufacturer ID is wrong.&amp;nbsp;&lt;/span&gt;[/quote]
&lt;p&gt;I do not know how this exact flash behaves, as I do not have it, but it might be that it boots up in a standby or sleep state?&lt;/p&gt;
&lt;p&gt;Try adding DPD parameters, like done here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr//blob/main/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_common.dtsi#L211-L213"&gt;https://github.com/zephyrproject-rtos/zephyr//blob/main/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_common.dtsi#L211-L213&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>