I’ve got my SEA board, but can’t even test if it’s functioning properly.
I followed the “Getting started” article, trying to run the board in Arduino Shield mode.
The example sketch in Arduino IDE did build without errors, and was flashed seemingly ok, yet the fpga side didn’t change its state.
Running the serial monitor and resetting the ESP32 with RST button I see a message, suggesting that something is wrong with SD card:
Googling around I could only find hints that the error code 0x109 means crc error, and it’s likely that some i/o lines of sd card has no proper pullup resistors.
Could this be the case?
In SEA schematics I see 5 out of 7 pullup resistors are marked as DNP (do not place).
Some people with same problem on ‘generic’ ESP32 suggest enabling gpio’s pullups.
Could it be related to Arduino IDE’s and its libraries version?
Ok, somehow the behavior depends very much on the exact card being used.
It failed with 32GB cards, multiple trusted brands, all failed to mount. Working ok with laptop/phone.
It mounted 16GB card speed class 4, but failed to read the data, giving same errors as in 595355940’s example.
For the note - that’s failure, bitstream wasn’t read, and fpga wasn’t initialized, even if output gets “run” printed.
It worked ok with 16GB speed class 10, and with 8GB speed class 4 cards.
All the smaller tested cards were of the same brand (Team)
So, any logical explanation?
It’s not brand, all cards were of the same brand.
It’s not the speed class, since two cards of different classes worked, and one failed card was of the same class as working one.
It’s not the size, not directly. One 16GB card worked, the other 16GB didn’t. And I’ve tried to format it with smaller partition size to avoid possible issues with FAT fs implementation in ESP32 libraries - didn’t help.
On the bright side - I’ve got FPGA successfully configured and running.
Still I’d like to understand what’s the problems with SD cards handling.
I wouldn’t want to buy a pack of cards to find the one that’s liked by the board’s spirit
That’s not a factor in my tests, because all the cards I’ve tried were pre-formatted at factory as FAT32.
When some card failed as FAT32 I tried to create 2GB FAT16 partition.
Mounting/reading that card fails exactly the same, no matter if it was FAT32 or FAT16 partition.
It feels more like a physical/electrical issue. Different capacitance of SD card pins maybe, or different internal pullups characteristics - then the absence of pullups on the board can make a great difference for signal integrity on different cards.
It did help with reboots by pressing the reset button. Now card mounts ok with every single reset
Still, powering SEA with SD card inserted doesn’t work with one specific card I have.
If the board is powered on with the card inserted, I get this error printed repeatedly:
If I plug the sd card after the board is booted, and press reset - then it boots fine.
Not only it doesn’t boot on power on that way, it also fails the programming from within Arduino IDE while the card is inserted.
Apparently, external/forced pullups are interfering with the ESP32 bootup sequence. Pulling the MTDI (GPIO12) pin high at boot (/power?) time selects the 1.8v spi flash interface. And while SAE isn’t using VDD_SDIO pin to actually power the flash chip (according to schematic the flash is powered with the main 3.3v rails), the selected 1.8v voltage should be still used for SPI interface buffers, and shouldn’t work properly with 3.3v chip.
In addition to sdmmc_host_pullup_en() call update, I’ve burned fuses with espefuse.py, forcing the ESP to select 3.3v for flash, ignoring the GPIO12 pin. Looks ok now It starts somewhat longer on cold power on, but it boots, and the fpga is configured without any manipulations with sd card or reset button.
Programming with Arduino IDE is also ok while that “troublesome” SD card plugged in
That’s good to know it does help on the stability!
Did you try to change the SD mounting type from 4-bit to 1-bit for that tricky one?
Maybe it is an SD card limitation.
You could try it just like here to test it: </s> // Mount SD Card
if(!SD_MMC.begin("/sd",true)) {
Serial.println("Card Mount Failed,please reboot the board");
while(1);
return;
}<e>
Got it! I wasn’t aware of that unburned fuses.
Nice!!!
Could you send us a summary of the efuses? Something like:
</s>espefuse.py -p COM4 summary<e>
No, I didn’t try. The card works ok when plugged after the board is powered up, it’s ESP32 that fails to boot.
It simply doesn’t go as far as running sketches, it stops at boot, getting repeatedly rebooted by watchdog, and printing the flash reading error.
The only thing where flash chip and sd card are related - is on the GPIO12 pin. If the card has own pullup (I don’t really know if that’s a thing), the ESP can’t read its code from the flash.
I didn’t save the original report, and only did espefuse.py --port COM19 set_flash_voltage 3.3V.