dcrespo3d / ZX-ESPectrum-Wiimote

A ZX spectrum 48K/128K emulator running on ESP32 powered Lilygo TTGo VGA32 v1.4 board, using PS2 keyboard and/or Wiimote as input device. Active branches are master and devkit-custom
MIT License
67 stars 18 forks source link

No SD card window #19

Closed DrNorfolk closed 9 months ago

DrNorfolk commented 2 years ago

I noticed that the vga-window does not work, which should display a warning that the sd card is missing. There is code in the FileUtils.cpp file that I think should do this, but nothing appears on the screen.

    if (!SD.begin(SDCARD_CS, customSPI, 4000000, "/sd")) {
        Serial.println("Card Mount Failed");
        OSD::errorHalt(ERR_FS_EXT_FAIL);
        return;
    }

OSD::errorHalt(ERR_FS_EXT_FAIL);

The following is output to the console:

Initializing external storage...
[E][sd_diskio.cpp:123] sdSelectCard(): Select Failed
[E][sd_diskio.cpp:123] sdSelectCard(): Select Failed
[E][sd_diskio.cpp:775] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
Card Mount Failed
Cannot mount external storage!
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:719 (xQueueGenericSend)- assert
failed!
abort() was called at PC 0x40097532 on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x40096918:0x3ffcb400 0x40096b91:0x3ffcb420 0x40097532:0x3ffcb440 0x400d5409:0x3ffcb480 0x400d7191:0x3ffcb4a0 0x400d813a:0x3ffcb4c0 0x4008450e:0x3ffcb4f0 0x400d4ab0:0x3ffcb530 0x400e5007:0x3ffcb5d0 0x400e97aa:0x3ffcb5f0 0x40097bd6:0x3ffcb610

Rebooting...
ets Jun  8 2016 00:22:57

And then the esp32 goes into reboot indefinitely, until you insert the SD card. It would be very nice if the window "Sir Clive is smoking in the Rolls... Cannot mount external storage!" on the screen. Thank you dcrespo3d for your work!

abelykh0 commented 1 year ago

As an alternative, if the SD card is missing, theoretically you can "fall back" to OpenSE Basic: https://spectrumcomputing.co.uk/index.php?cat=96&id=27510 (GPL v2.0) instead of just failing.