<?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>NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119539/nrx-qspi-issues-on-5340</link><description>*EDIT* - Using NCS 2.9 I am using the QSPI peripheral to communicate with a display. 
 1. I initialize the QSPI peripheral. I have tried both blocking and non-blocking. Both return successfully. 
 
 2.) I attempt to read or write to the QSPI peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Apr 2025 17:08:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119539/nrx-qspi-issues-on-5340" /><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/530504?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 17:08:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7635b7c2-5835-4411-94de-ecb3c2b0c078</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;I can&amp;#39;t redesign to use a single SPI, this is a VGA display and needs the throughput of QSPI.&amp;nbsp; The only&amp;nbsp;options now are 1. Two-chip design of MCU + BLE or 2. Move to a different BLE SOC that has a more standard QSPI peripheral.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/530503?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 16:52:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cd573c9-4283-4c0a-8c75-64779d8cb755</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Won&amp;#39;t work, I recommend a redesign or just to use SPIM.&lt;/p&gt;
&lt;p&gt;See PS Chapter 7.25.11.32 (register IFCONFIG0), where you can see that only 256 and 512 byte page sizes are supported by the QSPI peripherial.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/530501?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 16:31:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a88cb30b-70f4-40f6-b81c-d634e4e071b0</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;I am having an issue that I am worried is due to page size limitations. Here is what I see in the datasheet.&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743697773844v2.png" alt=" " /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;I am trying to send 640 bytes using&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;NRF_QSPI_WRITEOC_PP4O&lt;br /&gt;&lt;br /&gt;Here I try to write 640 bytes to address 0x002c00&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t line_buffer[640];

void qspi_write_first_line(uint8_t *data, uint16_t length)
{

	memcpy(line_buffer, data, length);

	if (!nrfx_is_in_ram(line_buffer) || !nrfx_is_word_aligned(line_buffer))
	{
		LOG_ERR(&amp;quot;Error memory alignment/location.&amp;quot;);
		return;
	}

	is_tx_done = false;
	nrfx_err_t ret = nrfx_qspi_write(line_buffer, length, 0x002c00);

	if (ret != NRFX_SUCCESS)
	{
		LOG_ERR(&amp;quot;Error writing to QSPI, err = %s&amp;quot;, nrfx_error_string_get(ret));
	}

	qspi_wait_interrupt();
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;However, I see this broken up into multiple writes and auto-increments the address.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Is this due to the page size limitations?&lt;br /&gt;&lt;br /&gt;Is there a way to bypass the page size limitations or force this transmission?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743697742634v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1743697845518v3.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/528365?ContentTypeID=1</link><pubDate>Fri, 21 Mar 2025 09:55:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e82053a-ef6f-43af-9c7c-452753f1e8c4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I see. Yes, those are part of the QSPI that makes it targeting NOR Flash chips. Not sure it it is possible to disable these, but using the nrfx drivers directly gives you the most amount of direct control, so if it is possible, you are on the right track.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/528281?ContentTypeID=1</link><pubDate>Thu, 20 Mar 2025 18:00:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd2fba28-6a2e-4dc3-826a-3420abb68057</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;I think I made some progress.&lt;br /&gt;&lt;br /&gt;My issue now is disabling the WRITE_ENABLE (0x6) and READ_STATUS(0x5) op codes during writes/reads.&lt;br /&gt;&lt;br /&gt;1. Reads &lt;br /&gt;&lt;br /&gt;The read command is sending the READ_STATUS (0x5) before the read command.&amp;nbsp; I am attempting to change the addressing mode to disable wipwait, but this does not remove the READ_STATUS op code.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	add_config.wipwait = false;
	add_config.mode = NRF_QSPI_ADDRCONF_MODE_OPCODE;
	add_config.wren = false;
	nrf_qspi_addrconfig_set(NRF_QSPI, &amp;amp;add_config);

	uint8_t read_data[16] = {0};
	ret = nrfx_qspi_read(read_data, 16, LCD_SET_REG_ADDRESS(0x81));

	if (ret != NRFX_SUCCESS)
	{
		LOG_ERR(&amp;quot;Error reading from QSPI %s&amp;quot;, nrfx_error_string_get(ret));
	}

	LOG_HEXDUMP_INF(read_data, 16, &amp;quot;Read data&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1742493425444v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. Writes. Here is an attempt at a PP40 write. This has both ready and write enable commands before the 0x32 PP40 write.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
void qspi_write_first_line(uint8_t *data, uint16_t length)
{
	nrf_qspi_addrconfig_conf_t add_config = {0};

	add_config.wipwait = false;
	add_config.mode = NRF_QSPI_ADDRCONF_MODE_OPCODE;
	add_config.wren = false;
	nrf_qspi_addrconfig_set(NRF_QSPI, &amp;amp;add_config);

	uint8_t *ptr = malloc(length);

	if (ptr == NULL)
	{
		LOG_ERR(&amp;quot;Error allocating memory&amp;quot;);
		return;
	}

	memcpy(ptr, data, length);

	if (!nrfx_is_in_ram(ptr) || !nrfx_is_word_aligned(ptr))
	{
		LOG_ERR(&amp;quot;Error memory alignment/location.&amp;quot;);
		return;
	}

	nrfx_err_t ret = nrfx_qspi_write(ptr, length, 0x002c00);

	if (ret != NRFX_SUCCESS)
	{
		LOG_ERR(&amp;quot;Error writing to QSPI, err = %s&amp;quot;, nrfx_error_string_get(ret));
	}

	if (ptr)
	{
		free(ptr);
	}
}
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1742493558323v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/527957?ContentTypeID=1</link><pubDate>Wed, 19 Mar 2025 08:35:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9be6a77e-e613-4cb6-b6dd-545feb22745d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;In general, compare - using a logic analyzer - the QSPI pins when using it for NOR flash (on the DK), and in your application. Does the NOR flash do something that is not being done by the display?&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/527956?ContentTypeID=1</link><pubDate>Wed, 19 Mar 2025 08:34:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf42eb80-10e2-4143-9832-0afae0a73ad5</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;According to the &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/qspi.html#ariaid-title11"&gt;instruction set&lt;/a&gt;, it is &amp;quot;Quad-Page program out.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you trying to use this? Can you see whether the application reaches this command? (using a logic analyzer)&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/527895?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 16:18:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:089d674a-186b-4b93-a34a-53c192019a48</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;Evin,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I am aware the limitations of the QSPI peripheral.&amp;nbsp; Our display manufacturer copied the SPI flash op codes to make this display work with the Nordic QSPI peripheral.&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;i have read the page you linked to.&amp;nbsp; I do not see any suggestions that any of those commands are waiting on specific responses from the SPI flash chip.&amp;nbsp; Am I missing something?&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;For instance a &amp;quot;&lt;span&gt;PP4O&amp;quot; command should just write data, correct? I do not see anything in the timing diagram mentioning that the peripheral is waiting on a SPI flash response(?).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRX QSPI Issues on 5340</title><link>https://devzone.nordicsemi.com/thread/526695?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 08:55:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e504c5b9-4a3b-45e9-b4f1-909aab9f9a82</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply.&lt;/p&gt;
&lt;p&gt;The QSPI HW on the nRF5340 is targeted for NOR flash. This means that there are some parts of the QSPI peripheral that is optimized for this, meaning it will increment some fields automatically.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In short, you can only use the QSPI for external flash, and not for QSPI displays, unfortunately.&lt;/p&gt;
&lt;p&gt;I guess the reason you are seeing the timeout is that it is waiting for a reply from the external flash, that doesn&amp;#39;t come. It is a very limited instruction set that can be used. You can read about it in the QSPI documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/qspi.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/qspi.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>