FLASH CRC

Test Name: FLASH Memory Test.

Purpose of test: Detect all single bit faults in FLASH memory.

Requirement ID: SW_FLASH_MEMORY_CHECKSUM_CRC_TEST_01

Acceptable Measure: Modified checksum.

Description: A cyclic redundancy check (CRC) is an error detection technique used to find accidental errors in invariable memory. This method is commonly used to determine the correctness of data transmissions and data present in FLASH memory. Test should compute a checksum of the data and store it. In order to detect errors, a new checksum is computed on the same data and compared with the previous one. If they are different, there is an error.

API Documentation: SW_FLASH_MEMORY_CHECKSUM_CRC_TEST_01 - CRC16, SW_FLASH_MEMORY_CHECKSUM_CRC_TEST_01 - CRC32

Note that the AoUs listed in the Assumption of Use section below shall be followed to ensure correct operation. The Examples section show examples of how follow some of the AoUs for different use cases and different devices.

Assumptions of Use

Table 1. Flash Section Locations. Flash Section Locations given Fuse settings Adapted from AVR128DA48 device data sheet
Case BOOTSIZE* CODESIZE** BOOT Section APPCODE Section APPDATEA Section
1 0 - 0 to FLASHEND - -
2 > 0 0 0 to BOOTEND BOOTEND to FLASHEND -
3 > 0 ≤ BOOTSIZE* 0 to BOOTEND - BOOTEND to FLASHEND
4 > 0 > BOOTSIZE* 0 to BOOTEND BOOTEND to APPEND APPEND to FLASHEND

*Fuse name may differ between device families (BOOTSIZE on AVR DA devices and BOOTEND on Tiny1 devices), but the functionality is the same.

**Fuse name may differ between device families (CODESIZE on AVR DA devices and APPEND on Tiny1 devices), but the functionality is the same.

AoU-02 and AoU-03 Examples

AVR64DA48

The AVR64DA48 has a Flash size equal to 0x10000 bytes (64 kB) and the functional description in the device data sheet under the NVMCTRL section lists a block size of 512 or 0x200 bytes. The number of blocks available in the Flash is given by dividing the Flash size by the block size, which yields:

0x10000 / 0x200 = 0x80 blocks

ATtiny1617

The ATtiny1617 has a Flash size equal to 0x4000 bytes (16 kB) and the functional description in the device data sheet under the NVMCTRL section lists a block size of 256 or 0x100 bytes. The number of blocks available in the Flash is given by dividing the Flash size by the block size, which yields:

0x4000 / 0x100 = 0x40 blocks