<?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[M5Core2 and SD-Card stack challenge]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I used ESP-IDF v4.4-beta1, Arduino 2.0.2 for and M5Core2-Library ("0.1.0" = newest version, I also checked 0.0.3). The Arduino libraries I got from "<a href="https://github.com/espressif/arduino-esp32.git" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/espressif/arduino-esp32.git</a>" and the M5Core2 Library I loaded from "<a href="https://github.com/m5stack/M5Core2.git" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5Core2.git</a>".</p>
<p dir="auto">I can initialize the M5Core2, write text on the screen and connect to wifi. If I activated the SD-Card I got an error: "A stack overflow in task main has been detected."</p>
<p dir="auto">I looked for the cause and it are these calls:</p>
<pre><code>bool SD_Enabler = true;
M5.begin(true, SD_Enabler, true, false, kMBusModeInput); 
   -&gt; SD.begin(TFCARD_CS_PIN, SPI, 40000000);
      -&gt; if(!sdcard_mount(_pdrv, mountpoint, max_files, format_if_empty)){
          -&gt; FRESULT res = f_mount(fs, drv, 1);
</code></pre>
<p dir="auto">The reason for the stack challenge is f_mount.<br />
There are only two parameters for this function:</p>
<pre><code>FATFS* fs;
char drv[3] = {(char)('0' + pdrv), ':', 0};
</code></pre>
<p dir="auto">The value for drv is "0:" and seemed okay. The parameter fs was initialled some lines one before without an error:</p>
<pre><code>  esp_err_t err = esp_vfs_fat_register(path, drv, max_files, &amp;fs);
    if (err == ESP_ERR_INVALID_STATE) {
        log_e("esp_vfs_fat_register failed 0x(%x): SD is registered.", err);
        return false;
    } else if (err != ESP_OK) {
        log_e("esp_vfs_fat_register failed 0x(%x)", err);
        return false;
    }
</code></pre>
<p dir="auto">I didn't know what happened. Have anyone a good idea?</p>
]]></description><link>https://community.m5stack.com/topic/3953/m5core2-and-sd-card-stack-challenge</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Mar 2026 21:45:44 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/3953.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 22 Jan 2022 07:54:58 GMT</pubDate><ttl>60</ttl></channel></rss>