<?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[M5Paper SDCard access]]></title><description><![CDATA[<p dir="auto">Is there a way to access M5Paper SD card with MicroPython?</p>
<p dir="auto">There is no uos module, but os has mount function.<br />
I tried:</p>
<pre><code>import os
os.mount(machine.SDCard(), '/sd')
</code></pre>
<p dir="auto">which result in:</p>
<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
OSError: 16
</code></pre>
]]></description><link>https://community.m5stack.com/topic/2990/m5paper-sdcard-access</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 01:06:03 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2990.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Feb 2021 14:58:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5Paper SDCard access on Sat, 12 Oct 2024 23:01:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mehulge" aria-label="Profile: mehulge">@<bdi>mehulge</bdi></a> stuck with same issue, did you ever found the fix?</p>
]]></description><link>https://community.m5stack.com/post/26710</link><guid isPermaLink="true">https://community.m5stack.com/post/26710</guid><dc:creator><![CDATA[rodrigob]]></dc:creator><pubDate>Sat, 12 Oct 2024 23:01:50 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Thu, 25 Apr 2024 10:00:13 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/mehulge" aria-label="Profile: mehulge">@<bdi>mehulge</bdi></a></p>
<p dir="auto">yep, still broken. And my previous attempt to fix that doesn't seem to work anymore.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/24934</link><guid isPermaLink="true">https://community.m5stack.com/post/24934</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 25 Apr 2024 10:00:13 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Wed, 24 Apr 2024 15:50:37 GMT]]></title><description><![CDATA[<p dir="auto">This issue has returned for Ui Flow 2.<br />
[Errno 22] EINVAL<br />
E (705271) spi: spi_bus_initialize(758): SPI bus already initialized.<br />
Traceback (most recent call last):<br />
File "&lt;stdin&gt;", line 13, in &lt;module&gt;<br />
File "&lt;stdin&gt;", line 8, in setup<br />
File "hardware/sdcard.py", line 21, in sdcard<br />
OSError: (-259, 'ESP_ERR_INVALID_STATE')</p>
<p dir="auto">Any possible solutions?</p>
]]></description><link>https://community.m5stack.com/post/24925</link><guid isPermaLink="true">https://community.m5stack.com/post/24925</guid><dc:creator><![CDATA[mehulge]]></dc:creator><pubDate>Wed, 24 Apr 2024 15:50:37 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Sat, 12 Mar 2022 15:47:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> said in <a href="/post/16655">M5Paper SDCard access</a>:</p>
<blockquote>
<p dir="auto">isd = SPI(-1, miso=Pin(13), mosi=Pin(12), sck=Pin(14))<br />
sd = SDCard(spisd, Pin(4))<br />
os.mount(sd, '/sd')<br />
print(os.listdir('/sd'))</p>
</blockquote>
<p dir="auto">Doesnt work for me ( it works for printing in thonny ... but the device freezes)</p>
]]></description><link>https://community.m5stack.com/post/16914</link><guid isPermaLink="true">https://community.m5stack.com/post/16914</guid><dc:creator><![CDATA[Medy]]></dc:creator><pubDate>Sat, 12 Mar 2022 15:47:13 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Sat, 16 Dec 2023 19:18:53 GMT]]></title><description><![CDATA[<p dir="auto">Hello guys</p>
<p dir="auto">the uncommented code in <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a> uses the incorrect SPI GPIOs for M5Paper. But even with the correct GPIOs it doesn't seem to work. I suspect that the SDCard driver built into the M5Paper UiFlow firmware is faulty.</p>
<p dir="auto">That said, I found a replacement SDCard driver <a href="https://github.com/micropython/micropython/blob/v1.19.1/drivers/sdcard/sdcard.py" target="_blank" rel="noopener noreferrer nofollow ugc">here</a> mentioned <a href="https://techtotinker.blogspot.com/2021/04/023-esp32-micropython-how-to-use-sd.html" target="_blank" rel="noopener noreferrer nofollow ugc">here</a> that seems to work.</p>
<p dir="auto">With the <code>sdcard.py</code> file downloaded onto my M5Paper (alongside <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a>, <a href="http://main.py" target="_blank" rel="noopener noreferrer nofollow ugc">main.py</a>) I was able to list the files on the inserted SD card and write and read a file.</p>
<pre><code>import os
from machine import Pin, SPI
from sdcard import SDCard

spisd = SPI(-1, miso=Pin(13), mosi=Pin(12), sck=Pin(14))
sd = SDCard(spisd, Pin(4))
os.mount(sd, '/sd')
print(os.listdir('/sd'))

### Write file
#f = open('/sd/___AAA.txt', 'w')
#f.write('Some text')
#f.close()

### Read a file
#f = open('/sd/___AAA.txt', 'r')
#print(f.read())
#f.close
</code></pre>
<p dir="auto">Note: I was using Thonny to download and test.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/16655</link><guid isPermaLink="true">https://community.m5stack.com/post/16655</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Sat, 16 Dec 2023 19:18:53 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Mon, 14 Feb 2022 18:17:47 GMT]]></title><description><![CDATA[<p dir="auto">Same problem. Any updates? There must be a reason why the code in <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a> is there and why it was commented out</p>
]]></description><link>https://community.m5stack.com/post/16653</link><guid isPermaLink="true">https://community.m5stack.com/post/16653</guid><dc:creator><![CDATA[Pavlo]]></dc:creator><pubDate>Mon, 14 Feb 2022 18:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Wed, 12 Jan 2022 23:06:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/medy" aria-label="Profile: medy">@<bdi>medy</bdi></a> which UIFlow version do you use? v1.9.0? I have the M5Paper (Version 1) with v1.9.0</p>
<p dir="auto">I've still got some issues but I'm glad that this topic still has some progress.</p>
<p dir="auto">The code you posted from <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a> is present on mine as well, but commented out. If I add the code (in <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a> or <a href="http://main.py" target="_blank" rel="noopener noreferrer nofollow ugc">main.py</a>) my device freezes. This happens on <a href="http://sd.info" target="_blank" rel="noopener noreferrer nofollow ugc">sd.info</a>() and os.mount(sd, '/sd').</p>
<p dir="auto">Did you use your third code from the post? or is this just a regular micropython module?</p>
<p dir="auto">Any help is highly appreciated :)</p>
]]></description><link>https://community.m5stack.com/post/16168</link><guid isPermaLink="true">https://community.m5stack.com/post/16168</guid><dc:creator><![CDATA[paeber]]></dc:creator><pubDate>Wed, 12 Jan 2022 23:06:54 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Sun, 28 Nov 2021 15:30:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrk" aria-label="Profile: mrk">@<bdi>mrk</bdi></a> I figured it out...</p>
<p dir="auto">turns out you dont need to mount at all just do</p>
<pre><code>import json

with open('/sd/config.json', 'r') as fs:
c = json.loads(fs.read())
label0 = M5TextBox(140, 106, c['ssid'], lcd.FONT_Default, 0xFFFFFF, rotate=0)
</code></pre>
<p dir="auto">I may have run some code prior to that .. dont remember .. try that if the first thing didnt work .. ( this is from <a href="http://boot.py" target="_blank" rel="noopener noreferrer nofollow ugc">boot.py</a>) ... maybe it gets added automatically</p>
<pre><code>import machine, os
try:
    sd = machine.SDCard(slot=3, miso=19, mosi=23, sck=18, cs=4)
    sd.info()
    os.mount(sd, '/sd')
    print("SD card mounted at \"/sd\"")
except:
    pass
</code></pre>
<p dir="auto">.</p>
<pre><code>import uos

uos.sdconfig(uos.SDMODE_SPI,clk=18,mosi=23,miso=19,cs =4)

uos.mountsd()
</code></pre>
]]></description><link>https://community.m5stack.com/post/15643</link><guid isPermaLink="true">https://community.m5stack.com/post/15643</guid><dc:creator><![CDATA[Medy]]></dc:creator><pubDate>Sun, 28 Nov 2021 15:30:33 GMT</pubDate></item><item><title><![CDATA[Reply to M5Paper SDCard access on Mon, 05 Jul 2021 14:20:37 GMT]]></title><description><![CDATA[<p dir="auto">Did you ever figure this out? Struggling with the same issue</p>
]]></description><link>https://community.m5stack.com/post/14349</link><guid isPermaLink="true">https://community.m5stack.com/post/14349</guid><dc:creator><![CDATA[mrk]]></dc:creator><pubDate>Mon, 05 Jul 2021 14:20:37 GMT</pubDate></item></channel></rss>