<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LPC55S06 SPI flash interface in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1344175#M46526</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I don't think we have SPI nor flash demo code.&lt;/P&gt;
&lt;P&gt;I suggest you refer SPI demo code under LPC55S06 SDK folder to develop your SPI flash driver.&lt;/P&gt;
&lt;P&gt;Have a nice day.&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 15:29:47 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2021-09-22T15:29:47Z</dc:date>
    <item>
      <title>LPC55S06 SPI flash interface</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1343035#M46498</link>
      <description>&lt;P&gt;Is there an SPI flash interface for the LPC55S06?&amp;nbsp; I want to use an SPI NOR flash chip to log data.&amp;nbsp; I won't need to boot from it as the internal flash will be large enough.&lt;/P&gt;&lt;P&gt;I can't seem to find any examples on interfacing to external flash parts.&amp;nbsp; Figured I'd see if there was one before I have to write one.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 05:25:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1343035#M46498</guid>
      <dc:creator>christianlees</dc:creator>
      <dc:date>2021-09-21T05:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S06 SPI flash interface</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1344175#M46526</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I don't think we have SPI nor flash demo code.&lt;/P&gt;
&lt;P&gt;I suggest you refer SPI demo code under LPC55S06 SDK folder to develop your SPI flash driver.&lt;/P&gt;
&lt;P&gt;Have a nice day.&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 15:29:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1344175#M46526</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-09-22T15:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S06 SPI flash interface</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1344465#M46530</link>
      <description>&lt;P&gt;I figured as much when I couldn't find one.&amp;nbsp; For the benefit of others trying to do the same thing I found that this one works&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/pellepl/spiflash_driver" target="_blank"&gt;https://github.com/pellepl/spiflash_driver&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You'll need to control the CS pin as GPIO not through the SDK SPI code as it does not seem to toggle it so the flash chip doesn't behave.&amp;nbsp; My HAL code is as follows&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;int lpc_spiflash_spi_txrx(spiflash_t *spi, const uint8_t *tx_data,
	      uint32_t tx_len, uint8_t *rx_data, uint32_t rx_len)
{

	 spi_transfer_t xfer;
	 if(tx_len &amp;gt; 0)
	 {
		 xfer.txData = (uint8_t *)tx_data;
		 xfer.rxData = NULL;
		 xfer.dataSize = tx_len;
		 SPI_MasterTransferBlocking(SPI3, &amp;amp;xfer);
	 }

	 if(rx_len &amp;gt; 0)
	 {
		 xfer.txData = NULL;
		 xfer.rxData = rx_data;
		 xfer.dataSize = rx_len;
		 SPI_MasterTransferBlocking(SPI3, &amp;amp;xfer);
	 }

	 return SPIFLASH_OK;
}

void lpc_spiflash_spi_cs(spiflash_t *spi, uint8_t cs)
{
	GPIO_PinWrite(BOARD_INITPINS_FLASH_CS_GPIO, BOARD_INITPINS_FLASH_CS_PORT, BOARD_INITPINS_FLASH_CS_PIN, !cs);
}

void lpc_spiflash_wait(spiflash_t *spi, uint32_t ms)
{
	delay_ms(ms);
}

static const spiflash_hal_t my_spiflash_hal = {
  ._spiflash_spi_txrx = lpc_spiflash_spi_txrx,
  ._spiflash_spi_cs = lpc_spiflash_spi_cs,
  ._spiflash_wait = lpc_spiflash_wait
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 23:02:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1344465#M46530</guid>
      <dc:creator>christianlees</dc:creator>
      <dc:date>2021-09-22T23:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S06 SPI flash interface</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1344536#M46532</link>
      <description>&lt;P&gt;Yes，a spare IO is needed to enable SPI flash before using it.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 02:26:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S06-SPI-flash-interface/m-p/1344536#M46532</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2021-09-23T02:26:10Z</dc:date>
    </item>
  </channel>
</rss>

