<?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>Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><description>When you develop firmware for a Raspberry Pico, there are cases where you want to store user data in Flash. Data that needs to survive a power-down. E.g: calibration data, user preferences, display Celsius/Fahrenheit &amp;hellip;&amp;amp;...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><pubDate>Tue, 12 Sep 2023 19:58:04 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4585b14f-795f-4d03-bf39-8b977b7b96da</guid><dc:creator>ggabe</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I wonder how much is the reasonable wear-preventing write frequency. I&amp;rsquo;m about to either add an FRAM, or use the internal flash, for an every 3 second update. (It is to store auto zero values, so that the instrument can wake up immediately, instead of running through a 1 minute warmup cycle)&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=26776&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><pubDate>Fri, 01 Sep 2023 07:40:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4585b14f-795f-4d03-bf39-8b977b7b96da</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;the size of the block can be defined as a constant:&lt;/p&gt;
&lt;p&gt;&lt;img height="100" src="/resized-image/__size/1000x200/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-4585b14f-795f-4d03-bf39-8b977b7b96da/pastedimage1693553911791v1.png" width="500" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;(the syntax highlighting in the script is done by&amp;nbsp; a VSCode extension: &lt;a href="https://marketplace.visualstudio.com/items?itemName=ZixuanWang.linkerscript" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="y"&gt;LinkerScript&lt;/a&gt;)&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=26776&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><pubDate>Thu, 31 Aug 2023 19:26:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4585b14f-795f-4d03-bf39-8b977b7b96da</guid><dc:creator>DAB</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Great idea Jan.&lt;/p&gt;
&lt;p&gt;I hope to get my Pico set up with Labview this weekend.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=26776&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><pubDate>Thu, 31 Aug 2023 17:04:42 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4585b14f-795f-4d03-bf39-8b977b7b96da</guid><dc:creator>dougw</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Great blog. The idea should be useful for lots of modern MCUs, especially devices that have large FLASH onboard.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=26776&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><pubDate>Thu, 31 Aug 2023 12:10:52 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4585b14f-795f-4d03-bf39-8b977b7b96da</guid><dc:creator>scottiebabe</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;Excellent work Jan.&lt;/p&gt;
&lt;p&gt;Flash isn&amp;#39;t directly CPU writeable, so perhaps you don&amp;#39;t need the &amp;#39;w&amp;#39; flag in you linker script. There may be a way to ensure gcc never uses that flash space so when you update your application code you don&amp;#39;t ever over write your calibration flash page. You would initialize the calibration constants in your initialization code if the cal page isn&amp;#39;t valid. Because flash isn&amp;#39;t byte erasable, you could reserve 2 flash pages. Then you erase one page and scratch away until a full update a write has completed at which point you mark the page as valid or complete. So, if the application code crashes or power goes out during a cal parameter write you still have the last cal page.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=26776&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><pubDate>Thu, 31 Aug 2023 09:56:02 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4585b14f-795f-4d03-bf39-8b977b7b96da</guid><dc:creator>Fred27</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;A really useful write-up. Thanks.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=26776&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Raspberry Pico C SDK: reserve a Flash memory block for persistent storage</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspberry-pico-c-sdk-reserve-a-flash-memory-block-for-persistent-storage</link><pubDate>Wed, 30 Aug 2023 21:42:06 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4585b14f-795f-4d03-bf39-8b977b7b96da</guid><dc:creator>BigG</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I haven&amp;#39;t explored the Pico C SDK in detail, but I believe it should be possible, which is to get the Pico to emulate a USB flash memory stick. This allows you to copy a file into that flash memory location when you connect the USB cable to a computer and then use this file as part of your application.&lt;/p&gt;
&lt;p&gt;I believe there are some Pico C USB examples available, which could be extended for this purpose - maybe this is your next challenge.&lt;/p&gt;
&lt;p&gt;I took the other route which is to use the Arduino MbedOS core for the Pico to do similar, as shown here: &amp;nbsp;[mention:a65f23551c6b4908b210adcc7eec2df1:f7d226abd59f475c9d224a79e3f0ec07]&lt;/p&gt;
&lt;p&gt;Personally, I really like this functionality but I think it needs more work to make it more robust.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=26776&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>