PPCenter :: devblog

PPcenter. Arts and craft for my Sega Saturn. Since 1847 :D

Improved SD card support !

Written by cafealpha 6 comments
I'm glad to announce that (as indicated in the title of this article) SD card support will be improved in Pseudo Saturn Kai next release This improvement concerns compatibility with a wider range of SD cards manufacturers.

Since Action Replay carts doesn't have SD card socket, this concerns only Gamer's Cartridge ... and no, gluing a SD card socket to Action Replay PCB won't magically make it recognized by Pseudo Saturn Kai : I didn't extended compatibility this far

More seriously, this improvement concerns Pseudo Saturn Kai itself, and all Gamer's Cartridge hardware revision will be concerned.
For example, the very first public PCB revision (with goofy LED positioning and using official memory cartridge shell) should be compatible with this improvement ... I write should because I didn't actually tested with PCB from this revision, but since hardware revisions are basically cosmetic changes, I'm quite confident this improvement will work on all Gamer's Cartridge


About the technical part of this improvement (please skip this paragraph if you are not interested in technical details), Pseudo Saturn Kai was not sending enough clock pulses to SD card before sending commands. In fact, at the very beginning of Gamer's Cartridge project (long before first public release), Pseudo Saturn Kai wasn't sending any synchronization pulse at all, but this wasn't a problem since some SD cards don't need theses, and so that Gamer's Cartridge project could work ... with poor SD card compatibility, but work anyway

After that, I discovered that some synchronization clocks before sending a command helps in getting SD card working, so I sent eight clocks, which improved compatibility enough to make a blog article about it at that time

Finally, Pseudo Saturn Kai now send enough clock until SD card replies it is ready for processing command. So yes, this improvement is just extension of a previous one from "provide eight synchronization clocks" to "provide enough synchronization clocks". It looks simple, but noticing it wasn't


This improvement is not publicly available yet, so please be patient Before putting it in the wild, I need to test it on my SD card collection, because so far I only tested on a problematic Sand*sk card, and a couple of other SD cards who were working well so far.
All theses SD card were recognized, but I should test with all the other ones I own : it would be a pity for Pseudo Saturn Kai to break compatibility with things working well so far !

Regarding testing schedule, I'm not sure it will be possible to do it until end of August : it's not like I don't want to do it, but just because summer holidays are likely to monopolize the free time slots usually reserved for testing on real hardware
And no, it's not about my holidays, but about my kids' ... it's a long time I personally didn't went on long vacations, but I'm looking forward for this pleasure when the benefits from Gamer's Cartridge development, manufacturing and sales will finally reach forty two million dollar


Anyway (and more seriously), this blank period until testing is a chance to improve a bit more SD card support : after a long time I didn't looked at SD card access code, I found few things that were left in a "it works, but should be improved later" state
My strategy about theses "should be improved later" things is to finish them in a clean way, then test them with my SD card collection until tey work well, and finally never touch this SD card access code any more !

Before publicly releasing Gamer's Cartridge, maintaining this part of the project was funny, but now it is too scary to break any kind of compatibility that I preferred not to touch it.
So for the last two years, I preferred to keep all the the code there as-is ... and sell SD cards at super low price (bought around 800 Yens, sold USD 3 ... 2+2 is 4 minus 1 that's 3. QUICK MATHS ) to avoid SD card compatibility problems. After Pseudo Saturn Kai next release, I hope that it will be compatible enough to avoid this "provide a recognized SD card" step


(Below is a bit of boring history about my Saturn project(s). Please skip if you are not interested)
SD card access code is a very old part of Pseudo Saturn Kai project : it was initially done for accessing SD card via second pad controller around summer 2011 : at that time USB dev cart project didn't existed and my extent in electronics was to put simple components on a breadboard : it's good to see the experience I gained in electronics, and also that some code from this era kept surviving in Pseudo Saturn Kai project
SD card connected to second pad, ready to
dump my Memory Card Plus cartridge.
The menu display and starfield effect in Saturn utility
were later re-used in Pseudo Saturn Kai project
The menu module evolved a lot from that time


End of the "good old times and flashback of back&white memories" ... I'm not that old enough for this crap Instead let's back to details regarding Pseudo Saturn Kai schedule :

I still have to finish some other features (not related to SD card access) still on development, and prefer to release all the news things in a single time rather than every small feature little by little. Exception is made for critical fixes that are released as early as possible : notable (and only ?) example is Pseudo Saturn Kai 6.074, which fixed a bug regarding internal backup memory access, as detailed in this article.

This SD card improvement is not a critical fix, and consequently won't be released separately before everything else. This means that extra wait is required, but on a positive side it also means that it will be released with all the new features developed from latest release.
Latest version was released one year and half ago, so there are some new features awaiting Please stay tuned


Last but not least, it's easy to pride "I made this or that" in a blog article, but it's cool to praise people who helped
First, I would like to thank my friend Darius, for constantly asking me when I will finally get Sand*sk SD card working correctly on Gamer's Cartridge, and -which is more important- for gathering a French Saturn community

Also, I would like to thank malachi84 for reporting incompatible SD card. I usually answer such report by something like "give a try with a cheap SD card from another brand, and it will work", but this report came at the right time when I wanted to change my mind from current development task 
So, I started to search what should be done to improve SD card compatibility, making random changes to Pseudo Saturn Kai, testing on real hardware, realizing that first beta doesn't works (from my own experience as software engineer, I NEVER had something working fine from first beta ), but keeping fighting because I really want this non working SD card report being the last one ... and also because I like to fight with software bugs


Finally, I would like to thank Ralim for providing the technical information regarding this fix on Pseudo Saturn Kai. For those interested with technical (but easy to read) information, SD card access details are available on "SD cards with STM32 over SPI" article
As written above, the implementation of the fix itself is simple, but finding it in a super lengthy technical document isn't, so thank you Ralim for providing the right detail to fix for Pseudo Saturn Kai


2018/08/09 : I had a little spare time to test several SD cards from my collection, and to update this blog with test results
Globally, SD card support seems significantly better than on Pseudo Saturn Kai current official version (v6.074) : a Sandisk SD card is recognized, and other SD cards that were recognized so far are ... still recognized
Additionally, it seems that SDXC card support is OK too ... so far I tested only with only one card, and because of high capacity, write access is quite slow, so it's not recommended however.

All SD cards working so far
It's the first time I had guts to test with a SDXC card,
and fortunately it was recognized

Read more Improved SD card support !

Classified in : Saturn Tags : none
Rss feed of the articles