<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to lock m5stack software (firmware encryption)]]></title><description><![CDATA[<p dir="auto">I want to activate the esp32 "firmware encryption" feature to:</p>
<ul>
<li>ensure that the firmware can't be written again</li>
<li>ensure that it can't be read</li>
</ul>
<p dir="auto">I know this feature exists but i would need simple instructions to activate it. Can anybody help ?</p>
]]></description><link>https://community.m5stack.com/topic/3817/how-to-lock-m5stack-software-firmware-encryption</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 20:42:05 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3817.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 11 Dec 2021 09:04:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to lock m5stack software (firmware encryption) on Wed, 06 Dec 2023 21:28:33 GMT]]></title><description><![CDATA[<p dir="auto">Enabling firmware encryption on the ESP32, which is the microcontroller used in M5Stack devices, involves a few steps. Please note that the specifics may vary based on the development environment and tools you are using. Here are general steps you can follow using the Arduino IDE:</p>
<p dir="auto">Install the ESP32 board support:</p>
<p dir="auto">Open Arduino IDE.<br />
Go to "File" -&gt; "Preferences."<br />
In the "Additional Boards Manager URLs" field, add the following URL: <a href="https://dl.espressif.com/dl/package_esp32_index.json" target="_blank" rel="noopener noreferrer nofollow ugc">https://dl.espressif.com/dl/package_esp32_index.json</a><br />
Click "OK" to close the preferences dialog.<br />
Go to "Tools" -&gt; "Board" -&gt; "Boards Manager."<br />
Search for "esp32" and install the "esp32" package.<br />
Install the M5Stack library:</p>
<p dir="auto">Go to "Sketch" -&gt; "Include Library" -&gt; "Manage Libraries."<br />
Search for "M5Stack" and install the M5Stack library.<br />
Update the M5Stack library to the latest version:</p>
<p dir="auto">Open the "Library Manager" again and check if there are updates available for the M5Stack library. If yes, update to the latest version.<br />
Enable Flash Encryption in the Arduino IDE:</p>
<ul>
<li>Open your Arduino sketch.</li>
<li>In the Arduino IDE, go to "Tools" -&gt; "M5Stack" -&gt; "Flash Mode" and select "QIO."<br />
*Go to "Tools" -&gt; "M5Stack" -&gt; "Flash Frequency" and select "40MHz."<br />
*Go to "Tools" -&gt; "M5Stack" -&gt; "Flash Size" and select "16MB."<br />
*Finally, go to "Tools" -&gt; "M5Stack" -&gt; "Partition Scheme" and select "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)."<br />
*Enable Flash Encryption in Code:</li>
</ul>
<p dir="auto">In your Arduino sketch, add the following line at the beginning, before the setup() function:</p>
<pre><code class="language-#include">Preferences preferences;

In the setup() function, add the following lines:
</code></pre>
<p dir="auto">In the setup() function, add the following lines:</p>
<pre><code class="language-void">    preferences.begin("yourAppName", false);
    preferences.putString("yourEncryptionKey", "your32ByteEncryptionKeyHere");
    preferences.end();
    // Rest of your setup code...
}
</code></pre>
<p dir="auto">Replace "yourAppName" with a unique name for your application, and replace "your32ByteEncryptionKeyHere" with a 32-byte encryption key.</p>
<p dir="auto"><strong>Upload the code to your M5Stack device:</strong></p>
<ul>
<li>Connect your M5Stack device to your computer.</li>
<li>Select the correct port and board in the Arduino IDE.</li>
<li>Click the "Upload" button to upload the code to your M5Stack.</li>
</ul>
<p dir="auto">These steps should enable flash encryption for your M5Stack firmware. Keep in mind that once flash encryption is enabled<a href="https://farmry.com/shop/" target="_blank" rel="noopener noreferrer nofollow ugc">,</a> you need to provide the correct encryption key when uploading new firmware. Otherwise, the new firmware won't be written to the device.</p>
]]></description><link>https://community.m5stack.com/post/22990</link><guid isPermaLink="true">https://community.m5stack.com/post/22990</guid><dc:creator><![CDATA[ReneSharpe]]></dc:creator><pubDate>Wed, 06 Dec 2023 21:28:33 GMT</pubDate></item><item><title><![CDATA[Reply to How to lock m5stack software (firmware encryption) on Sun, 05 Nov 2023 09:12:47 GMT]]></title><description><![CDATA[<p dir="auto">Now the next challenge, use esptool-js to upgrade core2 ota.</p>
<p dir="auto">Do someone know if esptool-js support transfert for encrypted files?</p>
]]></description><link>https://community.m5stack.com/post/22654</link><guid isPermaLink="true">https://community.m5stack.com/post/22654</guid><dc:creator><![CDATA[Leo05]]></dc:creator><pubDate>Sun, 05 Nov 2023 09:12:47 GMT</pubDate></item><item><title><![CDATA[Reply to How to lock m5stack software (firmware encryption) on Tue, 31 Oct 2023 12:30:01 GMT]]></title><description><![CDATA[<p dir="auto">Also found this : <a href="https://www.motius.com/post/how-to-build-a-secure-iot-prototype-with-arduino-and-esp32" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.motius.com/post/how-to-build-a-secure-iot-prototype-with-arduino-and-esp32</a></p>
<p dir="auto">It seems esp-idf is only needed for the encryption part, the code can be written with arduino framework</p>
]]></description><link>https://community.m5stack.com/post/22622</link><guid isPermaLink="true">https://community.m5stack.com/post/22622</guid><dc:creator><![CDATA[Leo05]]></dc:creator><pubDate>Tue, 31 Oct 2023 12:30:01 GMT</pubDate></item><item><title><![CDATA[Reply to How to lock m5stack software (firmware encryption) on Tue, 31 Oct 2023 11:46:46 GMT]]></title><description><![CDATA[<p dir="auto">I just found that M5unified support ESP-IDF : <a href="https://github.com/m5stack/M5Unified" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5Unified</a></p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/m5stack" aria-label="Profile: m5stack">@<bdi>m5stack</bdi></a> or <a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> can confirm we can use boot and flash encryption with M5unified ?</p>
]]></description><link>https://community.m5stack.com/post/22621</link><guid isPermaLink="true">https://community.m5stack.com/post/22621</guid><dc:creator><![CDATA[Leo05]]></dc:creator><pubDate>Tue, 31 Oct 2023 11:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to How to lock m5stack software (firmware encryption) on Tue, 31 Oct 2023 11:27:50 GMT]]></title><description><![CDATA[<p dir="auto">Did you found a solution? I am looking for the same feature.</p>
<p dir="auto">As I understand we need to use ESP-IDF</p>
<p dir="auto">I found this but not tested it for now : <a href="https://github.com/ropg/m5core2_esp-idf_demo" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/ropg/m5core2_esp-idf_demo</a></p>
]]></description><link>https://community.m5stack.com/post/22620</link><guid isPermaLink="true">https://community.m5stack.com/post/22620</guid><dc:creator><![CDATA[Leo05]]></dc:creator><pubDate>Tue, 31 Oct 2023 11:27:50 GMT</pubDate></item></channel></rss>