# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- File I/O Library

- 1
- 2
…
- 71
- 72
- 73
- 74
- 75
…
- 82
- 83

Some cards will not support this command. a. If illegal command response is received, this implies either a v1.x physical
spec device, or not an SD card (ex: MMC). b. If normal response is received, then it must be a v2.0 or later SD memory
card.
If v1.x device:
---------------
3. Send CMD1 repeatedly, until initialization complete (indicated by R1 response uint8_t/idle bit == 0)
4. Basic initialization is complete. May now switch to higher SPI frequencies.
5. Send CMD9 to read the CSD structure. This will tell us the total flash size and other info which will be useful later.
6. Parse CSD structure bits (based on v1.x structure format) and extract useful information about the media.
7. The card is now ready to perform application data transfers.
If v2.0+ device:
---------------
3. Verify the voltage range is feasible. If not, unusable card, should notify user that the card is incompatible with this host.
4. Send CMD58 (Read OCR).
5. Send CMD55, then ACMD41 (SD_SEND_OP_COND, with HCS = 1). a. Loop CMD55/ACMD41 until R1 response uint8_t
== 0x00 (indicating the card is no longer busy/no longer in idle state).
6. Send CMD58 (Get CCS). a. If CCS = 1 --> SDHC card. b. If CCS = 0 --> Standard capacity SD card (which is v2.0+).
7. Basic initialization is complete. May now switch to higher SPI frequencies.
8. Send CMD9 to read the CSD structure. This will tell us the total flash size and other info which will be useful later.
9. Parse CSD structure bits (based on v2.0 structure format) and extract useful information about the media.
10. The card is now ready to perform application data transfers.
Preconditions
The FILEIO_SD_MediaInitialize function pointer must be pointing to this function.
Parameters
Parameters Description
config An SD Drive configuration structure pointer
Return Values
Return Values Description
errorCode member may contain the following values
• MEDIA_NO_ERROR - The media initialized successfully
• MEDIA_CANNOT_INITIALIZE - Cannot initialize the
media.
Function
FILEIO_MEDIA_INFORMATION * FILEIO_SD_MediaInitialize (void)
1.7.2.1.5 FILEIO_SD_MediaDeinitialize Function
Disables the SD card
File
sd_spi.h
Syntax
bool FILEIO_SD_MediaDeinitialize(FILEIO_SD_DRIVE_CONFIG * config);
1.7 Library Interface MLA - File I/O Library Help Physical Layer
73

- 1
- 2
…
- 71
- 72
- 73
- 74
- 75
…
- 82
- 83