Skip to content

Commit 4fe0fea

Browse files
committed
Merge pull request #406 from 0xc0170/dev_target_fix
[tools] Fixed iterating through the available hex files
2 parents 0e24b53 + e2a080b commit 4fe0fea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

workspace_tools/targets.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,14 +431,19 @@ def init_hooks(self, hook, toolchain_name):
431431
@staticmethod
432432
def binary_hook(t_self, resources, elf, binf):
433433
for hexf in resources.hex_files:
434+
found = False
434435
for softdeviceAndOffsetEntry in NRF51822.EXPECTED_SOFTDEVICES_WITH_OFFSETS:
435436
if hexf.find(softdeviceAndOffsetEntry['name']) != -1:
437+
found = True
436438
break
439+
if found:
440+
break
437441
else:
438442
t_self.debug("Hex file not found. Aborting.")
439443
return
440444

441445
# Merge user code with softdevice
446+
t_self.debug("Patching Hex file %s" % softdeviceAndOffsetEntry['name'])
442447
from intelhex import IntelHex
443448
binh = IntelHex()
444449
binh.loadbin(binf, offset=softdeviceAndOffsetEntry['offset'])

0 commit comments

Comments
 (0)