<?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>Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100978/zephyr-spi-reading-jedec-id-of-winbond-nor-flash-failed</link><description>I use spi_write() and spi_read() API to read JEDEC ID of Winbond NOR flash. But results of spi_read() are always 0. Do you have any suggestions to debug this issue?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Jun 2023 03:30:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100978/zephyr-spi-reading-jedec-id-of-winbond-nor-flash-failed" /><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/433346?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2023 03:30:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4e4c759-1e83-456a-a90a-7a94879ccede</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply! I have replaced calling &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/drivers/flash/spi_nor.c#LL854C1-L854C1"&gt;spi_nor_read_jedec_id&lt;/a&gt;() with flash_read_jedec_id(). It is okay to read JEDEC ID with flash_read_jedec_id().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/433140?ContentTypeID=1</link><pubDate>Tue, 27 Jun 2023 08:55:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d32c07fe-985f-4207-9136-469775d1abba</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t reproduce this if you&amp;#39;re running it on a custom board I&amp;#39;m afraid, As I don&amp;#39;t have these external flashes available on my end. Did you try changing the dpd and rdpd values in your flash device to higher values?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You need to upload the full build log for us to see what the root cause of this build failure is.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/432668?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2023 11:28:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7ec03af-e17b-44b1-9619-69b9ce44fb0c</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;span&gt;Is there a reason you have defined two external flash devices?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ans: I need to support two flash devices&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The error seems to be trigged by the&amp;nbsp;&lt;strong&gt;flashNorInit&lt;/strong&gt;&amp;nbsp;function in&amp;nbsp;&lt;strong&gt;flash_nor.c&lt;/strong&gt;. Is this a function you&amp;#39;ve added yourself, as it&amp;#39;s not found in the default nRF Connect SDK v2.3.0?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ans: I write flashNorInit() function by myself.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What exactly do you want me to do with the compressed files you&amp;#39;ve uploaded?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ans: You can reproduce this issue with the following procedures.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. Unzip&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/custom_5F00_nrf52832.rar"&gt;custom_nrf52832.rar&lt;/a&gt;&amp;nbsp;to boards/arm folder.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Unzip&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2313.minimal_5F00_log_5F00_spi.zip"&gt;minimal_log_spi.zip&lt;/a&gt;&amp;nbsp;to samples folder&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3.&amp;nbsp;cd minimal_log_spi&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. west build -b&amp;nbsp;custom_nrf52832&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/432547?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2023 13:38:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64705645-0f9c-4591-b55e-9558350926fb</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Is there a reason you have defined two external flash devices? It looks mostly okay, but the t-dpd values (the time required to complete the dpd and rdpd commands) look very short, as this value is stated in nanoseconds. By default these are set to 10000 (enter) and 35000 (exit).&lt;/p&gt;
&lt;p&gt;Regarding the build error, you need to provide some more context here. The error seems to be trigged by the &lt;strong&gt;flashNorInit&lt;/strong&gt; function in &lt;strong&gt;flash_nor.c&lt;/strong&gt;. Is this a function you&amp;#39;ve added yourself, as it&amp;#39;s not found in the default nRF Connect SDK v2.3.0? What exactly do you want me to do with the compressed files you&amp;#39;ve uploaded?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/432209?ContentTypeID=1</link><pubDate>Wed, 21 Jun 2023 08:05:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e201af3-b7ba-4fe3-9858-e442505da5cd</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/custom_5F00_nrf52832.rar"&gt;devzone.nordicsemi.com/.../custom_5F00_nrf52832.rar&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/432208?ContentTypeID=1</link><pubDate>Wed, 21 Jun 2023 08:05:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:425347e8-f813-4368-8b61-b51ed732055f</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2313.minimal_5F00_log_5F00_spi.zip"&gt;devzone.nordicsemi.com/.../2313.minimal_5F00_log_5F00_spi.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/432205?ContentTypeID=1</link><pubDate>Wed, 21 Jun 2023 08:03:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a98804d7-642a-47c9-9301-08d82e28f3c9</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;minimal_log_spi&amp;gt;west build -b custom_nrf52832&lt;br /&gt;-- west build: generating a build system&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map&lt;br /&gt;cmd.exe /C &amp;quot;cd . &amp;amp;&amp;amp; D:\ncs\toolchains\v2.3.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf &amp;amp;&amp;amp; cmd.exe /C &amp;quot;cd /D D:\ncs\v2.3.0\nrf\samples\minimal_log_spi\build\zephyr &amp;amp;&amp;amp; D:\ncs\toolchains\v2.3.0\opt\bin\cmake.exe -E echo &amp;quot;&amp;quot;&lt;br /&gt;d:/ncs/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(flash_nor.c.obj): in function `flashNorInit&amp;#39;:&lt;br /&gt;D:\ncs\v2.3.0\nrf\samples\minimal_log_spi\build/../src/flash_nor.c:45: undefined reference to `spi_nor_read_jedec_id&amp;#39;&lt;br /&gt;collect2.exe: error: ld returned 1 exit status&lt;br /&gt;ninja: build stopped: subcommand failed.&lt;br /&gt;FATAL ERROR: command exited with status 1: &amp;#39;D:\ncs\toolchains\v2.3.0\opt\bin\cmake.EXE&amp;#39; --build &amp;#39;D:\ncs\v2.3.0\nrf\samples\minimal_log_spi\build&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/432203?ContentTypeID=1</link><pubDate>Wed, 21 Jun 2023 08:01:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:221673cb-fb92-4003-bbc2-7aac3786d83c</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;&amp;amp;spi1 {&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;/p&gt;
&lt;p&gt;cs-gpios = &amp;lt;&amp;amp;gpio0 13 GPIO_ACTIVE_LOW&amp;gt;;&lt;br /&gt; pinctrl-0 = &amp;lt;&amp;amp;spi1_default&amp;gt;;&lt;br /&gt; pinctrl-1 = &amp;lt;&amp;amp;spi1_sleep&amp;gt;;&lt;br /&gt; pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;&lt;/p&gt;
&lt;p&gt;w25q32: w25q32jv@0 {&lt;br /&gt; compatible = &amp;quot;jedec,spi-nor&amp;quot;;&lt;br /&gt; reg = &amp;lt;0&amp;gt;;&lt;br /&gt; spi-max-frequency = &amp;lt;8000000&amp;gt;;&lt;br /&gt; jedec-id = [ef 40 16];&lt;br /&gt; size = &amp;lt;0x400000&amp;gt;;&lt;br /&gt; has-dpd;&lt;br /&gt; t-enter-dpd = &amp;lt;3500&amp;gt;;&lt;br /&gt; t-exit-dpd = &amp;lt;3500&amp;gt;;&lt;br /&gt; };&lt;br /&gt; &lt;br /&gt; w25q256: w25q256jv@0 {&lt;br /&gt; compatible = &amp;quot;jedec,spi-nor&amp;quot;;&lt;br /&gt; reg = &amp;lt;0&amp;gt;;&lt;br /&gt; spi-max-frequency = &amp;lt;8000000&amp;gt;;&lt;br /&gt; jedec-id = [ef 40 19];&lt;br /&gt; size = &amp;lt;0x2000000&amp;gt;;&lt;br /&gt; has-dpd;&lt;br /&gt; t-enter-dpd = &amp;lt;3500&amp;gt;;&lt;br /&gt; t-exit-dpd = &amp;lt;3500&amp;gt;;&lt;br /&gt; };&lt;br /&gt;};&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/431937?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 10:20:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf0cc3d1-a7cb-47e5-b388-368f4ecddcc2</guid><dc:creator>snowuyl</dc:creator><description>&lt;p&gt;Thanks for your reply!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr spi reading JEDEC ID of Winbond NOR flash failed</title><link>https://devzone.nordicsemi.com/thread/431868?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 05:51:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f81cb211-b9f5-4236-87e3-541a6f565756</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you set up your SPI to match the specs of the Winbond flash you&amp;#39;re using in your project&amp;#39;s overlay file? See the snippet below which is set up for the MX25R serial flash that&amp;#39;s on the nRF52840 DK by default.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi2 {
	compatible = &amp;quot;nordic,nrf-spi&amp;quot;;
	status = &amp;quot;okay&amp;quot;;
	cs-gpios = &amp;lt;&amp;amp;gpio0 17 GPIO_ACTIVE_LOW&amp;gt;;
	pinctrl-0 = &amp;lt;&amp;amp;spi2_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;spi2_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	mx25r64: mx25r6435f@0  {
		compatible = &amp;quot;jedec,spi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		spi-max-frequency = &amp;lt;8000000&amp;gt;;
		jedec-id = [c2 28 17];
		size = &amp;lt;67108864&amp;gt;;
		wp-gpios = &amp;lt;&amp;amp;gpio0 22 GPIO_ACTIVE_LOW&amp;gt;;
		hold-gpios = &amp;lt;&amp;amp;gpio0 23 GPIO_ACTIVE_LOW&amp;gt;;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, what SPI instance, and what pins are you using for SPI on your board? You can try using &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/drivers/flash/spi_nor.c#LL854C1-L854C1"&gt;spi_nor_read_jedec_id &lt;/a&gt;from the spi_nor.c driver to see what that function returns.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>