<?xml-stylesheet type="text/xsl" href="https://community.element14.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/"><channel><title>Adding Low-Cost Flash Memory Storage to Microcontrollers</title><link>/products/raspberry-pi/raspberrypi_projects/b/blog/posts/adding-low-cost-flash-memory-storage-to-microcontrollers</link><description>Table of Contents

 Introduction 
 Connecting Flash Memory to Microcontrollers 
 Reading/Writing to Flash Memory 
 Using a File System 
 Trying out the Code 
 Summary 


Introduction
There is often a need to store data in some form of non-volatile memory</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Adding Low-Cost Flash Memory Storage to Microcontrollers</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/adding-low-cost-flash-memory-storage-to-microcontrollers</link><pubDate>Tue, 14 Feb 2023 19:59:03 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b2de853d-7750-4990-87d6-547e05b25500</guid><dc:creator>DAB</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Nice build.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25212&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Adding Low-Cost Flash Memory Storage to Microcontrollers</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/adding-low-cost-flash-memory-storage-to-microcontrollers</link><pubDate>Sun, 12 Feb 2023 21:09:10 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b2de853d-7750-4990-87d6-547e05b25500</guid><dc:creator>genebren</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice write-up!&amp;nbsp; I will have to bookmark this one and come back to as a reference.&amp;nbsp; Thanks for sharing!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25212&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Adding Low-Cost Flash Memory Storage to Microcontrollers</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/adding-low-cost-flash-memory-storage-to-microcontrollers</link><pubDate>Sun, 12 Feb 2023 11:15:07 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b2de853d-7750-4990-87d6-547e05b25500</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;Changed the SPI pins:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;// SPI&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;SPI_FLASH_MOSI_PIN&lt;/span&gt;&lt;span&gt; &amp;nbsp;&lt;/span&gt;&lt;span&gt;11&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;SPI_FLASH_MISO_PIN&lt;/span&gt;&lt;span&gt; &amp;nbsp;&lt;/span&gt;&lt;span&gt;12&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;SPI_FLASH_SCK_PIN&lt;/span&gt;&lt;span&gt; &amp;nbsp; &lt;/span&gt;&lt;span&gt;10&lt;/span&gt;&lt;br /&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;SPI_FLASH_CS_PIN&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;9&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Set the output to USB, because I&amp;#39;m using PicoProbe:&lt;/p&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;pico_enable_stdio_usb(flashtester 0)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;pico_enable_stdio_uart(flashtester 1)&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;It built without problems:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="305" src="/resized-image/__size/1280x610/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-b2de853d-7750-4990-87d6-547e05b25500/pastedimage1676199870235v2.png" width="640" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I ran it in debug mode,&amp;nbsp;Flash init part and reading the register works. Still need to read further info.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="421" src="/resized-image/__size/1280x842/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-b2de853d-7750-4990-87d6-547e05b25500/pastedimage1676200171304v3.png" width="640" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using&amp;nbsp;ST Micro M25P16-VMN6P NOR Flash 16MBit, and have not verified if it&amp;#39;s compatible, or if I need to do something with the hold and protect pins. Just ran the example.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25212&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Adding Low-Cost Flash Memory Storage to Microcontrollers</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/adding-low-cost-flash-memory-storage-to-microcontrollers</link><pubDate>Sun, 12 Feb 2023 10:55:14 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b2de853d-7750-4990-87d6-547e05b25500</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;m going to test this&lt;br /&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-b2de853d-7750-4990-87d6-547e05b25500/pastedimage1676199318106v1.png" alt=" " /&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25212&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Adding Low-Cost Flash Memory Storage to Microcontrollers</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/adding-low-cost-flash-memory-storage-to-microcontrollers</link><pubDate>Sun, 12 Feb 2023 09:57:21 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b2de853d-7750-4990-87d6-547e05b25500</guid><dc:creator>michaelkellett</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Good stuff, thanks.&lt;/p&gt;
&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=25212&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>