kbr-net / sdrive-max

Arduino based Atari 8-bit Floppy Emulator with Touchscreen
http://www.kbrnet.de/projekte/sdrive-max/index.html
GNU General Public License v3.0
92 stars 23 forks source link

Most newer SD cards does not initialize #53

Open StmLord opened 2 years ago

StmLord commented 2 years ago

I've found out the hard way that most newer micro SD cards reports as SD card init failed on the Sdrive, even from the same manufacturer/model/size that few months ago were working great. up to now Patriot 32GB, kingston 32GB does not work, before I was using the same Kingston canvas select plus 32GB and was working correctly

kbr-net commented 2 years ago

Most newer, big SD cards are delivered with exFAT formatted by default now. This does SDrive not support. Have you tried to reformat it with FAT32? Otherwise please post the error codes shown on the display.

TzOk83 commented 2 years ago

Maybe it has something to do with the initialization speed. I've encountered similar problems, when I was trying to use Arduino without a bootloader, and uploaded the firmware directly to MCU, via the AVRdude programmer. Later I found, that the bootloader adds an extra delay after power up, which is required for the SD card, to become initialized and responsive.

kbr-net commented 2 years ago

Maybe there is also initialization code missing which is done in bootloader, but an arduino without a bootloader is not an arduino, and i don't want to support such modified variants.

StmLord commented 1 year ago

It seems to be like timing issues. I've found the time and got 2 different batches of Arduino clones from different sellers and makers and 2 batches of different SD cards. 1st type of card is Intenso microSDHC UHS-I 16GB. ALL (10) of these cards works on every batch and displays I've tested them 2nd type of cards was Patriot microSD 32GB HC-I U1 these cards (10) was hit and miss, in some Arduinos were working as it should and in some others was not readable with "error init SD: 1". Thats the same I had with all newer Kingston 32GB canvas select I had too (5 pieces) The 2 batches of Arduinos were the same layout with plcc atmega328 with only obvious difference on the location of the RX TX 5v and GND pins. All other ICs, regs etc were the same (CH340G) It could be defective UNOs but because the percentage is almost 50-60% on both batches and ALL are working correctly with intenso SD cards it make me think it might be some timing issues on the initialization. If the initialisation code is not part of the Sdrive-max firmware then I think its some small difference on caps and resistor tolerances together with very strict timing on the init code (if that's on the UNO boot loader). P.S all the time I was using only one specific HX8347i lcd screen so I don't add another complexity point to the testing equation.

kbr-net commented 1 year ago

This sounds very strange... Have you compared the FUSE bits on this devices? They affect the startup time also, and it would be interesting, if there are some differences.

TrevorDunne commented 1 year ago

I had a old 16Gb SanDisk 16GB (2) Micro SD HC I but this into the SDMAX V1.2 and would not initialize Fat32 I just thought is the SD card was to slow. so I brought another one Transcend Premium 16GB Micro (1) HCI Read 90MB and to my shock that did not work as well. I then tried a another SD Card Transcend Premium 64GB Micro SD (1) XCI Read 90MB and created a partition 16GB Fat32 using windows inserted SD card into SDMAX v1.2 and now it work fine. So they must be a problem somewhere is reading SD Cards

kbr-net commented 1 year ago

Error codes please!

TrevorDunne commented 1 year ago

On screen Ready SIO-Error: 4 SIO-Error: 3

kbr-net commented 1 year ago

This is not a SD card error. You have the card inserted at power on? There is no hotplug support! (because the display shield has no card detect line)

TrevorDunne commented 1 year ago

I should have put Ready Error init SD: 2 0000007f 00000000

second message is after when you touch the Ready screen

TrevorDunne commented 1 year ago

image

TrevorDunne commented 1 year ago

This is the Transcend Premium 16GB Micro (1) HCI Read 90MB format as FAT32 image

kbr-net commented 1 year ago

Always the same error on each card? Is your device powered over the atari, or external?

I will have a look at the initialization code by time, but i need as much as possible information...

Mariuszczs commented 6 months ago

I have the same problem. Two different boards and two different displays don't work for me. Error init SD: 1.

Mariuszczs commented 6 months ago

For a few cards I have 00000000 0000000 For others 000000ff 00000000