cmake/partitions: Apply offset to partition table metadata correctly

Also warn if the parttool.py has an error
This commit is contained in:
Angus Gratton
2018-08-20 18:24:18 +10:00
committed by Angus Gratton
parent 0743361da3
commit 7cc5888583
3 changed files with 15 additions and 3 deletions

View File

@@ -49,6 +49,8 @@ def main():
parser.add_argument('--quiet', '-q', help="Don't print status messages to stderr", action='store_true')
parser.add_argument('--partition-table-offset', help='The offset of the partition table in flash. Only consulted if partition table is in CSV format.', type=str, default='0x8000')
search_type = parser.add_mutually_exclusive_group()
search_type.add_argument('--partition-name', '-p', help='The name of the required partition', type=str, default=None)
search_type.add_argument('--type', '-t', help='The type of the required partition', type=str, default=None)
@@ -74,6 +76,8 @@ def main():
quiet = args.quiet
gen.offset_part_table = int(args.partition_table_offset, 0)
input = args.input.read()
input_is_binary = input[0:2] == gen.PartitionDefinition.MAGIC_BYTES
if input_is_binary: