From e585bebdc21d1709e916de558b467d4f5bc44d51 Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 1 Feb 2024 21:32:47 +0100 Subject: [PATCH] Fixed issue with bootloader where flashing just binaries of nrf51 or sd+bl did not work --- cflib/bootloader/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cflib/bootloader/__init__.py b/cflib/bootloader/__init__.py index 850f1de98..14ba1bf5a 100644 --- a/cflib/bootloader/__init__.py +++ b/cflib/bootloader/__init__.py @@ -199,6 +199,7 @@ def flash(self, filename: str, targets: List[Target], cf=None, enable_console_lo current_nrf_sd_version = self._get_current_nrf51_sd_version() required_nrf_sd_version = self._get_required_nrf51_sd_version(flash_artifacts) provided_nrf_sd_version = self._get_provided_nrf51_sd_version(flash_artifacts) + update_contains_nrf_sd = any(x.target.type == 'bootloader+softdevice' for x in flash_artifacts) current_nrf_bl_version = None if self._cload.targets[TargetTypes.NRF51].version is not None: current_nrf_bl_version = str(self._cload.targets[TargetTypes.NRF51].version) @@ -221,7 +222,7 @@ def flash(self, filename: str, targets: List[Target], cf=None, enable_console_lo should_flash_nrf_sd = True if current_nrf_sd_version == required_nrf_sd_version and current_nrf_bl_version == provided_nrf_bl_version: should_flash_nrf_sd = False - elif provided_nrf_sd_version is None: + elif provided_nrf_sd_version is None and not update_contains_nrf_sd: should_flash_nrf_sd = False if should_flash_nrf_sd: