Flash Copier Function Documentation
Sys_Flash_Copy
void Sys_Flash_Copy(FLASH_Type * flash, uint32_t src_addr, uint32_t dest_addr, uint32_t length, uint32_t cpy_dest)
Location: flash_copier.h:54
Assumptions
src_addr points to an address in flash memory dest_addr points to an address in RAM memory The flash copy does not need to be complete before returning If CRC is selected as the destination, dest_addr is ignored and 32-bit copy mode is selected automatically.
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
flash |
Pointer to the flash instance |
|
in |
src_addr |
Source address in flash to copy data from |
|
in |
dest_addr |
Destination address in RAM to copy data to |
|
in |
length |
Number of words to copy |
|
in |
cpy_dest |
Destination copier is CRC or memories; use COPY_TO_[CRC | MEM], and COPY_TO_[32 | 40]_BIT |
Sys_Flash_Compare
uint32_t Sys_Flash_Compare(FLASH_Type * flash, uint32_t cfg, uint32_t addr, uint32_t length, uint32_t value, uint32_t value_ecc)
Location: flash_copier.h:74
Returns:
Assumptions
addr points to an address in flash memory
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
flash |
Pointer to the flash instance |
|
in |
cfg |
Flash comparator configuration; use COMP_MODE_[CONSTANT | CHBK]_BYTE, COMP_ADDR_[DOWN | UP]_BYTE, and COMP_ADDR_STEP_*_BYTE |
|
in |
addr |
Base address of the area to verify |
|
in |
length |
Number of words to verify |
|
in |
value |
Value that the words read from flash will be compared against |
|
in |
value_ecc |
Value that the error-correction coding bits from the extended words read from flash will be compared against |
Sys_Flash_CalculateCRC
uint32_t Sys_Flash_CalculateCRC(FLASH_Type * flash, uint32_t addr, uint32_t length, uint32_t * crc)
Location: flash_copier.h:88
Returns:
NOTE: Flash copier and CRC register are modified
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
flash |
Flash instance being used |
|
in |
addr |
Address belonging to the flash instance |
|
in |
length |
Total number of words used in CRC calculation |
|
out |
crc |
CRC value calculated using CRC peripheral |