The backup device is connected to the SPI bus in a Nintendo DS card. By conducting serial communications of commands through the IO register, operations such as state checks and data transfer are performed. The type and limitations of the commands prepared depend on the device type and size, but there are features as listed below that are generally shared.
Device Types
The following are the main backup device types and their features supported by the current CARD library.
| Device Types | Features |
| EEPROM | Standard feature, a relatively small amount of memory. |
| FLASH | Memory with large capacity but comparatively slow writing speed. For particularly large-capacity flash memory devices, the process of rewriting data can be somewhat complicated. |
There is no way to automatically determine which type of backup device is loaded in the DS Card, so an application needs to be aware of the device type that it will use and explicitly specify it with the CARD_IdentifyBackup function before any function call to backup access functions. You must make sure that ROM header information is determined in advance, as indicated in the guidelines, to prevent problems such as data being destroyed by carelessly accessing a DS card that has not been defined in detail. This is especially important for applications that will be executed by something other than the DS card, as in Single-Card Play. Under those conditions, restrictions in the CARD library are applied automatically, and the card cannot be accessed as long as the CARD_Enable function is not called. The ROM header information for the inserted DS Card can be referenced with the CARD_GetRomHeader function.
As mentioned above, different types of flash devices can use different types of commands and have different restrictions. In particular, the Write command that performs a simple rewrite operation cannot be used with flash memory devices above a certain capacity. To perform a rewrite operation on such devices, you must use a combination of the EraseSector operation to erase data at the sector level, and the Program operation to write data to sectors after they have been erased.
The table below lists currently supported devices and their operating characteristics.
| Device Types | EEPROM | FLASH | ||||||
| Size | 4 KB | 64 KB | 512 KB | 2 MB | 4 MB | 8 MB | 16 MB | 64 MB |
| Page Size | (Total Capacity) | 256 B | ||||||
| Sector Size | (Total Capacity) | 65536 B | ||||||
| Write (a direct write operation that does not require erasing) | O | O | X | |||||
| Program (a write operation that takes place after erasures) | X | O | ||||||
| EraseSector (the sector-erase operation) | X | O | ||||||
Flow of Access functions
This is an explanation of the flow of operations after backup access functions are called.
CARD_CancelBackupAsync function. Because things such as memory copy in the operations to wait for completion and a new execution request sometimes take a long time, they are mounted by an internal thread in the CARD library instead of with the PXI interrupt handler.
CARD_GetResultCode function as a CARDResult enumerated type.
2008/11/27 Deleted CARD_BACKUP_TYPE_FRAM_256KBITS from the lineup of usable types.
2007/08/22 Added explanation about large-capacity flash devices and a table showing their characteristics.
2006/01/01 Initial version.
CONFIDENTIAL