[FL-2269] Core2 OTA (#1144)

* C2OTA: wip
* Update Cube to 1.13.3
* Fixed prio
* Functional Core2 updater
* Removed hardware CRC usage; code cleanup & linter fixes
* Moved hardcoded stack params to copro.mk
* Fixing CI bundling of core2 fw
* Removed last traces of hardcoded radio stack
* OB processing draft
* Python scripts cleanup
* Support for comments in ob data
* Sacrificed SD card icon in favor of faster update. Waiting for Storage fix
* Additional handling for OB mismatched values
* Description for new furi_hal apis; spelling fixes
* Rework of OB write, WIP
* Properly restarting OB verification loop
* Split update_task_workers.c
* Checking OBs after enabling post-update mode
* Moved OB verification before flashing
* Removed ob.data for custom stacks
* Fixed progress calculation for OB
* Removed unnecessary OB mask cast

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
hedger
2022-04-27 18:53:48 +03:00
committed by GitHub
parent 81aeda86db
commit 7ce305fca3
41 changed files with 1622 additions and 295 deletions

View File

@@ -7,7 +7,8 @@
#include <flipper_format/flipper_format.h>
#include <update_util/update_manifest.h>
#include <lib/toolbox/path.h>
#include <toolbox/path.h>
#include <toolbox/crc32_calc.h>
static FATFS* pfs = NULL;
@@ -27,7 +28,6 @@ static bool flipper_update_init() {
furi_hal_delay_init();
furi_hal_spi_init();
furi_hal_crc_init(false);
MX_FATFS_Init();
if(!hal_sd_detect()) {
@@ -62,17 +62,15 @@ static bool flipper_update_load_stage(const string_t work_dir, UpdateManifest* m
uint32_t bytes_read = 0;
const uint16_t MAX_READ = 0xFFFF;
furi_hal_crc_reset();
uint32_t crc = 0;
do {
uint16_t size_read = 0;
if(f_read(&file, img + bytes_read, MAX_READ, &size_read) != FR_OK) {
break;
}
crc = furi_hal_crc_feed(img + bytes_read, size_read);
crc = crc32_calc_buffer(crc, img + bytes_read, size_read);
bytes_read += size_read;
} while(bytes_read == MAX_READ);
furi_hal_crc_reset();
do {
if((bytes_read != stat.fsize) || (crc != manifest->staged_loader_crc)) {