mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #406 from 0xc0170/dev_target_fix
[tools] Fixed iterating through the available hex filespull/407/head
commit
4fe0feaf41
|
@ -431,14 +431,19 @@ class NRF51822(Target):
|
|||
@staticmethod
|
||||
def binary_hook(t_self, resources, elf, binf):
|
||||
for hexf in resources.hex_files:
|
||||
found = False
|
||||
for softdeviceAndOffsetEntry in NRF51822.EXPECTED_SOFTDEVICES_WITH_OFFSETS:
|
||||
if hexf.find(softdeviceAndOffsetEntry['name']) != -1:
|
||||
found = True
|
||||
break
|
||||
if found:
|
||||
break
|
||||
else:
|
||||
t_self.debug("Hex file not found. Aborting.")
|
||||
return
|
||||
|
||||
# Merge user code with softdevice
|
||||
t_self.debug("Patching Hex file %s" % softdeviceAndOffsetEntry['name'])
|
||||
from intelhex import IntelHex
|
||||
binh = IntelHex()
|
||||
binh.loadbin(binf, offset=softdeviceAndOffsetEntry['offset'])
|
||||
|
|
Loading…
Reference in New Issue