diff --git a/src/main.cpp b/src/main.cpp index 829630f..78cfe1e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -131,12 +131,11 @@ static void updateSdInfo() { if (!sd_ok) return; uint64_t total = SD_MMC.totalBytes() / (1024ULL * 1024ULL); uint64_t used = SD_MMC.usedBytes() / (1024ULL * 1024ULL); - Serial.printf("[SD] API: used=%llu MB, total=%llu MB\n", used, total); - /* SD_MMC.usedBytes() returns 0 on exFAT / large cards — walk filesystem */ - if (used == 0 && total > 0) { + /* Skip heavy filesystem walk while FTP is active (concurrent SD_MMC + access from core 0 + core 1 causes null pointer crashes) */ + if (used == 0 && total > 0 && !ftp_client_on) { uint64_t walked = calcDirSize(SD_MMC, "/"); used = walked / (1024ULL * 1024ULL); - Serial.printf("[SD] Walk: %llu bytes = %llu MB\n", walked, used); } ui_set_sd(used, total); } @@ -469,7 +468,7 @@ static void initFtp() { ftpSrv.begin("kode", "kode"); /* Run FTP in its own task on core 0 so it never blocks LVGL on core 1 */ - xTaskCreatePinnedToCore(ftpTask, "ftp", 8192, NULL, 2, NULL, 0); + xTaskCreatePinnedToCore(ftpTask, "ftp", 32768, NULL, 2, NULL, 0); Serial.printf("[FTP] FTP server ready on core 0 (PASV IP: %s, data port: 50009)\n", WiFi.localIP().toString().c_str());