PH-DOC / 03.2

One card, two partitions, one LUN.

The TF slot is SDMMC slot 0 in 4-bit mode at 40 MHz. The whole card is a single USB disk so UEFI firmware can boot it. Writes to the front of the card are refused unless the vendor unlocks them.

Sectors 2048 through sys−1

FAT32. Default size 4096 MiB, so sys = 2048 + 4096 × 2048 = 8,390,656 and this partition occupies sectors 2048..8390655. It holds the EFI mini-system, START-HERE collectors and the licence. Writes are refused unless UNLOCK was accepted or the build is factory mode. Our programs never write here.

A write that touches a protected sector fails with sense DATA PROTECT / WRITE PROTECTED (07/27/00). No card: NOT READY / MEDIUM NOT PRESENT (02/3A/00). Insert or remove: UNIT ATTENTION 06/28/00. Holding BOOT for 2 seconds, sending LOCK, or losing the USB bus locks the protected range again.

Why one disk

In testing, UEFI firmware based on EDK2/OVMF would not boot from a two-LUN USB device, even with both LUNs bootable. The same image on one LUN booted with Secure Boot on. The device therefore presents one disk and enforces the boundary itself, per sector.

Hosts use WRITE(10) for disks under 2 TiB. That command is checked before any byte reaches the card. WRITE(6/12/16), WRITE AND VERIFY and WRITE SAME that touch the protected range are refused with DATA PROTECT; otherwise they are reported unsupported. UNMAP, FORMAT UNIT, and COMPARE AND WRITE are refused while locked.

The bus

SDMMC pins
SignalGPIONet on the schematic
CLK43SD1_CLK
CMD44SD1_CMD
D039slot 0 data
D140slot 0 data
D241slot 0 data
D342slot 0 data
Power45SD1_PWRN, gate of an AO3401

There is no card-detect pin. The connector SWITCH is not wired to a GPIO as far as the schematic shows, so the card is probed. An absent card makes INFO report disk=0 and the disk answer NOT READY / MEDIUM NOT PRESENT (02/3A/00). The card is re-probed every second, with a power cycle through GPIO45, and polled with CMD13 when idle. Insert and remove raise UNIT ATTENTION 06/28/00.

Kconfig describes 40000 kHz as SD High Speed, a 25 MB/s bus. UHS-I would need 1.8 V signalling, which this board does not switch. MSC transfers are synchronous, in 32 KiB chunks. Throughput on a real card is on the firmware README's unverified list.

Power to the card

GPIO45 drives the AO3401 P-MOSFET that switches ESP_3V3 onto the card's VDD. A 51 kΩ pull-down means the card is powered unless software drives the pin high. Driving it low keeps the card on. The IO bank for GPIO39–48, and the 51 kΩ pull-ups on the SD lines, are fed by on-chip LDO channel 4 (LDO_VO4), which the driver sets to 3.3 V. Whether that LDO is already at 3.3 V before the driver starts is not verified.

A card smaller than sys + 64 MiB is refused with the text “SD card too small”. The default system partition is 4096 MiB, which the Kconfig help spells out as 8,388,608 sectors and a protected range of 8,390,656 sectors (the extra 2048 sectors are the MBR and the gap). The 128 GB figure in the firmware README is an example, not a required size. INFO reports the real sector count.