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