fdivitto / FabGL

ESP32 Display Controller (VGA, PAL/NTSC Color Composite, SSD1306, ST7789, ILI9341), PS/2 Mouse and Keyboard Controller, Graphics Library, Sound Engine, Game Engine and ANSI/VT Terminal
http://www.fabglib.org
Other
1.49k stars 222 forks source link

This app requires a SD-CARD! #136

Closed eh closed 3 years ago

eh commented 3 years ago

Loading PCEmulator on a TTGO VGA32 v1.4 this error appears. It doesn't matter what size SD card, I have tried 128MB (yes Mega-Bytes) to 16GB. I can't find any info on what the SD card is supposed to contain so I've tried formatting it to fat16 and fat32. Nothing seems to work. I tried un-commenting:

// uncomment to format SD! FileBrowser::format(fabgl::DriveType::SDCard, 0);

but this made no difference. Not sure what I'm missing. Any help?

guidol70 commented 3 years ago

You need a FAT(32)-formatted SDCard which should contain a bootable image like FD.IMG for a Floppy as A: OR HD.IMG for a HDD as C:

The .IMG format is the same as used by the DOSBOX-Project, so you may find a bootable Floppy-Image on the net

For modifying such FD/HD-images I could recommend the tool ImDisk for Windows

PS: The Info about the HD.IMG was in the comments of this YouTube-Video

eh commented 3 years ago

I've tried putting an image onto an sdcard (using dd) and also formatting the sdcard to fat32 and copying the .img file onto it. Either way I get "This app requires a SD-CARD!" on the screen.

eh commented 3 years ago

Is it possible I have a strange V1.4 board with different pins to the SD card? Silkscreen has VGA32_V1.4 and a date of 21-2-20 below the SD card slot.

guidol70 commented 3 years ago

@eh Normally the pinout shouldnt differ. My board do have all the date 20-4-28 in the silkscreen. It sounds as the VGA32 doenst recognize your MicroSD-Card. Did you try different ones? Using dd for the image is the wrong way, you only have to put the .img files to the card.

Did you configure the WiFi? Because the last versions of the PC-Emulation does use WiFi to set the time via NTP and then download the boot-images via WiFi to the Card, but yout card isnt recognized.

Did you see the compile instructions in the source? partition scheme must be: Huge App make sure PSRAM is DISABLED

Search in the .INO of the PC-Emulation for http://www.fabglib.org/downloads/ there you could find the links for A: and C: images which are normally downloaded via WiFi

eh commented 3 years ago

@eh Normally the pinout shouldnt differ. My board do have all the date 20-4-28 in the silkscreen.

Mine is 21-2-20. Is it possible to find out if the pinout has changed with this different revision? Please see https://github.com/fdivitto/FabGL/issues/74 where this is addressed previously I believe for V1.2 vs. V1.4. Now we have 20-4-28 (yours) and 21-2-20 (mine) in the wild.

It sounds as the VGA32 doenst recognize your MicroSD-Card. Did you try different ones?'

As I originally stated, yes, I tried many.

Using dd for the image is the wrong way, you only have to put the .img files to the card.

I had also tried fat16 and fat32, copying the .img files to the card. The card is not detected.

Did you configure the WiFi? Because the last versions of the PC-Emulation does use WiFi to set the time via NTP and then download the boot-images via WiFi to the Card, but yout card isnt recognized.

Yes I fully configured it and the result is the same, it won't download any images because the SD card isn't detected.

Did you see the compile instructions in the source? partition scheme must be: Huge App make sure PSRAM is DISABLED

Yes, these are set correctly.

guidol70 commented 3 years ago

Yes I fully configured it and the result is the same, it won't download any images because the SD card isn't detected.

Did you try to enable the format option for the SD-Card in Line 285-286 in the PCEmulation.ino?

  // uncomment to format SD!
  //FileBrowser::format(fabgl::DriveType::SDCard, 0);

The last change I did see for the SDCard Pin-Assignment was in this commit Maybe the Chip-Package-Name has changed from ESP32PICOD4 to something other in the new Revision?

I also did try to ask for support via twitter - we will see ;) Lilygo_Support

eh commented 3 years ago

Did you try to enable the format option for the SD-Card in Line 285-286 in the PCEmulation.ino?

Yes, mentioned this in my original post.

I also did try to ask for support via twitter - we will see ;)

Thanks! I tried passing several (but no-where near all) pin combinations to FileBrowser::mountSDCard but got nowhere. Hopefully they have some info.

guidol70 commented 3 years ago

From the commit I mentioned above - with the line return ChipPackage::ESP32PICOD4; // TTGO-VGA32 could you see when the sketch will be uploaded if your board is recognized in the flash-log as: Chip is ESP32-PICO-D4 (revision 1)

You could also check if you got the same pin numbers at the open pin-holes like on my version TTGO_VGA32_v1_4_20-4-28 ):

eh commented 3 years ago

I had a bit of a think about things and tried backing down the installed version of esp32 from 2.0.0-alpha1 to 1.0.6 and TADA it works! It appears 1.0.6 is required, I just tried the recently released 2.0.0-rc1 and it completely fails to compile PCEmulator. Something about multiple WiFi libraries. I'm not going to fix that to find out more since we now have an answer.

Thanks for the help with this, frustrating issue. I appreciate it. Not sure if I should close this or not for future users that might run into this before a note can be made in the source.

guidol70 commented 3 years ago

It appears 1.0.6 is required

Yes "required" - but more supported. I had seen a "switch" in the commits when supporting a new ESP32 Support package in FabGL sources

And the last was the v1.0.6 ;)

smutek110 commented 3 years ago

You change the sd card pins in the FabGL \ src \ fabutils.h file inside the FabGL library

eh commented 3 years ago

You change the sd card pins in the FabGL \ src \ fabutils.h file inside the FabGL library

You can easily change them via FileBrowser::mountSDCard()

http://www.fabglib.org/classfabgl_1_1_file_browser_a854da7be3c7cd8cc54d82171b978b52c.html

smutek110 commented 3 years ago

For me, the effect was only after the change in the FabGL \ src \ fabutils.h file inside the FabGL library. PCEmulator uses this configuration for SD Card. I use TTGO-T8 v1.7.1

eh commented 3 years ago

PCEmulator uses mountSDCard() as seen here:

PCEmulator.ino#L282

SD Card pins can be specified by changing as necessary, for example:

if (!FileBrowser::mountSDCard(false, "/SD", 8, 16384, MISO, MOSI, CLK, CS )) if (!FileBrowser::mountSDCard(false, "/SD", 8, 16384, 16, 17, 14, 13 ))

smutek110 commented 3 years ago

I was able to launch the program, set up WIFI, download the files and the program ends with a black screen

fdivitto commented 3 years ago

it could be the VGA resolution is not supported by your monitor. Have you tried another one?

coolcoder613eb commented 5 months ago

I am having this issue too.

coolcoder613eb commented 5 months ago

I resolved the issue. I was using a slow 512MB SD card, when I tried a faster 16GB one, it worked.