Skip to content

Commit

Permalink
Fixed issue with bootloader where flashing just binaries of nrf51 or …
Browse files Browse the repository at this point in the history
…sd+bl did not work
  • Loading branch information
evoggy committed Feb 1, 2024
1 parent 3079592 commit e585beb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cflib/bootloader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit e585beb

Please sign in to comment.