[FL-1990] Correct release type in copro manifest and rename boot to bootloader (#787)
* World: rename boot to bootloader. * Scripts: correct release type in copro bundler.
This commit is contained in:
parent
d9d33a0213
commit
ae016ce464
@ -129,11 +129,11 @@ static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage*
|
||||
return result;
|
||||
}
|
||||
|
||||
static DialogMessageButton boot_version_screen(DialogsApp* dialogs, DialogMessage* message) {
|
||||
static DialogMessageButton bootloader_version_screen(DialogsApp* dialogs, DialogMessage* message) {
|
||||
DialogMessageButton result;
|
||||
string_t buffer;
|
||||
string_init(buffer);
|
||||
const Version* ver = furi_hal_version_get_boot_version();
|
||||
const Version* ver = furi_hal_version_get_bootloader_version();
|
||||
|
||||
if(!ver) {
|
||||
string_cat_printf(buffer, "No info\n");
|
||||
@ -167,7 +167,7 @@ const AboutDialogScreen about_screens[] = {
|
||||
icon2_screen,
|
||||
hw_version_screen,
|
||||
fw_version_screen,
|
||||
boot_version_screen};
|
||||
bootloader_version_screen};
|
||||
|
||||
const size_t about_screens_count = sizeof(about_screens) / sizeof(AboutDialogScreen);
|
||||
|
||||
|
@ -56,7 +56,7 @@ static const uint8_t enclave_signature_expected[ENCLAVE_SIGNATURE_KEY_SLOTS][ENC
|
||||
*/
|
||||
void cli_command_device_info(Cli* cli, string_t args, void* context) {
|
||||
// Device Info version
|
||||
printf("device_info_major : %d\r\n", 1);
|
||||
printf("device_info_major : %d\r\n", 2);
|
||||
printf("device_info_minor : %d\r\n", 0);
|
||||
// Model name
|
||||
printf("hardware_model : %s\r\n", furi_hal_version_get_model_name());
|
||||
@ -89,14 +89,14 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) {
|
||||
}
|
||||
|
||||
// Bootloader Version
|
||||
const Version* boot_version = furi_hal_version_get_boot_version();
|
||||
if(boot_version) {
|
||||
printf("boot_commit : %s\r\n", version_get_githash(boot_version));
|
||||
printf("boot_branch : %s\r\n", version_get_gitbranch(boot_version));
|
||||
printf("boot_branch_num : %s\r\n", version_get_gitbranchnum(boot_version));
|
||||
printf("boot_version : %s\r\n", version_get_version(boot_version));
|
||||
printf("boot_build_date : %s\r\n", version_get_builddate(boot_version));
|
||||
printf("boot_target : %d\r\n", version_get_target(boot_version));
|
||||
const Version* bootloader_version = furi_hal_version_get_bootloader_version();
|
||||
if(bootloader_version) {
|
||||
printf("bootloader_commit : %s\r\n", version_get_githash(bootloader_version));
|
||||
printf("bootloader_branch : %s\r\n", version_get_gitbranch(bootloader_version));
|
||||
printf("bootloader_branch_num : %s\r\n", version_get_gitbranchnum(bootloader_version));
|
||||
printf("bootloader_version : %s\r\n", version_get_version(bootloader_version));
|
||||
printf("bootloader_build_date : %s\r\n", version_get_builddate(bootloader_version));
|
||||
printf("bootloader_target : %d\r\n", version_get_target(bootloader_version));
|
||||
}
|
||||
|
||||
// Firmware version
|
||||
|
@ -42,7 +42,7 @@ void desktop_debug_render(Canvas* canvas, void* model) {
|
||||
my_name ? my_name : "Unknown");
|
||||
canvas_draw_str(canvas, 5, 23, buffer);
|
||||
|
||||
ver = m->screen == DesktopViewStatsBoot ? furi_hal_version_get_boot_version() :
|
||||
ver = m->screen == DesktopViewStatsBoot ? furi_hal_version_get_bootloader_version() :
|
||||
furi_hal_version_get_firmware_version();
|
||||
|
||||
if(!ver) {
|
||||
|
@ -23,7 +23,7 @@ void power_cli_factory_reset(Cli* cli, string_t args, void* context) {
|
||||
char c = cli_getc(cli);
|
||||
if(c == 'y' || c == 'Y') {
|
||||
printf("Data will be wiped after reboot.\r\n");
|
||||
furi_hal_boot_set_flags(FuriHalBootFlagFactoryReset);
|
||||
furi_hal_bootloader_set_flags(FuriHalBootloaderFlagFactoryReset);
|
||||
power_reboot(PowerBootModeNormal);
|
||||
} else {
|
||||
printf("Safe choice.\r\n");
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "power_i.h"
|
||||
#include <furi.h>
|
||||
#include "furi-hal-power.h"
|
||||
#include "furi-hal-boot.h"
|
||||
#include "furi-hal-bootloader.h"
|
||||
|
||||
void power_off(Power* power) {
|
||||
furi_hal_power_off();
|
||||
@ -14,9 +14,9 @@ void power_off(Power* power) {
|
||||
|
||||
void power_reboot(PowerBootMode mode) {
|
||||
if(mode == PowerBootModeNormal) {
|
||||
furi_hal_boot_set_mode(FuriHalBootModeNormal);
|
||||
furi_hal_bootloader_set_mode(FuriHalBootloaderModeNormal);
|
||||
} else if(mode == PowerBootModeDfu) {
|
||||
furi_hal_boot_set_mode(FuriHalBootModeDFU);
|
||||
furi_hal_bootloader_set_mode(FuriHalBootloaderModeDFU);
|
||||
}
|
||||
furi_hal_power_reset();
|
||||
}
|
||||
|
@ -163,15 +163,15 @@ static LFSData* storage_int_lfs_data_alloc() {
|
||||
|
||||
static void storage_int_lfs_mount(LFSData* lfs_data, StorageData* storage) {
|
||||
int err;
|
||||
FuriHalBootFlag boot_flags = furi_hal_boot_get_flags();
|
||||
FuriHalBootloaderFlag bootloader_flags = furi_hal_bootloader_get_flags();
|
||||
lfs_t* lfs = &lfs_data->lfs;
|
||||
|
||||
if(boot_flags & FuriHalBootFlagFactoryReset) {
|
||||
if(bootloader_flags & FuriHalBootloaderFlagFactoryReset) {
|
||||
// Factory reset
|
||||
err = lfs_format(lfs, &lfs_data->config);
|
||||
if(err == 0) {
|
||||
FURI_LOG_I(TAG, "Factory reset: Format successful, trying to mount");
|
||||
furi_hal_boot_set_flags(boot_flags & ~FuriHalBootFlagFactoryReset);
|
||||
furi_hal_bootloader_set_flags(bootloader_flags & ~FuriHalBootloaderFlagFactoryReset);
|
||||
err = lfs_mount(lfs, &lfs_data->config);
|
||||
if(err == 0) {
|
||||
FURI_LOG_I(TAG, "Factory reset: Mounted");
|
||||
|
@ -272,7 +272,7 @@ const struct Version* furi_hal_version_get_firmware_version(void) {
|
||||
return version_get();
|
||||
}
|
||||
|
||||
const struct Version* furi_hal_version_get_boot_version(void) {
|
||||
const struct Version* furi_hal_version_get_bootloader_version(void) {
|
||||
#ifdef NO_BOOTLOADER
|
||||
return 0;
|
||||
#else
|
||||
|
@ -272,7 +272,7 @@ const struct Version* furi_hal_version_get_firmware_version(void) {
|
||||
return version_get();
|
||||
}
|
||||
|
||||
const struct Version* furi_hal_version_get_boot_version(void) {
|
||||
const struct Version* furi_hal_version_get_bootloader_version(void) {
|
||||
#ifdef NO_BOOTLOADER
|
||||
return 0;
|
||||
#else
|
||||
|
@ -148,7 +148,7 @@ const uint8_t* furi_hal_version_get_ble_mac();
|
||||
*
|
||||
* @return Address of boot version structure.
|
||||
*/
|
||||
const struct Version* furi_hal_version_get_boot_version();
|
||||
const struct Version* furi_hal_version_get_bootloader_version();
|
||||
|
||||
/** Get address of version structure of firmware.
|
||||
*
|
||||
|
@ -25,7 +25,7 @@ static void flipper_print_version(const char* target, const Version* version) {
|
||||
void flipper_init() {
|
||||
const Version* version;
|
||||
|
||||
version = (const Version*)furi_hal_version_get_boot_version();
|
||||
version = (const Version*)furi_hal_version_get_bootloader_version();
|
||||
flipper_print_version("Bootloader", version);
|
||||
|
||||
version = (const Version*)furi_hal_version_get_firmware_version();
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <furi-hal-boot.h>
|
||||
#include <furi-hal-bootloader.h>
|
||||
#include <stm32wbxx_ll_rtc.h>
|
||||
#include <furi.h>
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
#define BOOT_REQUEST_CLEAN 0xDADEDADE
|
||||
#define BOOT_REQUEST_DFU 0xDF00B000
|
||||
|
||||
void furi_hal_boot_init() {
|
||||
void furi_hal_bootloader_init() {
|
||||
#ifndef DEBUG
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_TAINTED);
|
||||
#endif
|
||||
FURI_LOG_I("FuriHalBoot", "Init OK");
|
||||
}
|
||||
|
||||
void furi_hal_boot_set_mode(FuriHalBootMode mode) {
|
||||
if (mode == FuriHalBootModeNormal) {
|
||||
void furi_hal_bootloader_set_mode(FuriHalBootloaderMode mode) {
|
||||
if (mode == FuriHalBootloaderModeNormal) {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_CLEAN);
|
||||
} else if (mode == FuriHalBootModeDFU) {
|
||||
} else if (mode == FuriHalBootloaderModeDFU) {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_DFU);
|
||||
}
|
||||
}
|
||||
|
||||
void furi_hal_boot_set_flags(FuriHalBootFlag flags) {
|
||||
void furi_hal_bootloader_set_flags(FuriHalBootloaderFlag flags) {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR2, flags);
|
||||
}
|
||||
|
||||
FuriHalBootFlag furi_hal_boot_get_flags() {
|
||||
FuriHalBootloaderFlag furi_hal_bootloader_get_flags() {
|
||||
return LL_RTC_BAK_GetRegister(RTC, LL_RTC_BKP_DR2);
|
||||
}
|
@ -276,7 +276,7 @@ const struct Version* furi_hal_version_get_firmware_version(void) {
|
||||
return version_get();
|
||||
}
|
||||
|
||||
const struct Version* furi_hal_version_get_boot_version(void) {
|
||||
const struct Version* furi_hal_version_get_bootloader_version(void) {
|
||||
#ifdef NO_BOOTLOADER
|
||||
return 0;
|
||||
#else
|
||||
|
@ -16,7 +16,7 @@ void furi_hal_init() {
|
||||
|
||||
MX_RTC_Init();
|
||||
FURI_LOG_I("HAL", "RTC OK");
|
||||
furi_hal_boot_init();
|
||||
furi_hal_bootloader_init();
|
||||
furi_hal_version_init();
|
||||
|
||||
furi_hal_spi_init();
|
||||
|
@ -153,9 +153,9 @@ C_SOURCES += \
|
||||
|
||||
# Linker options
|
||||
ifeq ($(NO_BOOTLOADER), 1)
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_no_boot.ld
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_no_bootloader.ld
|
||||
else
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_boot.ld
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_with_bootloader.ld
|
||||
endif
|
||||
|
||||
SVD_FILE = ../debug/STM32WB55_CM4.svd
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <furi-hal-boot.h>
|
||||
#include <furi-hal-bootloader.h>
|
||||
#include <stm32wbxx_ll_rtc.h>
|
||||
#include <furi.h>
|
||||
|
||||
@ -7,25 +7,25 @@
|
||||
#define BOOT_REQUEST_CLEAN 0xDADEDADE
|
||||
#define BOOT_REQUEST_DFU 0xDF00B000
|
||||
|
||||
void furi_hal_boot_init() {
|
||||
void furi_hal_bootloader_init() {
|
||||
#ifndef DEBUG
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_TAINTED);
|
||||
#endif
|
||||
FURI_LOG_I("FuriHalBoot", "Init OK");
|
||||
}
|
||||
|
||||
void furi_hal_boot_set_mode(FuriHalBootMode mode) {
|
||||
if (mode == FuriHalBootModeNormal) {
|
||||
void furi_hal_bootloader_set_mode(FuriHalBootloaderMode mode) {
|
||||
if (mode == FuriHalBootloaderModeNormal) {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_CLEAN);
|
||||
} else if (mode == FuriHalBootModeDFU) {
|
||||
} else if (mode == FuriHalBootloaderModeDFU) {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_DFU);
|
||||
}
|
||||
}
|
||||
|
||||
void furi_hal_boot_set_flags(FuriHalBootFlag flags) {
|
||||
void furi_hal_bootloader_set_flags(FuriHalBootloaderFlag flags) {
|
||||
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR2, flags);
|
||||
}
|
||||
|
||||
FuriHalBootFlag furi_hal_boot_get_flags() {
|
||||
FuriHalBootloaderFlag furi_hal_bootloader_get_flags() {
|
||||
return LL_RTC_BAK_GetRegister(RTC, LL_RTC_BKP_DR2);
|
||||
}
|
@ -276,7 +276,7 @@ const struct Version* furi_hal_version_get_firmware_version(void) {
|
||||
return version_get();
|
||||
}
|
||||
|
||||
const struct Version* furi_hal_version_get_boot_version(void) {
|
||||
const struct Version* furi_hal_version_get_bootloader_version(void) {
|
||||
#ifdef NO_BOOTLOADER
|
||||
return 0;
|
||||
#else
|
||||
|
@ -16,7 +16,7 @@ void furi_hal_init() {
|
||||
|
||||
MX_RTC_Init();
|
||||
FURI_LOG_I("HAL", "RTC OK");
|
||||
furi_hal_boot_init();
|
||||
furi_hal_bootloader_init();
|
||||
furi_hal_version_init();
|
||||
|
||||
furi_hal_spi_init();
|
||||
|
@ -153,9 +153,9 @@ C_SOURCES += \
|
||||
|
||||
# Linker options
|
||||
ifeq ($(NO_BOOTLOADER), 1)
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_no_boot.ld
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_no_bootloader.ld
|
||||
else
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_boot.ld
|
||||
LDFLAGS += -T$(MXPROJECT_DIR)/stm32wb55xx_flash_cm4_with_bootloader.ld
|
||||
endif
|
||||
|
||||
SVD_FILE = ../debug/STM32WB55_CM4.svd
|
||||
|
@ -1,50 +0,0 @@
|
||||
/**
|
||||
* @file furi-hal-boot.h
|
||||
* Bootloader HAL API
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Boot modes */
|
||||
typedef enum {
|
||||
FuriHalBootModeNormal,
|
||||
FuriHalBootModeDFU
|
||||
} FuriHalBootMode;
|
||||
|
||||
/** Boot flags */
|
||||
typedef enum {
|
||||
FuriHalBootFlagDefault=0,
|
||||
FuriHalBootFlagFactoryReset=1,
|
||||
} FuriHalBootFlag;
|
||||
|
||||
/** Initialize boot subsystem
|
||||
*/
|
||||
void furi_hal_boot_init();
|
||||
|
||||
/** Set boot mode
|
||||
*
|
||||
* @param[in] mode FuriHalBootMode
|
||||
*/
|
||||
void furi_hal_boot_set_mode(FuriHalBootMode mode);
|
||||
|
||||
/** Set boot flags
|
||||
*
|
||||
* @param[in] flags FuriHalBootFlag
|
||||
*/
|
||||
void furi_hal_boot_set_flags(FuriHalBootFlag flags);
|
||||
|
||||
/** Get boot flag
|
||||
*
|
||||
* @return FuriHalBootFlag
|
||||
*/
|
||||
FuriHalBootFlag furi_hal_boot_get_flags();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
50
firmware/targets/furi-hal-include/furi-hal-bootloader.h
Normal file
50
firmware/targets/furi-hal-include/furi-hal-bootloader.h
Normal file
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @file furi-hal-bootloader.h
|
||||
* Bootloader HAL API
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Boot modes */
|
||||
typedef enum {
|
||||
FuriHalBootloaderModeNormal,
|
||||
FuriHalBootloaderModeDFU
|
||||
} FuriHalBootloaderMode;
|
||||
|
||||
/** Boot flags */
|
||||
typedef enum {
|
||||
FuriHalBootloaderFlagDefault=0,
|
||||
FuriHalBootloaderFlagFactoryReset=1,
|
||||
} FuriHalBootloaderFlag;
|
||||
|
||||
/** Initialize boot subsystem
|
||||
*/
|
||||
void furi_hal_bootloader_init();
|
||||
|
||||
/** Set bootloader mode
|
||||
*
|
||||
* @param[in] mode FuriHalBootloaderMode
|
||||
*/
|
||||
void furi_hal_bootloader_set_mode(FuriHalBootloaderMode mode);
|
||||
|
||||
/** Set bootloader flags
|
||||
*
|
||||
* @param[in] flags FuriHalBootloaderFlag
|
||||
*/
|
||||
void furi_hal_bootloader_set_flags(FuriHalBootloaderFlag flags);
|
||||
|
||||
/** Get boot flag
|
||||
*
|
||||
* @return FuriHalBootloaderFlag
|
||||
*/
|
||||
FuriHalBootloaderFlag furi_hal_bootloader_get_flags();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -148,7 +148,7 @@ const uint8_t* furi_hal_version_get_ble_mac();
|
||||
*
|
||||
* @return Address of boot version structure.
|
||||
*/
|
||||
const struct Version* furi_hal_version_get_boot_version();
|
||||
const struct Version* furi_hal_version_get_bootloader_version();
|
||||
|
||||
/** Get address of version structure of firmware.
|
||||
*
|
||||
|
@ -9,7 +9,7 @@
|
||||
template <unsigned int N> struct STOP_EXTERNING_ME {};
|
||||
#endif
|
||||
|
||||
#include "furi-hal-boot.h"
|
||||
#include "furi-hal-bootloader.h"
|
||||
#include "furi-hal-clock.h"
|
||||
#include "furi-hal-crypto.h"
|
||||
#include "furi-hal-console.h"
|
||||
|
@ -18,14 +18,14 @@ class Main(App):
|
||||
self.parser_wipe = self.subparsers.add_parser("wipe", help="Wipe MCU Flash")
|
||||
self.parser_wipe.set_defaults(func=self.wipe)
|
||||
# Core 1 boot
|
||||
self.parser_core1boot = self.subparsers.add_parser(
|
||||
"core1boot", help="Flash Core1 Bootloader"
|
||||
self.parser_core1bootloader = self.subparsers.add_parser(
|
||||
"core1bootloader", help="Flash Core1 Bootloader"
|
||||
)
|
||||
self._addArgsSWD(self.parser_core1boot)
|
||||
self.parser_core1boot.add_argument(
|
||||
self._addArgsSWD(self.parser_core1bootloader)
|
||||
self.parser_core1bootloader.add_argument(
|
||||
"bootloader", type=str, help="Bootloader binary"
|
||||
)
|
||||
self.parser_core1boot.set_defaults(func=self.core1boot)
|
||||
self.parser_core1bootloader.set_defaults(func=self.core1bootloader)
|
||||
# Core 1 firmware
|
||||
self.parser_core1firmware = self.subparsers.add_parser(
|
||||
"core1firmware", help="Flash Core1 Firmware"
|
||||
@ -37,7 +37,7 @@ class Main(App):
|
||||
self.parser_core1firmware.set_defaults(func=self.core1firmware)
|
||||
# Core 1 all
|
||||
self.parser_core1 = self.subparsers.add_parser(
|
||||
"core1", help="Flash Core1 Boot and Firmware"
|
||||
"core1", help="Flash Core1 Bootloader and Firmware"
|
||||
)
|
||||
self._addArgsSWD(self.parser_core1)
|
||||
self.parser_core1.add_argument("bootloader", type=str, help="Bootloader binary")
|
||||
@ -97,7 +97,7 @@ class Main(App):
|
||||
self.logger.info(f"Complete")
|
||||
return 0
|
||||
|
||||
def core1boot(self):
|
||||
def core1bootloader(self):
|
||||
self.logger.info(f"Flashing bootloader")
|
||||
cp = CubeProgrammer(self.args.port)
|
||||
cp.flashBin("0x08000000", self.args.bootloader)
|
||||
|
@ -19,7 +19,7 @@ MANIFEST_TEMPLATE = {
|
||||
"minor": 12,
|
||||
"sub": 1,
|
||||
"branch": 0,
|
||||
"release": 7,
|
||||
"release": 1,
|
||||
},
|
||||
"files": [],
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user