<?xml version="1.0" encoding="utf-8" ?>

<?xml-stylesheet type="text/xsl" href="/templates/2k11/rss.xsl" media="screen" ?>
<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   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:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Daniel Lange's blog (Entries tagged as flash)</title>
    <link>http://daniel-lange.com/</link>
    <description>agrep -pB IT /dev/life</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 2.6.0 - http://www.s9y.org/</generator>
    <pubDate>Thu, 20 Jun 2024 14:47:36 GMT</pubDate>

    <image>
    <url>//daniel-lange.com/uploads/Avatar_Blog_144_234.png</url>
    <title>RSS: Daniel Lange's blog - agrep -pB IT /dev/life</title>
    <link>http://daniel-lange.com/</link>
    <width>144</width>
    <height>234</height>
</image>

<item>
    <title>Fixing esptool read_flash above 2MB on some cheap ESP32 boards</title>
    <link>http://daniel-lange.com/archives/188-Fixing-esptool-read_flash-above-2MB-on-some-cheap-ESP32-boards.html</link>
            <category>Electronics</category>
    
    <comments>http://daniel-lange.com/archives/188-Fixing-esptool-read_flash-above-2MB-on-some-cheap-ESP32-boards.html#comments</comments>
    <wfw:comment>http://daniel-lange.com/wfwcomment.php?cid=188</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=188</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;&lt;code&gt;esptool&lt;/code&gt;, the Espressif SoC serial bootloader utility, tends to dislike cheap Flash chips attached to the various incarnations of the ESP32 chip family. And it seems to dislike them even more when running &lt;code&gt;esptool&lt;/code&gt; on Linux than on other OSs.&lt;/p&gt;

&lt;p&gt;The common error mode is seeing it break at the 2MB barrier when trying to dump (&lt;code&gt;esptool read_flash&lt;/code&gt;) a 4MB flash configuration.&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;esptool &lt;span style=&quot;color: #660033;&quot;&gt;-p&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;dev&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;ttyUSB0 &lt;span style=&quot;color: #660033;&quot;&gt;-b&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;921600&lt;/span&gt; read_flash &lt;span style=&quot;color: #000000;&quot;&gt;0&lt;/span&gt; 0x400000 flash_dump.bin&lt;/div&gt;

&lt;p&gt;will fail with&lt;/p&gt;

&lt;pre&gt;
esptool.py v4.7.0
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
[..]
Detected flash size: 4MB
[..]
2097152 (50 %)
A fatal error occurred: Failed to read flash block (result was 01090000: CRC or checksum was invalid)
&lt;/pre&gt;

&lt;p&gt;typically at the 2MB barrier.&lt;/p&gt;

&lt;p&gt;I found the solution in a rather unrelated &lt;a href=&quot;https://github.com/espressif/esptool/issues/890&quot;&gt;esptool Github issue&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Create an &lt;code&gt;esptool.cfg&lt;/code&gt; file in the project directory (from where you will run &lt;code&gt;esptool&lt;/code&gt;):&lt;/p&gt;

&lt;div class=&quot;ini geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000066; font-weight:bold;&quot;&gt;&lt;span style=&quot;&quot;&gt;&amp;#91;&lt;/span&gt;esptool&lt;span style=&quot;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000099;&quot;&gt;timeout&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight:bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #660066;&quot;&gt; 30&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000099;&quot;&gt;max_timeout&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight:bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #660066;&quot;&gt; 240&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000099;&quot;&gt;erase_write_timeout_per_mb&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight:bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #660066;&quot;&gt; 40&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000099;&quot;&gt;mem_end_rom_timeout&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight:bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #660066;&quot;&gt; 0.2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000099;&quot;&gt;serial_write_timeout&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight:bold;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #660066;&quot;&gt; 10&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;timeout = 30&lt;/code&gt; is the setting that fixed reading flash memory via &lt;code&gt;esptool read_flash&lt;/code&gt; for me.&lt;/p&gt;

&lt;p&gt;When your &lt;code&gt;esptool.cfg&lt;/code&gt; is read, &lt;code&gt;esptool&lt;/code&gt; will tell you so in its second line of output:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;$ &lt;/span&gt;esptool flash_id&lt;/div&gt;

&lt;pre&gt;
esptool.py v4.7.0
Loaded custom configuration from /home/dl/[..]/Embedded_dev/ESP-32_Wemos/esptool.cfg
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting......
[..]
&lt;/pre&gt;

&lt;p&gt;&lt;!-- s9ymdb:712 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;320&quot; height=&quot;180&quot;  src=&quot;http://daniel-lange.com/uploads/entries/ESP32.gif&quot; title=&quot;env:wemosbat in platformio.ini, just in case you need that&quot; alt=&quot;Animated GIF of an ESP32 board&quot;&gt;&lt;/p&gt;

&lt;p&gt;Thank you &lt;a href=&quot;https://github.com/radimkarnis&quot;&gt;Radim Karnis&lt;/a&gt; and &lt;a href=&quot;https://github.com/wibbit&quot;&gt;wibbit&lt;/a&gt; from the Github issue linked above.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Thu, 20 Jun 2024 14:00:00 +0000</pubDate>
    <guid isPermaLink="false">http://daniel-lange.com/archives/188-guid.html</guid>
    <category>esp32</category>
<category>flash</category>

</item>
<item>
    <title>Installing System Rescue (CD) to a flash drive</title>
    <link>http://daniel-lange.com/archives/168-Installing-System-Rescue-CD-to-a-flash-drive.html</link>
            <category>Linux</category>
    
    <comments>http://daniel-lange.com/archives/168-Installing-System-Rescue-CD-to-a-flash-drive.html#comments</comments>
    <wfw:comment>http://daniel-lange.com/wfwcomment.php?cid=168</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=168</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;https://www.system-rescue.org/&quot;&gt;System Rescue&lt;/a&gt;, the project formerly known as &lt;a href=&quot;https://en.wikipedia.org/wiki/SystemRescue&quot;&gt;System Rescue CD&lt;/a&gt;, has moved from being based on Gentoo to being built on Arch Linux packages.&lt;/p&gt;

&lt;p&gt;With this their ISO layout changed substantially so when updating my trusty recue USB flash drive, I could not just update the kernel, initrd and the root filesystem image as I had typically done every other year before.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://www.system-rescue.org/Installing-SystemRescue-on-a-USB-memory-stick/&quot;&gt;&quot;Installing on a USB memory stick&quot;&lt;/a&gt; documentation is good for Windows (use &lt;a href=&quot;https://rufus.ie/&quot;&gt;Rufus&lt;/a&gt;, it&#039;s nice) but rather useless for Linux. They recommend a &lt;code&gt;dd&lt;/code&gt; or the fancy graphical version of that, called &lt;code&gt;usbimager&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I much prefer to have a flash drive that I can write to over an image of a CD (ISO) written 1:1 onto the flash media.&lt;/p&gt;

&lt;p&gt;The basic idea is to use the bulk of the System Rescue ISO contents but amend these with your own grub and syslinux so they work as intended over the supplied ones that are bound to the ISO layout a bit too much.&lt;/p&gt;

&lt;p&gt;I did this on Debian Buster but with some adjustments to paths and what packages to install, any recent Linux distribution should do:&lt;/p&gt;
 &lt;a class=&quot;block_level&quot; href=&quot;http://daniel-lange.com/archives/168-Installing-System-Rescue-CD-to-a-flash-drive.html#extended&quot;&gt;Continue reading &quot;Installing System Rescue (CD) to a flash drive&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 27 Jan 2021 12:47:00 +0000</pubDate>
    <guid isPermaLink="false">http://daniel-lange.com/archives/168-guid.html</guid>
    <category>archlinux</category>
<category>boot</category>
<category>flash</category>
<category>gentoo</category>
<category>iso</category>
<category>sysconfig</category>
<category>updated</category>

</item>

</channel>
</rss>
