Skip to content

Commit 534becb

Browse files
committed
PSOC6: correctly align hex files with split text sections
When the original PSOC6 CM4 hex file contains unalinged text sections that span through multiple intelhex segments, aligned segments (filled with zeroes) overlap with the original data segments, resulting in error thrown by ihex.merge(alignments, overlap='error'). Such hex file can be produced when the ELF is built with ARM MDK Compiler with --split_sections option: http://www.keil.com/support/man/docs/armcc/armcc_chr1359124944914.htm Change the merge strategy to overlap='ignore', so that the overlapping zero-filled segments are skipped.
1 parent f61dee1 commit 534becb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/targets/PSOC6.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def patch(message_func, ihex, hexf, align=256):
9696
aligned_end += align
9797
message_func("Aligning end from 0x%x to 0x%x" % (end, aligned_end))
9898
alignments.frombytes(ihex.tobinarray(end, aligned_end - 1), end)
99-
ihex.merge(alignments)
99+
ihex.merge(alignments, 'ignore')
100100

101101
def merge_images(hexf0, hexf1=None):
102102
ihex = IntelHex()

0 commit comments

Comments
 (0)