Application bootloader and generic EEPROM Interface.
|
struct | HalEepromInformationType |
| This structure defines a variety of information about the attached external EEPROM device.
|
|
void | bootloaderInit () |
| Drives the app bootloader. If the ::runRecovery parameter is ::true, the recovery mode should be activated, otherwise it should attempt to install an image. This function should not return. It should always exit by resetting the the bootloader.
|
|
void | bootloaderInitCustom () |
| Drives the app bootloader. If the ::runRecovery parameter is ::true, the recovery mode should be activated, otherwise it should attempt to install an image. This function should not return. It should always exit by resetting the the bootloader.
|
|
void | bootloaderAction (bool runRecovery) |
| Drives the app bootloader. If the ::runRecovery parameter is ::true, the recovery mode should be activated, otherwise it should attempt to install an image. This function should not return. It should always exit by resetting the the bootloader.
|
The file bootloader-eeprom.h
defines generic EEPROM parameters.
Changing EEPROM size will change the size of the application image space without changing the size or relative location of the recovery and reserved sections. See eeprom.c for more information on modifying EEPROM functionality.
See bootloader-eeprom.h
for source code.
See app-bootloader.h
for source code.
#define EEPROM_CAPABILITIES_BLOCKING_ERASE (0x0008U) |
#define EEPROM_CAPABILITIES_BLOCKING_WRITE (0x0004U) |
#define EEPROM_CAPABILITIES_ERASE_SUPPORTED (0x0001U) |
#define EEPROM_CAPABILITIES_PAGE_ERASE_REQD (0x0002U) |
#define EEPROM_CAPABILITIES_PART_ERASE_SECONDS (0x0010U) |
#define EEPROM_ERR_ADDR 0x85U |
#define EEPROM_ERR_ERASE_REQUIRED 0x87U |
#define EEPROM_ERR_IMG_SZ 0x84U |
#define EEPROM_ERR_INVALID_CHIP 0x86U |
#define EEPROM_ERR_MASK 0x80U |
#define EEPROM_ERR_NO_ERASE_SUPPORT 0x88U |
#define EEPROM_ERR_PG_BOUNDARY 0x81U |
#define EEPROM_ERR_PG_SZ 0x82U |
#define EEPROM_ERR_WRT_DATA 0x83U |
#define EEPROM_FIRST_PAGE (0) |
#define EEPROM_INFO_MAJOR_VERSION (0x0200) |
#define EEPROM_INFO_MAJOR_VERSION_MASK (0xFF00) |
#define EEPROM_INFO_MIN_VERSION_WITH_WORD_SIZE_SUPPORT 0x0102U |
#define EEPROM_INFO_VERSION (0x0202) |
#define EEPROM_PAGE_SIZE (128ul) |
#define EEPROM_SUCCESS 0U |
void bootloaderAction |
( |
bool |
runRecovery | ) |
|
- Parameters
-
runRecovery | If ::true, recover mode is activated. Otherwise, normal image installation is activated. |
- Parameters
-
runRecovery | If ::true, recover mode is activated. Otherwise, normal image installation is activated. |
void bootloaderInitCustom |
( |
| ) |
|
- Parameters
-
runRecovery | If ::true, recover mode is activated. Otherwise, normal image installation is activated. |
bool halEepromBusy |
( |
void |
| ) |
|
The format of this call must not be altered. However, the content can be changed to work with a different device.
- Returns
- true if still busy or false if not.
uint8_t halEepromErase |
( |
uint32_t |
address, |
|
|
uint32_t |
totalLength |
|
) |
| |
The format of this call must not be altered. However, the content can be changed to work with a different device. Note: Most devices require the specified region to be page aligned, and will return an error if an unaligned region is specified. Note: Many devices take an extremely long time to perform an erase operation. When erasing a large region, it may be preferable to make multiple calls to this API so that other application functionality can be performed while the erase is in progress. The halEepromBusy() API may be used to determine when the last erase operation has completed. Erase timing information can be found in the HalEepromInformationType structure.
- Parameters
-
address | Address to start erasing |
len | Length of the region to be erased |
- Returns
- EEPROM_SUCCESS or EEPROM_ERR.
The format of this call must not be altered. However, the content can be changed to work with a different device.
- Returns
- A pointer to a HalEepromInformationType data structure, or NULL if the driver does not support this API
uint8_t halEepromInit |
( |
void |
| ) |
|
uint8_t halEepromRead |
( |
uint32_t |
address, |
|
|
uint8_t * |
data, |
|
|
uint16_t |
len |
|
) |
| |
This is the standard external EEPROM read function. The format of this call must not be altered. However, the content can be changed to work with a different device. Note: Not all storage implementations support accesses that are not page aligned, refer to the HalEepromInformationType structure for more information.
- Parameters
-
address | The address to start reading from. |
data | A pointer to where read data is stored. |
len | The length of data to read. |
- Returns
- EEPROM_SUCCESS or EEPROM_ERR
void halEepromShutdown |
( |
void |
| ) |
|
uint32_t halEepromSize |
( |
void |
| ) |
|
The format of this call must not be altered. However, the content can be changed to work with a different device. Internal use only. No exposure to application
- Returns
- int32_t size
uint8_t halEepromWrite |
( |
uint32_t |
address, |
|
|
const uint8_t * |
data, |
|
|
uint16_t |
len |
|
) |
| |
This is the standard external EEPROM write function. The format of this call must not be altered. However, the content can be changed to work with a different device. Note: Not all storage implementations support accesses that are not page aligned, refer to the HalEepromInformationType structure for more information. Note: Some storage devices require contents to be erased before new data can be written, and will return an EEPROM_ERR_ERASE_REQUIRED error if write is called on a location that is not already erased. Refer to the HalEepromInformationType structure to see if the attached storage device requires erasing.
- Parameters
-
address | The address to start writing to. |
data | A pointer to the data to write. |
len | The length of data to write. |
- Returns
- EEPROM_SUCCESS or EEPROM_ERR
- Parameters
-
install | If ::false, it will simply validate the image without touching main flash. If ::true, the image will be programmed to main flash. |
- Returns
- BL_SUCCESS if an image was successfully installed/validated
- Returns
- BL_SUCCESS if an image was successfully received.