Firmware upgrade (FOTA) APIs.
More...
Firmware upgrade (FOTA) APIs.
#define SPI_FLASH_SEC_SIZE 4096 |
#define UPGRADE_FLAG_FINISH 0x02 |
flag of upgrading firmware, finish upgrading
#define UPGRADE_FLAG_IDLE 0x00 |
flag of upgrading firmware, idle
#define UPGRADE_FLAG_START 0x01 |
flag of upgrading firmware, start upgrade
#define UPGRADE_FW_BIN1 0x00 |
#define UPGRADE_FW_BIN2 0x01 |
typedef void(* upgrade_states_check_callback) (void *arg) |
Callback of upgrading firmware through WiFi.
- Parameters
-
void | * arg : information about upgrading server |
- Returns
- null
bool system_upgrade |
( |
uint8 * |
data, |
|
|
uint32 |
len |
|
) |
| |
Upgrade function de-initialization.
- Parameters
-
uint8 | *data : segment of the firmware bin data |
uint32 | len : length of the segment bin data |
- Returns
- null
void system_upgrade_deinit |
( |
| ) |
|
Upgrade function de-initialization.
- Parameters
-
- Returns
- null
uint8 system_upgrade_flag_check |
( |
| ) |
|
Check the upgrade status flag.
- Parameters
-
- Returns
- #define UPGRADE_FLAG_IDLE 0x00
-
#define UPGRADE_FLAG_START 0x01
-
#define UPGRADE_FLAG_FINISH 0x02
void system_upgrade_flag_set |
( |
uint8 |
flag | ) |
|
Set the upgrade status flag.
- Attention
- After downloading new softwares, set the flag to UPGRADE_FLAG_FINISH and call system_upgrade_reboot to reboot the system in order to run the new software.
- Parameters
-
uint8 | flag:
- UPGRADE_FLAG_IDLE 0x00
- UPGRADE_FLAG_START 0x01
- UPGRADE_FLAG_FINISH 0x02
|
- Returns
- null
void system_upgrade_init |
( |
| ) |
|
Upgrade function initialization.
- Parameters
-
- Returns
- null
void system_upgrade_reboot |
( |
void |
| ) |
|
Reboot system to use the new software.
- Parameters
-
- Returns
- null
Start upgrade firmware through WiFi with normal connection.
- Parameters
-
- Returns
- true : succeed
-
false : fail
uint8 system_upgrade_userbin_check |
( |
void |
| ) |
|
Check the user bin.
- Parameters
-
- Returns
- 0x00 : UPGRADE_FW_BIN1, i.e. user1.bin
-
0x01 : UPGRADE_FW_BIN2, i.e. user2.bin