# CTRDG_WriteAndVerifyAgbSramAsync

## Syntax

      #include <nitro/ctrdg.h>

      void CTRDG_WriteAndVerifyAgbSramAsync(u32 dst, const void* src, u32 size, CTRDG_TASK_FUNC callback);

## Arguments

dst | Destination SRAM address (address on the AGB memory map).
src | Source work area address.
size | Size of data written and verified in bytes
callback | Callback function called when WriteAndVerify processing ends

## Return Values

None.

## Description

Internally, after data is asynchronously written by `CTRDG_WriteAgbSram`, verification is asynchronously performed by `CTRDG_VerifyAgbSram`. If there is an error, the function retries up to the number of times specified by `CTRDG_AGB_SRAM_RETRY_MAX` (defined in `AgbSram.h`). To find out whether the WriteAndVerify process succeeded, access the result member of the `CTRDGTaskInfo` structure used as an argument to the callback function that returns after this function is called. It returns zero if the WriteAndVerify process succeeded, a nonzero value if the process failed, and the error address on the device side if there was a verification error.

The access cycle setting is created in the function and does not need to be set in advance.

Note: The cartridge bus is locked for a set period by this function.
Note that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.

## See Also

`CTRDG_WriteAgbSram`
`CTRDG_VerifyAgbSram`
`CTRDG_WriteAndVerifyAgbSram`

## Revision History

2006/05/25 Added a description that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.
2006/04/07 Initial version.

CONFIDENTIAL