From f3a2d6374751a9d1fabdf0b1052a866768a2c910 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 25 Jun 2018 18:53:31 +1000 Subject: [PATCH] Tools: don't generate a _with_bl file for the bootloader itself --- Tools/scripts/make_intel_hex.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Tools/scripts/make_intel_hex.py b/Tools/scripts/make_intel_hex.py index a064899c8d..ad3b0fd7a0 100755 --- a/Tools/scripts/make_intel_hex.py +++ b/Tools/scripts/make_intel_hex.py @@ -29,7 +29,7 @@ if not os.path.exists(bootloaderfile): blimage = bytes(open(bootloaderfile, "rb").read()) blimage += bytes(struct.pack('B',255) * (reserve_kb * 1024 - len(blimage))) -if len(blimage) != reserve_kb * 1024: +if reserve_kb > 0 and len(blimage) != reserve_kb * 1024: print("Bad blimage size %u" % len(blimage)) sys.exit(1) @@ -42,11 +42,12 @@ tmpfile = hexfile + ".tmp" open(tmpfile, "wb").write(appimage) intelhex.bin2hex(tmpfile, hexfile, offset=(0x08000000 + reserve_kb*1024)) +print("Created %s" % hexfile) -open(tmpfile, "wb").write(with_bl) - -intelhex.bin2hex(tmpfile, hex_with_bl, offset=0x08000000) - +if reserve_kb > 0: + open(tmpfile, "wb").write(with_bl) + intelhex.bin2hex(tmpfile, hex_with_bl, offset=0x08000000) + print("Created %s" % hex_with_bl) + os.unlink(tmpfile) -print("Created %s" % hexfile) -print("Created %s" % hex_with_bl) +