rusEFI
The most advanced open source ECU
|
Lower-level code related to internal flash memory.
http://www.chibios.com/forum/viewtopic.php?f=8&t=820 https://github.com/tegesoft/flash-stm32f407
Definition in file flash_int.cpp.
Functions | |
flashaddr_t | intFlashSectorBegin (flashsector_t sector) |
flashaddr_t | intFlashSectorEnd (flashsector_t sector) |
flashsector_t | intFlashSectorAt (flashaddr_t address) |
static void | intFlashClearErrors () |
static int | intFlashCheckErrors () |
static bool | intFlashUnlock (void) |
Unlock the flash memory for write access. | |
static bool | isDualBank (void) |
static int | intFlashSectorErase (flashsector_t sector) |
Erase the flash sector . | |
int | intFlashErase (flashaddr_t address, size_t size) |
Erase the sectors containing the span of size bytes starting at address . | |
bool | intFlashIsErased (flashaddr_t address, size_t size) |
Check if the size bytes of flash memory starting at address are erased. | |
bool | intFlashCompare (flashaddr_t address, const char *buffer, size_t size) |
Check if the data in buffer are identical to the one in flash memory. | |
int | intFlashRead (flashaddr_t source, char *destination, size_t size) |
Copy data from the flash memory to a destination . | |
int | intFlashWrite (flashaddr_t address, const char *buffer, size_t size) |
Copy data from a buffer to the flash memory. | |
static int | intFlashWriteData (flashaddr_t address, const flashdata_t data) |
|
static |
Definition at line 73 of file flash_int.cpp.
Referenced by intFlashSectorErase(), and intFlashWriteData().
|
static |
Definition at line 65 of file flash_int.cpp.
Referenced by intFlashSectorErase(), and intFlashWriteData().
bool intFlashCompare | ( | flashaddr_t | address, |
const char * | buffer, | ||
size_t | size | ||
) |
Check if the data in buffer
are identical to the one in flash memory.
address | First address in flash memory to be checked. |
buffer | Buffer containing the data to compare. |
size | Size of buffer in bytes. |
Definition at line 258 of file flash_int.cpp.
int intFlashErase | ( | flashaddr_t | address, |
size_t | size | ||
) |
Erase the sectors containing the span of size
bytes starting at address
.
address
doesn't match the beginning of a sector, the data contained between the beginning of the sector and address
will be erased too. The same applies for data contained at address
+ size
up to the end of the sector.address | Starting address of the span in flash memory. |
size | Size of the span in bytes. |
Definition at line 218 of file flash_int.cpp.
Referenced by backupRamFlush(), and FlashErase().
bool intFlashIsErased | ( | flashaddr_t | address, |
size_t | size | ||
) |
Check if the size
bytes of flash memory starting at address
are erased.
address | First address in flash memory to be checked. |
size | Size of the memory space to be checked in bytes. |
Definition at line 231 of file flash_int.cpp.
Referenced by FlashErase(), and FlashVerifyChecksum().
int intFlashRead | ( | flashaddr_t | source, |
char * | destination, | ||
size_t | size | ||
) |
Copy data from the flash memory to a destination
.
destination
must be at least size
bytes long. source | First address of the flash memory to be copied. |
destination | Buffer to copy to. |
size | Size of the data to be copied in bytes. |
Definition at line 279 of file flash_int.cpp.
Referenced by backupInit().
flashsector_t intFlashSectorAt | ( | flashaddr_t | address | ) |
Definition at line 58 of file flash_int.cpp.
Referenced by intFlashErase().
flashaddr_t intFlashSectorBegin | ( | flashsector_t | sector | ) |
Definition at line 45 of file flash_int.cpp.
Referenced by intFlashSectorEnd(), and intFlashSectorErase().
flashaddr_t intFlashSectorEnd | ( | flashsector_t | sector | ) |
Definition at line 54 of file flash_int.cpp.
Referenced by intFlashErase(), and intFlashSectorAt().
|
static |
Erase the flash sector
.
The sector is checked for errors after erase.
sector | Sector which is going to be erased. |
Definition at line 148 of file flash_int.cpp.
Referenced by intFlashErase().
|
static |
Unlock the flash memory for write access.
Definition at line 107 of file flash_int.cpp.
Referenced by intFlashSectorErase(), and intFlashWrite().
int intFlashWrite | ( | flashaddr_t | address, |
const char * | buffer, | ||
size_t | size | ||
) |
Copy data from a buffer
to the flash memory.
buffer
must be at least size
bytes long. address | First address in the flash memory where to copy the data to. |
buffer | Buffer containing the data to copy. |
size | Size of the data to be copied in bytes. |
Definition at line 291 of file flash_int.cpp.
Referenced by backupInit(), backupRamFlush(), and FlashWrite().
|
static |
Definition at line 345 of file flash_int.cpp.
Referenced by intFlashWrite().
|
static |
Definition at line 128 of file flash_int.cpp.
Referenced by intFlashSectorErase().