mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04:00
[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:
@@ -7,6 +7,7 @@ import os
|
||||
|
||||
from flipper.app import App
|
||||
from flipper.cube import CubeProgrammer
|
||||
from flipper.assets.coprobin import CoproBinary
|
||||
|
||||
STATEMENT = "AGREE_TO_LOSE_FLIPPER_FEATURES_THAT_USE_CRYPTO_ENCLAVE"
|
||||
|
||||
@@ -68,10 +69,15 @@ class Main(App):
|
||||
)
|
||||
self._addArgsSWD(self.parser_core2radio)
|
||||
self.parser_core2radio.add_argument(
|
||||
"radio_address", type=str, help="Radio Stack Binary Address"
|
||||
"radio", type=str, help="Radio Stack Binary"
|
||||
)
|
||||
self.parser_core2radio.add_argument(
|
||||
"radio", type=str, help="Radio Stack Binary"
|
||||
"--addr",
|
||||
dest="radio_address",
|
||||
help="Radio Stack Binary Address, as per release_notes",
|
||||
type=lambda x: int(x, 16),
|
||||
default=0,
|
||||
required=False,
|
||||
)
|
||||
self.parser_core2radio.set_defaults(func=self.core2radio)
|
||||
|
||||
@@ -144,14 +150,27 @@ class Main(App):
|
||||
return 0
|
||||
|
||||
def core2radio(self):
|
||||
if int(self.args.radio_address, 16) > 0x080E0000:
|
||||
stack_info = CoproBinary(self.args.radio)
|
||||
if not stack_info.is_stack():
|
||||
self.logger.error("Not a Radio Stack")
|
||||
return 1
|
||||
self.logger.info(f"Will flash {stack_info.img_sig.get_version()}")
|
||||
|
||||
radio_address = self.args.radio_address
|
||||
if not radio_address:
|
||||
radio_address = stack_info.get_flash_load_addr()
|
||||
self.logger.warning(
|
||||
f"Radio address not provided, guessed as 0x{radio_address:X}"
|
||||
)
|
||||
if radio_address > 0x080E0000:
|
||||
self.logger.error(f"I KNOW WHAT YOU DID LAST SUMMER")
|
||||
return 1
|
||||
|
||||
cp = CubeProgrammer(self._getCubeParams())
|
||||
self.logger.info(f"Removing Current Radio Stack")
|
||||
cp.deleteCore2RadioStack()
|
||||
self.logger.info(f"Flashing Radio Stack")
|
||||
cp.flashCore2(self.args.radio_address, self.args.radio)
|
||||
cp.flashCore2(radio_address, self.args.radio)
|
||||
self.logger.info(f"Complete")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user