<?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>ncs 2.7.0 SPI nor flash build error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116867/ncs-2-7-0-spi-nor-flash-build-error</link><description>I got below build error:, actually I referred C:\ncs\v2.7.0\zephyr\samples\drivers\jesd216; my externl SPI NOR flash is p25q32h and my target is to build a file system such as fatfs on the flash. I also checked the sample under C:\ncs\v2.7.0\zephyr\samples</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Dec 2024 12:36:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116867/ncs-2-7-0-spi-nor-flash-build-error" /><item><title>RE: ncs 2.7.0 SPI nor flash build error</title><link>https://devzone.nordicsemi.com/thread/515727?ContentTypeID=1</link><pubDate>Thu, 19 Dec 2024 12:36:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8965a0a2-46dc-4d93-9b4c-96391ab082b3</guid><dc:creator>hugh512</dc:creator><description>&lt;p&gt;Change NCS SDK to 2.6.2 fix this issue.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;spi0 {
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;spi0_default&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;;
	cs-gpios = &amp;lt;&amp;amp;gpio0 16 GPIO_ACTIVE_LOW&amp;gt;;
	p25q32h: p25q32h@0 {
		compatible = &amp;quot;jedec,spi-nor&amp;quot;;
		reg = &amp;lt;0&amp;gt;;
		spi-max-frequency = &amp;lt;8000000&amp;gt;;
		label = &amp;quot;p25q32h&amp;quot;;
		size = &amp;lt;0x2000000&amp;gt;;  // 32MB
		jedec-id = [85 60 16];
		status = &amp;quot;okay&amp;quot;;

		partitions {
            compatible = &amp;quot;fixed-partitions&amp;quot;;
            #address-cells = &amp;lt;1&amp;gt;;
            #size-cells = &amp;lt;1&amp;gt;;

            spi_storage_partition: partition@0 {
                label = &amp;quot;spi_storage&amp;quot;;
                reg = &amp;lt;0x00000000 0x00400000&amp;gt;;
            };
        };
	};
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ncs 2.7.0 SPI nor flash build error</title><link>https://devzone.nordicsemi.com/thread/513858?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2024 14:30:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe435953-cabd-4508-acd4-80d995fbcec5</guid><dc:creator>helsing</dc:creator><description>[quote user="hugh512"]I got the same exception.[/quote]
&lt;p&gt;If you are building for one of the Nordic boards then it would be better to use some other names than the ones that are already there. Try using for example &amp;#39;custom_spi_default&amp;#39; instead of &amp;#39;spi_default&amp;#39;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ncs 2.7.0 SPI nor flash build error</title><link>https://devzone.nordicsemi.com/thread/513324?ContentTypeID=1</link><pubDate>Wed, 04 Dec 2024 02:47:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f95d15e-ecf9-4f25-816a-7d8b399cb919</guid><dc:creator>hugh512</dc:creator><description>&lt;p&gt;Hi helsing: I got the same exception.&lt;pre class="ui-code" data-mode="bat"&gt;c:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj):(.rodata.spi_nor_0_config+0x0): undefined reference to `__device_dts_ord_84&amp;#39;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Below is the dts config&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	i2c0_default: i2c0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SCL, 0, 10)&amp;gt;, &amp;lt;NRF_PSEL(TWIM_SDA, 0, 9)&amp;gt;;
			bias-pull-up;
		};
	};

	spi1_default: spi1_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(SPIM_MISO, 0, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(SPIM_MOSI, 0, 15)&amp;gt;,
					&amp;lt;NRF_PSEL(SPIM_SCK, 0, 17)&amp;gt;;
		};
	};
	spi1_sleep: spi1_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(SPIM_MISO, 0, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(SPIM_MOSI, 0, 15)&amp;gt;,
					&amp;lt;NRF_PSEL(SPIM_SCK, 0, 17)&amp;gt;;
			low-power-enable;
		};
	};
};


&amp;amp;spi1 {
	status = &amp;quot;okay&amp;quot;;
	pinctrl-0 = &amp;lt;&amp;amp;spi1_default&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;spi1_sleep&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	p25q32h: p25q32h@0 {
        compatible = &amp;quot;jedec,spi-nor&amp;quot;;
        reg = &amp;lt;0&amp;gt;;  // SPI Flash 从设备地址
        spi-max-frequency = &amp;lt;8000000&amp;gt;;  // SPI 最大频率
        label = &amp;quot;p25q32h&amp;quot;;
        size = &amp;lt;0x2000000&amp;gt;;  // 32MB
		jedec-id = [85 60 16];
    };
	cs-gpios = &amp;lt;&amp;amp;gpio0 16 0&amp;gt;;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
        int err;
        const struct device *flash_dev = DEVICE_DT_GET(DT_NODELABEL(p25q32h));
        return 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ncs 2.7.0 SPI nor flash build error</title><link>https://devzone.nordicsemi.com/thread/513256?ContentTypeID=1</link><pubDate>Tue, 03 Dec 2024 15:06:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35ccee3a-cdf4-4108-92d4-b27f0fd90c1f</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Thank you for giving it a try. I think we need to look for something else.&lt;/p&gt;
&lt;p&gt;Which board are you building for? building for nrf52dk you will need to set both pinctrl names:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Check &lt;code&gt;zephyr\boards\nordic\nrf52dk\nrf52dk_nrf52832-pinctrl.dtsi&lt;/code&gt; for an example showing how to set both default and sleep.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ncs 2.7.0 SPI nor flash build error</title><link>https://devzone.nordicsemi.com/thread/513033?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2024 15:44:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6f5734c-8ff4-432e-85c0-85e5b7991a39</guid><dc:creator>hugh512</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t work, I put the code in main() function.according to the error, it has relation with libdrivers__flash &amp;amp; spi_nor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ncs 2.7.0 SPI nor flash build error</title><link>https://devzone.nordicsemi.com/thread/513007?ContentTypeID=1</link><pubDate>Mon, 02 Dec 2024 14:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f80399ca-3e57-4924-8b3b-90f49fb7dc2e</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Hugh,&lt;/p&gt;
&lt;p&gt;Just letting you know I have started looking into this. My first guess is that something like below is missing from the main.c::main() function:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;const struct device *flash_dev = DEVICE_DT_GET(DT_NODELABEL(&lt;span&gt;p25q32h&lt;/span&gt;));&amp;nbsp;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Please let me know if the above does not work, and I will look deeper into this tomorrow. Check out this in the meantime:&amp;nbsp; &lt;a title="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/dts/troubleshooting.html#undefined_reference_to_devicedtsordn" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/build/dts/troubleshooting.html#undefined_reference_to_devicedtsordn"&gt;Troubleshooting undefined reference to __device_dts_ord_&amp;lt;N&amp;gt;&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>