P2 SD Wrangling Tools
Tubular
Posts: 4,754
I'm developing a P2 product that I hope can just work from an SD card, without the boot flash. Turns out there's a bit of work involved in getting all this to be nice and reliable.
Windows 10's formatter only offers exFAT for SD cards above 32 GB, so I thought I'd start a thread to cover SD wrangling tools people use to get by. Of course many cards already come in FAT32 out of the packet, but I've found sometimes a reformat is necessary to restore things.
Feel free to chime in with tools you've used (eg with rasp Pi), and what their caveats are. I'm curious what people on Mac/Linux use
SD Card Formatting
* Taqoz - P2! - Peter's extended Taqoz has a FAT32 formatter.
* "Format" - Windows 10) - Right click on drive from in explorer etc. 32 GB cards are the biggest it'll format with FAT32
* GUIFORMAT - Windows - runs under windows without installation. Also known as Fat32format?
* SD formatter - Windows/Mac - recommended to me by Jeff Martin. Sandisk/SD Association tool.
SD Image Burning
* Win32DiskImager - Windows - Used with Rasp Pi images. Whole drive image so takes a while to run. Don't like the proximity of 'device' to the image filename, could potentially confuse drives
Windows 10's formatter only offers exFAT for SD cards above 32 GB, so I thought I'd start a thread to cover SD wrangling tools people use to get by. Of course many cards already come in FAT32 out of the packet, but I've found sometimes a reformat is necessary to restore things.
Feel free to chime in with tools you've used (eg with rasp Pi), and what their caveats are. I'm curious what people on Mac/Linux use
SD Card Formatting
* Taqoz - P2! - Peter's extended Taqoz has a FAT32 formatter.
* "Format" - Windows 10) - Right click on drive from in explorer etc. 32 GB cards are the biggest it'll format with FAT32
* GUIFORMAT - Windows - runs under windows without installation. Also known as Fat32format?
* SD formatter - Windows/Mac - recommended to me by Jeff Martin. Sandisk/SD Association tool.
SD Image Burning
* Win32DiskImager - Windows - Used with Rasp Pi images. Whole drive image so takes a while to run. Don't like the proximity of 'device' to the image filename, could potentially confuse drives

Comments
TAQOZ has the FAT32 formatter which I have tested on cards up to 128GB (so far) and can specify the cluster size etc. You can even format just one part such as the MBR for instance which has pulled me out of a sticky jam a few times already. Also as part of the formatter it includes disk tools that can not only report details about the card, but also run tests and handle the card as one great big memory chip for the first 4GB, or as a sector device, or individual files as virtual memory up to 4GB which can be handled as any other memory (read, write, dump, list etc).
Here is a terminal dump where I format a 64GB card, first without permissions, and then with read/write/system permissions after which I dump the first sector as if it were an open file, manipulate it and dump it again.
TAQOZ# FORMAT --- FAILED! ok TAQOZ# --- ok TAQOZ# RWS FORMAT --- CARD: SANDISK SD SC64G REV$80 #38874969 DATE:2019/8 CARD: SANDISK SD SC64G REV$80 #38874969 DATE:2019/8 *** OCR *** VALUE........................... $C0FF_8000 RANGE........................... 2.7V to 3.6V *** CSD *** CARD TYPE....................... SDHC LATENCY......................... 1ms+1400 clocks SPEED........................... 50MHz CLASSES......................... 010110110101 BLKLEN.......................... 512 SIZE............................ 62,367MB Iread Vmin...................... 10ma Iread Vmax...................... 25ma Iwrite Vmin..................... 60ma Iwrite Vmax..................... 35ma *** SPEEDS *** LATENCY......................... 446us,131us,131us,131us,132us,130us,131us,131us, SECTOR.......................... 355us,287us,287us,286us,287us,287us,286us,287us, BLOCKS.......................... 3,148kB/s @300MHz *** MBR *** PARTITION....................... 0 00 INACTIVE FILE SYSTEM..................... FAT32 LBA CHS START....................... 1023,254,63 CHS END......................... 0,0,0 FIRST SECTOR.................... $0000_8000 TOTAL SECTORS................... 124,702,720 = 63,847MB 00170: 0000_0000 0000_0000 0000_0000 0000_0000 '................' *** FAT32 *** OEM............................. TAQOZ P2 Byte/Sect....................... 512 Sect/Clust...................... 128 = 65MB FATs............................ 2 Media........................... F8 Sect/Track...................... $003F Heads........................... $00FF Hidden Sectors.................. 32,768 = 16MB Sect/Part....................... 124,702,720 = 63,847MB Sect/FAT........................ 7,611 = 3MB Flags........................... 0 Ver............................. 00 00 ROOT Cluster.................... $0000_0002 SECTOR: $0000_BB96 INFO Sector..................... $0001 = $0000_8001 Backup Sector................... $0006 = $0000_8006 res............................. 00 00 00 00 00 00 00 00 00 00 00 00 Drive#.......................... 128 Ext sig......................... $29 OK! Part Serial#.................... $6269_0201 #1651048961 Volume Name..................... P2 CARD FAT32 ok TAQOZ# 0 OPEN-SECTOR --- ok TAQOZ# 0 $200 SD DUMP --- 00000: 64 12 80 FD 50 32 44 32 72 33 20 20 03 00 00 00 'd...P2D2r3 ....' 00010: 00 2D 31 01 00 A3 E1 11 FB 0E 00 01 00 C2 01 00 '.-1.............' 00020: 30 31 32 33 34 00 00 00 4C 0C 00 00 00 F8 E6 11 '01234...L.......' 00030: 35 36 00 00 C4 04 00 00 34 22 00 00 F2 22 00 00 '56......4"..."..' 00040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00050: 00 00 00 00 00 00 00 00 00 00 00 00 8C 00 8C 00 '................' 00060: 0D 00 78 7B 00 00 00 00 00 00 00 00 00 00 00 00 '..x{............' 00070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 000A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 000B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 000C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 000D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 000E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 000F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 00190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 001A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 001B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE '................' 001C0: FF FF 0C 00 00 00 00 80 00 00 00 D0 6E 07 00 00 '............n...' 001D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 001E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '................' 001F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA '..............U.' ok TAQOZ# " HELLO WORLD" $100 SDADR $! FLUSH --- ok TAQOZ# 0 $200 SD DUMPAW --- 00000: d...P2D2r3 .....-1.............01234...L.......56......4"..."....................................x{............................ 00080: ................................................................................................................................ 00100: HELLO WORLD..................................................................................................................... 00180: ............................................................................n.................................................U. ok TAQOZ#btw, that funny little operation that I did to write a string could just as easily have had function for it with: The SDADR! also marks the sector as having been written to so there is no need to specifically flush it as it will be done automatically if needed.
Forgive the long listing, I had to chop out (~~~) whole sections just to keep the forum happy:
BTW the ROM will try to load"_BOOT_P2.BIX" and if not found, it will try "_BOOT_P2.BIY"
Of course it will try sector 0, then the VOL sector first, looking for the signature to load.
The Sector 0 mechanism works for exFAT formatted SD cards.
There has been a bit of movement on exFAT recently. They published the spec and opened it up to some
https://www.zdnet.com/article/microsoft-readies-exfat-patents-for-linux-and-open-source/
https://rufus.ie/
Definitely one of the best SD Burners I've used, and handles FAT filesystem generation parameters very well.