From ae016ce464641fd6a9295749363fc6da2f97e24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Tue, 26 Oct 2021 15:24:14 +0300 Subject: [PATCH] [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. --- applications/about/about.c | 6 +- applications/cli/cli_commands.c | 98 +++++++++---------- applications/desktop/views/desktop_debug.c | 2 +- applications/power/power_cli.c | 2 +- applications/power/power_service/power_api.c | 6 +- applications/storage/storages/storage-int.c | 6 +- .../targets/f6/furi-hal/furi-hal-version.c | 2 +- .../targets/f7/furi-hal/furi-hal-version.c | 2 +- .../furi-hal-include/furi-hal-version.h | 2 +- core/flipper.c | 2 +- ...{furi-hal-boot.c => furi-hal-bootloader.c} | 14 +-- .../targets/f6/furi-hal/furi-hal-version.c | 2 +- firmware/targets/f6/furi-hal/furi-hal.c | 2 +- ...=> stm32wb55xx_flash_cm4_no_bootloader.ld} | 0 ... stm32wb55xx_flash_cm4_with_bootloader.ld} | 0 firmware/targets/f6/target.mk | 4 +- ...{furi-hal-boot.c => furi-hal-bootloader.c} | 14 +-- .../targets/f7/furi-hal/furi-hal-version.c | 2 +- firmware/targets/f7/furi-hal/furi-hal.c | 2 +- ...=> stm32wb55xx_flash_cm4_no_bootloader.ld} | 0 ... stm32wb55xx_flash_cm4_with_bootloader.ld} | 0 firmware/targets/f7/target.mk | 4 +- .../targets/furi-hal-include/furi-hal-boot.h | 50 ---------- .../furi-hal-include/furi-hal-bootloader.h | 50 ++++++++++ .../furi-hal-include/furi-hal-version.h | 2 +- firmware/targets/furi-hal-include/furi-hal.h | 2 +- scripts/flash.py | 14 +-- scripts/flipper/copro.py | 2 +- 28 files changed, 146 insertions(+), 146 deletions(-) rename firmware/targets/f6/furi-hal/{furi-hal-boot.c => furi-hal-bootloader.c} (62%) rename firmware/targets/f6/{stm32wb55xx_flash_cm4_no_boot.ld => stm32wb55xx_flash_cm4_no_bootloader.ld} (100%) rename firmware/targets/f6/{stm32wb55xx_flash_cm4_boot.ld => stm32wb55xx_flash_cm4_with_bootloader.ld} (100%) rename firmware/targets/f7/furi-hal/{furi-hal-boot.c => furi-hal-bootloader.c} (62%) rename firmware/targets/f7/{stm32wb55xx_flash_cm4_no_boot.ld => stm32wb55xx_flash_cm4_no_bootloader.ld} (100%) rename firmware/targets/f7/{stm32wb55xx_flash_cm4_boot.ld => stm32wb55xx_flash_cm4_with_bootloader.ld} (100%) delete mode 100644 firmware/targets/furi-hal-include/furi-hal-boot.h create mode 100644 firmware/targets/furi-hal-include/furi-hal-bootloader.h diff --git a/applications/about/about.c b/applications/about/about.c index a24d8ee9..8d739b79 100644 --- a/applications/about/about.c +++ b/applications/about/about.c @@ -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); diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index fd87625b..e4053c4c 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -56,13 +56,13 @@ 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_minor : %d\r\n", 0); + 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()); + printf("hardware_model : %s\r\n", furi_hal_version_get_model_name()); // Unique ID - printf("hardware_uid : "); + printf("hardware_uid : "); const uint8_t* uid = furi_hal_version_uid(); for(size_t i = 0; i < furi_hal_version_uid_size(); i++) { printf("%02X", uid[i]); @@ -70,69 +70,69 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { printf("\r\n"); // OTP Revision - printf("hardware_otp_ver : %d\r\n", furi_hal_version_get_otp_version()); - printf("hardware_timestamp : %lu\r\n", furi_hal_version_get_hw_timestamp()); + printf("hardware_otp_ver : %d\r\n", furi_hal_version_get_otp_version()); + printf("hardware_timestamp : %lu\r\n", furi_hal_version_get_hw_timestamp()); // Board Revision - printf("hardware_ver : %d\r\n", furi_hal_version_get_hw_version()); - printf("hardware_target : %d\r\n", furi_hal_version_get_hw_target()); - printf("hardware_body : %d\r\n", furi_hal_version_get_hw_body()); - printf("hardware_connect : %d\r\n", furi_hal_version_get_hw_connect()); - printf("hardware_display : %d\r\n", furi_hal_version_get_hw_display()); + printf("hardware_ver : %d\r\n", furi_hal_version_get_hw_version()); + printf("hardware_target : %d\r\n", furi_hal_version_get_hw_target()); + printf("hardware_body : %d\r\n", furi_hal_version_get_hw_body()); + printf("hardware_connect : %d\r\n", furi_hal_version_get_hw_connect()); + printf("hardware_display : %d\r\n", furi_hal_version_get_hw_display()); // Board Personification - printf("hardware_color : %d\r\n", furi_hal_version_get_hw_color()); - printf("hardware_region : %d\r\n", furi_hal_version_get_hw_region()); + printf("hardware_color : %d\r\n", furi_hal_version_get_hw_color()); + printf("hardware_region : %d\r\n", furi_hal_version_get_hw_region()); const char* name = furi_hal_version_get_name_ptr(); if(name) { - printf("hardware_name : %s\r\n", name); + printf("hardware_name : %s\r\n", name); } // 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 const Version* firmware_version = furi_hal_version_get_firmware_version(); if(firmware_version) { - printf("firmware_commit : %s\r\n", version_get_githash(firmware_version)); - printf("firmware_branch : %s\r\n", version_get_gitbranch(firmware_version)); - printf("firmware_branch_num : %s\r\n", version_get_gitbranchnum(firmware_version)); - printf("firmware_version : %s\r\n", version_get_version(firmware_version)); - printf("firmware_build_date : %s\r\n", version_get_builddate(firmware_version)); - printf("firmware_target : %d\r\n", version_get_target(firmware_version)); + printf("firmware_commit : %s\r\n", version_get_githash(firmware_version)); + printf("firmware_branch : %s\r\n", version_get_gitbranch(firmware_version)); + printf("firmware_branch_num : %s\r\n", version_get_gitbranchnum(firmware_version)); + printf("firmware_version : %s\r\n", version_get_version(firmware_version)); + printf("firmware_build_date : %s\r\n", version_get_builddate(firmware_version)); + printf("firmware_target : %d\r\n", version_get_target(firmware_version)); } WirelessFwInfo_t pWirelessInfo; if(furi_hal_bt_is_alive() && SHCI_GetWirelessFwInfo(&pWirelessInfo) == SHCI_Success) { - printf("radio_alive : true\r\n"); + printf("radio_alive : true\r\n"); // FUS Info - printf("radio_fus_major : %d\r\n", pWirelessInfo.FusVersionMajor); - printf("radio_fus_minor : %d\r\n", pWirelessInfo.FusVersionMinor); - printf("radio_fus_sub : %d\r\n", pWirelessInfo.FusVersionSub); - printf("radio_fus_sram2b : %dK\r\n", pWirelessInfo.FusMemorySizeSram2B); - printf("radio_fus_sram2a : %dK\r\n", pWirelessInfo.FusMemorySizeSram2A); - printf("radio_fus_flash : %dK\r\n", pWirelessInfo.FusMemorySizeFlash * 4); + printf("radio_fus_major : %d\r\n", pWirelessInfo.FusVersionMajor); + printf("radio_fus_minor : %d\r\n", pWirelessInfo.FusVersionMinor); + printf("radio_fus_sub : %d\r\n", pWirelessInfo.FusVersionSub); + printf("radio_fus_sram2b : %dK\r\n", pWirelessInfo.FusMemorySizeSram2B); + printf("radio_fus_sram2a : %dK\r\n", pWirelessInfo.FusMemorySizeSram2A); + printf("radio_fus_flash : %dK\r\n", pWirelessInfo.FusMemorySizeFlash * 4); // Stack Info - printf("radio_stack_type : %d\r\n", pWirelessInfo.StackType); - printf("radio_stack_major : %d\r\n", pWirelessInfo.VersionMajor); - printf("radio_stack_minor : %d\r\n", pWirelessInfo.VersionMinor); - printf("radio_stack_sub : %d\r\n", pWirelessInfo.VersionSub); - printf("radio_stack_branch : %d\r\n", pWirelessInfo.VersionBranch); - printf("radio_stack_release : %d\r\n", pWirelessInfo.VersionReleaseType); - printf("radio_stack_sram2b : %dK\r\n", pWirelessInfo.MemorySizeSram2B); - printf("radio_stack_sram2a : %dK\r\n", pWirelessInfo.MemorySizeSram2A); - printf("radio_stack_sram1 : %dK\r\n", pWirelessInfo.MemorySizeSram1); - printf("radio_stack_flash : %dK\r\n", pWirelessInfo.MemorySizeFlash * 4); + printf("radio_stack_type : %d\r\n", pWirelessInfo.StackType); + printf("radio_stack_major : %d\r\n", pWirelessInfo.VersionMajor); + printf("radio_stack_minor : %d\r\n", pWirelessInfo.VersionMinor); + printf("radio_stack_sub : %d\r\n", pWirelessInfo.VersionSub); + printf("radio_stack_branch : %d\r\n", pWirelessInfo.VersionBranch); + printf("radio_stack_release : %d\r\n", pWirelessInfo.VersionReleaseType); + printf("radio_stack_sram2b : %dK\r\n", pWirelessInfo.MemorySizeSram2B); + printf("radio_stack_sram2a : %dK\r\n", pWirelessInfo.MemorySizeSram2A); + printf("radio_stack_sram1 : %dK\r\n", pWirelessInfo.MemorySizeSram1); + printf("radio_stack_flash : %dK\r\n", pWirelessInfo.MemorySizeFlash * 4); // Mac address - printf("radio_ble_mac : "); + printf("radio_ble_mac : "); const uint8_t* ble_mac = furi_hal_version_get_ble_mac(); for(size_t i = 0; i < 6; i++) { printf("%02X", ble_mac[i]); @@ -154,12 +154,12 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { furi_hal_crypto_store_unload_key(key_slot + 1); } } - printf("enclave_valid_keys : %d\r\n", enclave_valid_keys); + printf("enclave_valid_keys : %d\r\n", enclave_valid_keys); printf( - "enclave_valid : %s\r\n", + "enclave_valid : %s\r\n", (enclave_valid_keys == ENCLAVE_SIGNATURE_KEY_SLOTS) ? "true" : "false"); } else { - printf("radio_alive : false\r\n"); + printf("radio_alive : false\r\n"); } } diff --git a/applications/desktop/views/desktop_debug.c b/applications/desktop/views/desktop_debug.c index cd3dfd15..ae5f1f8d 100644 --- a/applications/desktop/views/desktop_debug.c +++ b/applications/desktop/views/desktop_debug.c @@ -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) { diff --git a/applications/power/power_cli.c b/applications/power/power_cli.c index 4240ae45..63c0fda5 100644 --- a/applications/power/power_cli.c +++ b/applications/power/power_cli.c @@ -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"); diff --git a/applications/power/power_service/power_api.c b/applications/power/power_service/power_api.c index 4147d17d..46fa21ef 100644 --- a/applications/power/power_service/power_api.c +++ b/applications/power/power_service/power_api.c @@ -1,7 +1,7 @@ #include "power_i.h" #include #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(); } diff --git a/applications/storage/storages/storage-int.c b/applications/storage/storages/storage-int.c index 87c02786..fb4c07be 100644 --- a/applications/storage/storages/storage-int.c +++ b/applications/storage/storages/storage-int.c @@ -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"); diff --git a/bootloader/targets/f6/furi-hal/furi-hal-version.c b/bootloader/targets/f6/furi-hal/furi-hal-version.c index ff3b2699..df6d61b0 100644 --- a/bootloader/targets/f6/furi-hal/furi-hal-version.c +++ b/bootloader/targets/f6/furi-hal/furi-hal-version.c @@ -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 diff --git a/bootloader/targets/f7/furi-hal/furi-hal-version.c b/bootloader/targets/f7/furi-hal/furi-hal-version.c index ff3b2699..df6d61b0 100644 --- a/bootloader/targets/f7/furi-hal/furi-hal-version.c +++ b/bootloader/targets/f7/furi-hal/furi-hal-version.c @@ -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 diff --git a/bootloader/targets/furi-hal-include/furi-hal-version.h b/bootloader/targets/furi-hal-include/furi-hal-version.h index 99a00533..3ed8b60b 100644 --- a/bootloader/targets/furi-hal-include/furi-hal-version.h +++ b/bootloader/targets/furi-hal-include/furi-hal-version.h @@ -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. * diff --git a/core/flipper.c b/core/flipper.c index 785a4463..c8d12068 100755 --- a/core/flipper.c +++ b/core/flipper.c @@ -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(); diff --git a/firmware/targets/f6/furi-hal/furi-hal-boot.c b/firmware/targets/f6/furi-hal/furi-hal-bootloader.c similarity index 62% rename from firmware/targets/f6/furi-hal/furi-hal-boot.c rename to firmware/targets/f6/furi-hal/furi-hal-bootloader.c index 978711c5..2962877e 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-boot.c +++ b/firmware/targets/f6/furi-hal/furi-hal-bootloader.c @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -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); } \ No newline at end of file diff --git a/firmware/targets/f6/furi-hal/furi-hal-version.c b/firmware/targets/f6/furi-hal/furi-hal-version.c index 7ee67c2a..5b412315 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-version.c +++ b/firmware/targets/f6/furi-hal/furi-hal-version.c @@ -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 diff --git a/firmware/targets/f6/furi-hal/furi-hal.c b/firmware/targets/f6/furi-hal/furi-hal.c index bcddc6e0..aa7536ef 100644 --- a/firmware/targets/f6/furi-hal/furi-hal.c +++ b/firmware/targets/f6/furi-hal/furi-hal.c @@ -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(); diff --git a/firmware/targets/f6/stm32wb55xx_flash_cm4_no_boot.ld b/firmware/targets/f6/stm32wb55xx_flash_cm4_no_bootloader.ld similarity index 100% rename from firmware/targets/f6/stm32wb55xx_flash_cm4_no_boot.ld rename to firmware/targets/f6/stm32wb55xx_flash_cm4_no_bootloader.ld diff --git a/firmware/targets/f6/stm32wb55xx_flash_cm4_boot.ld b/firmware/targets/f6/stm32wb55xx_flash_cm4_with_bootloader.ld similarity index 100% rename from firmware/targets/f6/stm32wb55xx_flash_cm4_boot.ld rename to firmware/targets/f6/stm32wb55xx_flash_cm4_with_bootloader.ld diff --git a/firmware/targets/f6/target.mk b/firmware/targets/f6/target.mk index f942ba0f..0b18617e 100644 --- a/firmware/targets/f6/target.mk +++ b/firmware/targets/f6/target.mk @@ -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 diff --git a/firmware/targets/f7/furi-hal/furi-hal-boot.c b/firmware/targets/f7/furi-hal/furi-hal-bootloader.c similarity index 62% rename from firmware/targets/f7/furi-hal/furi-hal-boot.c rename to firmware/targets/f7/furi-hal/furi-hal-bootloader.c index 978711c5..2962877e 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-boot.c +++ b/firmware/targets/f7/furi-hal/furi-hal-bootloader.c @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -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); } \ No newline at end of file diff --git a/firmware/targets/f7/furi-hal/furi-hal-version.c b/firmware/targets/f7/furi-hal/furi-hal-version.c index 64641fc6..e4adebc0 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-version.c +++ b/firmware/targets/f7/furi-hal/furi-hal-version.c @@ -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 diff --git a/firmware/targets/f7/furi-hal/furi-hal.c b/firmware/targets/f7/furi-hal/furi-hal.c index bcddc6e0..aa7536ef 100644 --- a/firmware/targets/f7/furi-hal/furi-hal.c +++ b/firmware/targets/f7/furi-hal/furi-hal.c @@ -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(); diff --git a/firmware/targets/f7/stm32wb55xx_flash_cm4_no_boot.ld b/firmware/targets/f7/stm32wb55xx_flash_cm4_no_bootloader.ld similarity index 100% rename from firmware/targets/f7/stm32wb55xx_flash_cm4_no_boot.ld rename to firmware/targets/f7/stm32wb55xx_flash_cm4_no_bootloader.ld diff --git a/firmware/targets/f7/stm32wb55xx_flash_cm4_boot.ld b/firmware/targets/f7/stm32wb55xx_flash_cm4_with_bootloader.ld similarity index 100% rename from firmware/targets/f7/stm32wb55xx_flash_cm4_boot.ld rename to firmware/targets/f7/stm32wb55xx_flash_cm4_with_bootloader.ld diff --git a/firmware/targets/f7/target.mk b/firmware/targets/f7/target.mk index be91cee9..184bb9d2 100644 --- a/firmware/targets/f7/target.mk +++ b/firmware/targets/f7/target.mk @@ -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 diff --git a/firmware/targets/furi-hal-include/furi-hal-boot.h b/firmware/targets/furi-hal-include/furi-hal-boot.h deleted file mode 100644 index 195a7bb0..00000000 --- a/firmware/targets/furi-hal-include/furi-hal-boot.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file furi-hal-boot.h - * Bootloader HAL API - */ - -#pragma once - -#include - -#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 diff --git a/firmware/targets/furi-hal-include/furi-hal-bootloader.h b/firmware/targets/furi-hal-include/furi-hal-bootloader.h new file mode 100644 index 00000000..a1ef2c26 --- /dev/null +++ b/firmware/targets/furi-hal-include/furi-hal-bootloader.h @@ -0,0 +1,50 @@ +/** + * @file furi-hal-bootloader.h + * Bootloader HAL API + */ + +#pragma once + +#include + +#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 diff --git a/firmware/targets/furi-hal-include/furi-hal-version.h b/firmware/targets/furi-hal-include/furi-hal-version.h index 00dc5cba..29343d57 100644 --- a/firmware/targets/furi-hal-include/furi-hal-version.h +++ b/firmware/targets/furi-hal-include/furi-hal-version.h @@ -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. * diff --git a/firmware/targets/furi-hal-include/furi-hal.h b/firmware/targets/furi-hal-include/furi-hal.h index 757dd121..4ac95d82 100644 --- a/firmware/targets/furi-hal-include/furi-hal.h +++ b/firmware/targets/furi-hal-include/furi-hal.h @@ -9,7 +9,7 @@ template 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" diff --git a/scripts/flash.py b/scripts/flash.py index 0e920076..be65b1dc 100755 --- a/scripts/flash.py +++ b/scripts/flash.py @@ -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) diff --git a/scripts/flipper/copro.py b/scripts/flipper/copro.py index a7f3b95f..f5198e44 100644 --- a/scripts/flipper/copro.py +++ b/scripts/flipper/copro.py @@ -19,7 +19,7 @@ MANIFEST_TEMPLATE = { "minor": 12, "sub": 1, "branch": 0, - "release": 7, + "release": 1, }, "files": [], },