# CARD_WriteFlashSector

## Syntax

  `#include <nitro/card.h>`
  `BOOL CARD_WriteFlashSector(u32 dst, const void *src, u32 len);`

## Arguments

dst | The flash memory address of the transfer destination. This must be an integer multiple of the value obtained by the `CARD_GetBackupSectorSize` function. For more about the sector size for each device, see Overview.
src | Transfer source memory address.
len | Byte length of the data to be written. This must be an integer multiple of the value obtained by the `CARD_GetBackupSectorSize` function. For more about the sector size for each device, see Overview.

## Return Values

TRUE if the process succeeds. FALSE otherwise.

## Description

Writes data to a FLASH device at the sector level.
The function does not return control until it has finished processing. It returns TRUE if the process was successful or FALSE if it failed. To get the detailed result value when processing fails, call the `CARD_GetResultCode` function.

This function simply calls a combination of the `CARD_EraseFlashSector` and `CARD_ProgramFlash` functions internally. For more information, see the function references for these functions.

To use this function, you must first lock the access bus with the `CARD_LockBackup` function.

This function communicates with the ARM7 processor internally via PXI.
The process will not end if PXI interrupts are not enabled.

## See Also

`CARD_GetResultCode, CARD_IsBackupFlash, CARD_ProgramFlash, CARD_ProgramFlashAsync, CARD_ProgramAndVerifyFlash, CARD_ProgramAndVerifyFlashAsync, CARD_EraseFlashSector, CARD_EraseFlashSectorAsync, CARD_WriteFlashSector, CARD_WriteFlashSectorAsync, CARD_WriteAndVerifyFlashSector, CARD_WriteAndVerifyFlashSectorAsync, CARD_ReadFlash, CARD_WriteFlash, CARD_VerifyFlash`

## Revision History

2007/08/22 Initial version.

CONFIDENTIAL