<?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 access the micro-SD card on F1 starter kit?]]></title><description><![CDATA[<p dir="auto">I tried to access the micro-SD card with the following script:</p>
<pre><code>import machine
from machine import Pin

sd = machine.SDCard(slot=1, width=4, sck=Pin(42), cmd=Pin(40), data=(Pin(41), Pin(18), Pin(17), Pin(16)), freq=20000000)
</code></pre>
<p dir="auto">But that gives the following error:</p>
<pre><code>&gt;&gt;&gt; sd = machine.SDCard(slot=1, width=4, sck=Pin(42), cmd=Pin(40), data=(Pin(41), Pin(18), Pin(17), Pin(16)), freq=20000000)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
TypeError: extra keyword arguments given`
</code></pre>
<p dir="auto">Also this does not work:</p>
<pre><code>&gt;&gt;&gt; sd = machine.SDCard(slot=1, width=4, sck=42, cmd=40, data=(41, 18, 17, 16), freq=20000000)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
TypeError: extra keyword arguments given
</code></pre>
<p dir="auto">From the schematic, I can see that the micro-SD card reader is connected as follows:<br />
CLK &gt;&gt; GPIO42<br />
CMD &gt;&gt; GPIO40<br />
DAT0 &gt;&gt; GPIO41<br />
DAT1 &gt;&gt; GPIO18<br />
DAT2 &gt;&gt; GPIO17<br />
DAT3 &gt;&gt; GPIO16</p>
<p dir="auto">Is that correct?<br />
From the explanation on <a href="https://docs.micropython.org/en/latest/library/machine.SDCard.html#machine-sdcard" target="_blank" rel="noopener noreferrer nofollow ugc">link text</a> I learned that for ESP32-S3 and using SD/MMC mode, slot 1 allows for the use of 4 data pins (width=4).  Correct?</p>
]]></description><link>https://forum.sgwireless.com/topic/66/how-to-access-the-micro-sd-card-on-f1-starter-kit</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 21:28:16 GMT</lastBuildDate><atom:link href="https://forum.sgwireless.com/topic/66.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 04 May 2025 16:23:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to access the micro-SD card on F1 starter kit? on Mon, 12 May 2025 11:13:26 GMT]]></title><description><![CDATA[<p dir="auto">These are the defaults when using SPI mode according to the MicroPython source code <a href="https://github.com/micropython/micropython/blob/f4811b0b42f10aa12fc2f94c0459344d84c89eb8/ports/esp32/machine_sdcard.c" target="_blank" rel="noopener noreferrer nofollow ugc">ext/micropython/ports/esp32/machine_sdcard.c</a></p>
<pre><code class="language-C">    if (is_spi) {
        // SPI interface
        #if CONFIG_IDF_TARGET_ESP32S3
        STATIC const sdspi_slot_config_t slot_defaults[2] = {
            {
                .gpio_miso = GPIO_NUM_36,
                .gpio_mosi = GPIO_NUM_35,
                .gpio_sck = GPIO_NUM_37,
                .gpio_cs = GPIO_NUM_34,
                .gpio_cd = SDSPI_SLOT_NO_CD,
                .gpio_wp = SDSPI_SLOT_NO_WP,
                .dma_channel = 2
            },
            SDSPI_SLOT_CONFIG_DEFAULT()
        };
</code></pre>
]]></description><link>https://forum.sgwireless.com/post/79</link><guid isPermaLink="true">https://forum.sgwireless.com/post/79</guid><dc:creator><![CDATA[cehlers]]></dc:creator><pubDate>Mon, 12 May 2025 11:13:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to access the micro-SD card on F1 starter kit? on Thu, 08 May 2025 06:41:24 GMT]]></title><description><![CDATA[<p dir="auto">It would be good if the documentation provided some more information on this hard coding that is done for the F1 starter kit, but that does not apply when the F1 is put on a custom board. There must still be other things that are hardcoded to make the F1 starter kit work, because when I try the following, it doesn’t work:</p>
<pre><code>&gt;&gt;&gt; import machine, os
&gt;&gt;&gt; sd = machine.SDCard(slot=3, sck=42, miso=41, mosi=40)
&gt;&gt;&gt; os.mount(sd, '/sd')
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
OSError: 16

</code></pre>
<p dir="auto">The code that you gave works fine:</p>
<pre><code>&gt;&gt;&gt; import machine
&gt;&gt;&gt; sd = machine.SDCard()
&gt;&gt;&gt; os.mount(sd, '/sd')
&gt;&gt;&gt; os.listdir('/sd')
['System Volume Information', 'rain.csv', 'sensor.csv', 'waterlevel.csv']

</code></pre>
]]></description><link>https://forum.sgwireless.com/post/78</link><guid isPermaLink="true">https://forum.sgwireless.com/post/78</guid><dc:creator><![CDATA[jandls]]></dc:creator><pubDate>Thu, 08 May 2025 06:41:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to access the micro-SD card on F1 starter kit? on Wed, 07 May 2025 22:23:06 GMT]]></title><description><![CDATA[<p dir="auto">Thanks very much!  Yes, this works.  In this way we are using the SPI protocol with only sck, miso and mosi connected (to GPIO42, 41 and 40, respectively).</p>
]]></description><link>https://forum.sgwireless.com/post/77</link><guid isPermaLink="true">https://forum.sgwireless.com/post/77</guid><dc:creator><![CDATA[jandls]]></dc:creator><pubDate>Wed, 07 May 2025 22:23:06 GMT</pubDate></item><item><title><![CDATA[Reply to How to access the micro-SD card on F1 starter kit? on Wed, 07 May 2025 09:45:17 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/jandls" aria-label="Profile: jandls"><bdi>jandls</bdi></a>,</p>
<p dir="auto">Please see the following from the MicroPython documentation:</p>
<p dir="auto"><img src="/assets/uploads/files/1746608368945-88bd947e-0991-46bd-a25f-4b95f2c40147-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Please note that on the Starter Kit, only 1 of the data pins is connected to the ESP32-S3 as anything else would require a hardware license from the SD Association. You would have to populate R506, R508 and R510 with 0Ohm resistors to connect the GPIO pins and if necessary R500-R502 for the pull-ups.</p>
<p dir="auto"><img src="/assets/uploads/files/1746608746160-3e223c30-2bd1-46a0-8c81-14ba4b42eb19-image.png" alt="3e223c30-2bd1-46a0-8c81-14ba4b42eb19-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">On the starter kit, you can mount a FAT formatted SD Card like this:</p>
<pre><code>import machine
sd = machine.SDCard()
os.mount(sd, '/sd')
os.listdir('/sd')
</code></pre>
<p dir="auto">The pins are hard coded but can be changed here: <a href="https://github.com/sg-wireless/sg-sdk/blob/main/src/platforms/F1/mpy-hooks/patches/machine_sdcard.c.patch" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/sg-wireless/sg-sdk/blob/main/src/platforms/F1/mpy-hooks/patches/machine_sdcard.c.patch</a> on custom designs.</p>
]]></description><link>https://forum.sgwireless.com/post/75</link><guid isPermaLink="true">https://forum.sgwireless.com/post/75</guid><dc:creator><![CDATA[cehlers]]></dc:creator><pubDate>Wed, 07 May 2025 09:45:17 GMT</pubDate></item></channel></rss>