FT800 Series Programmer Guide
Version 2.1
Document Reference No.: BRT_000030 Clearance No.: BRT#037
166
Copyright © Bridgetek Limited
5.21
CMD_MEMCRC - compute a CRC-32 for memory
Computes a CRC-32 for a block of FT800 memory
C prototype
void cmd_memcrc( uint32_t ptr,
uint32_t num,
uint32_t result );
Parameters
ptr
Starting address of the memory block
num
Number of bytes in the source memory block
result
Output parameter; written with the CRC-32 after command execution. The
completion of this function is detected when the value of REG_CMD_READ is
equal to REG_CMD_WRITE.
Command layout
+0
CMD_MEMCRC(0xffffff18)
+4
Ptr
+8
Num
+12
Result
Examples
To compute the CRC-32 of the first 1K byte of FT800 memory, first record the value
of REG_CMD_WRITE, execute the command, wait for completion, then read the 32-
bit value at result:
uint16_t x = rd16(REG_CMD_WRITE);
cmd_crc(0, 1024, 0);
...
printf("%08x\n", rd32(R x + 12));