<?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>unknow data when use qspi panel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120406/unknow-data-when-use-qspi-panel</link><description>Hi all, 
 I applied QSPI driver on NCS 2.4.0 with QSPI LCD panel and I encountered the problem. 
 
 The red area is the data I sent, but the blue area is not what I sent. 
 
 
 I already try many way to send with qspi, like nrfx_qspi_write() or directly</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 May 2025 17:14:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120406/unknow-data-when-use-qspi-panel" /><item><title>RE: unknow data when use qspi panel</title><link>https://devzone.nordicsemi.com/thread/535400?ContentTypeID=1</link><pubDate>Wed, 14 May 2025 17:14:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c49c2b36-9e54-4221-9d7c-bfa1e0d26606</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello wayne,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The QSPI is created mainly to work with flash devices, and it follows a certain instruction set. If the LCD does not implement the same instruction set,&amp;nbsp;you need to use regular (high-speed) SPI.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You&amp;nbsp;need to check the datasheet of the LCD to see what it supports. If it does not support the same instruction set (I think this is JEDEC), SPIM would be a better option. There is some support for &lt;a title="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/qspi.html#ariaid-title7" href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/qspi.html#ariaid-title7" rel="noopener noreferrer" target="_blank"&gt;custom instructions&lt;/a&gt;, but this would likely be slower than using high-speed SPIM in HW.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unknow data when use qspi panel</title><link>https://devzone.nordicsemi.com/thread/533488?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2025 04:14:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:056d0aa7-1f7e-4c86-a139-105bf276c878</guid><dc:creator>Wayne_Chang</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi&amp;nbsp;&lt;/span&gt;&lt;span&gt;Kazi,&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="" data-start="64" data-end="298"&gt;I have previously used SPI to drive an LCD. I only began testing QSPI in order to increase the framerate. If the QSPI on the nRF52840 does not support functionalities beyond flash memory, I am considering switching to a different MCU.&lt;/p&gt;
&lt;p class="" data-start="300" data-end="426"&gt;However, I need a clear and definitive answer:&lt;br data-start="346" data-end="349" /&gt; &lt;strong data-start="349" data-end="426"&gt;Is it possible to use the QSPI interface on the nRF52840 to drive an LCD?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;BR,&lt;br /&gt;Wayne&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unknow data when use qspi panel</title><link>https://devzone.nordicsemi.com/thread/533433?ContentTypeID=1</link><pubDate>Tue, 29 Apr 2025 14:02:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be34c89a-8f20-432e-8d8e-02d598d81cf0</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Wayne,&lt;/p&gt;
&lt;p&gt;You may try to use SPI for your LCD panel instead of QSPI?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unknow data when use qspi panel</title><link>https://devzone.nordicsemi.com/thread/531474?ContentTypeID=1</link><pubDate>Fri, 11 Apr 2025 07:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1d68b70-0046-4a43-93e4-f967155b6b9b</guid><dc:creator>Wayne_Chang</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Kazi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i only used nrf52840-dk to make sure that there is no other&amp;nbsp;&lt;/span&gt;factors interfere.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;this is my device tree about qspi&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;qspi {
    status = &amp;quot;okay&amp;quot;;
    pinctrl-0 = &amp;lt;&amp;amp;qspi_default&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;qspi_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};

&amp;amp;qspi_default {
        group1 {
                psels = &amp;lt;NRF_PSEL(QSPI_SCK, 0, 16)&amp;gt;,
                        &amp;lt;NRF_PSEL(QSPI_IO0, 0, 25)&amp;gt;, // SDA
                        &amp;lt;NRF_PSEL(QSPI_IO1, 0, 13)&amp;gt;,
                        &amp;lt;NRF_PSEL(QSPI_IO2, 0, 15)&amp;gt;,
                        &amp;lt;NRF_PSEL(QSPI_IO3, 0, 24)&amp;gt;,
                        &amp;lt;NRF_PSEL(QSPI_CSN, 1, 4)&amp;gt;;
        };
};

&amp;amp;qspi_sleep {
        group1 {
                psels = &amp;lt;NRF_PSEL(QSPI_SCK, 0, 16)&amp;gt;,
                        &amp;lt;NRF_PSEL(QSPI_IO0, 0, 25)&amp;gt;, // SDA
                        &amp;lt;NRF_PSEL(QSPI_IO1, 0, 13)&amp;gt;,
                        &amp;lt;NRF_PSEL(QSPI_IO2, 0, 15)&amp;gt;,
                        &amp;lt;NRF_PSEL(QSPI_IO3, 0, 24)&amp;gt;;
                low-power-enable;
        };
        group2 {
                psels = &amp;lt;NRF_PSEL(QSPI_CSN, 1, 4)&amp;gt;;
                low-power-enable;
                bias-pull-up;
        };
};&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and this is what function i tried&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void qspi_write(const uint8_t *data, size_t len)
{
	int err = nrfx_qspi_write(data, len, 0);
	if (err != NRFX_SUCCESS)
	{
		// printk(&amp;quot;QSPI write failed: %d\n&amp;quot;, err);
		return;
	}
	// printk(&amp;quot;QSPI wrote %d bytes\n&amp;quot;, len);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void qspi_raw_send(const uint8_t *data, size_t len)
{

    NRF_QSPI-&amp;gt;WRITE.DST = 0; 
    NRF_QSPI-&amp;gt;WRITE.SRC = (uint32_t)data;
    NRF_QSPI-&amp;gt;WRITE.CNT = len;

    NRF_QSPI-&amp;gt;EVENTS_READY = 0;

    NRF_QSPI-&amp;gt;TASKS_WRITESTART = 1;

    while (!NRF_QSPI-&amp;gt;EVENTS_READY) {}
    NRF_QSPI-&amp;gt;EVENTS_READY = 0;

	// printf(&amp;quot;Sent %d bytes\n&amp;quot;, len);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also tried&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;mx25r64 {
status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;but it also get the same result&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Wayne&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: unknow data when use qspi panel</title><link>https://devzone.nordicsemi.com/thread/530442?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 11:58:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb604ed1-1264-4876-ac09-a893495d8747</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Wayne,&lt;/p&gt;
&lt;p&gt;How have you set the QSPI in the application? Can I see the board file ( dts, pincontrol, overlay) of your application? Any external flash chip is set under QSPI node? If it is then you need to disbale the default flash chip and properly configure the new on in device tree overlay file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;mx25r64 {
    status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have HFXO on your board?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, there is a known errata&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/errata_nRF52840_EngD/page/ERR/nRF52840/EngineeringD/latest/anomaly_840_244.html"&gt;[244] QSPI: External flash and QSPI returns erroneous data when the SoftDevice is running&lt;/a&gt;&amp;nbsp;about this erroneous data while using QSPU for nRF5SDK.&lt;/p&gt;
&lt;p&gt;The workaround says &amp;#39;&amp;#39;&lt;strong&gt;&lt;span&gt;Ensure that the clock source is not switched during the QSPI operations. For example, force the HFXO enabled when SoftDevice is used by calling sd_clock_hfclk_request() after sd_softdevice_enable() during QSPI operations&amp;#39;&amp;#39;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I think same workaround can be applicable using MPSL clock module for NCS.&amp;nbsp;The MPSL clock module API enables the application to safely request and release the HFXO while the protocol stacks are enabled. MPSL can continue to use the HFXO after it is released if it is requested by protocol stacks. HFXO is stopped when it is no longer needed.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;mpsl_clock_hfclk_request();
// Perform QSPI operations
mpsl_clock_hfclk_release();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;for direct register access can use following code before starting the QSPI operation&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);
NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;

// Perform QSPI operations&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can try all these probable solutions and also can send me the board file, so, in the meantime I can check if something wrong with the configuration of QSPI node.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;Kazi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>