Skip to content

Commit

Permalink
Merge pull request #426 from mithro/flash-firmware-fix
Browse files Browse the repository at this point in the history
flash: Fix end address for firmware.
  • Loading branch information
mithro committed Apr 8, 2018
2 parents e14edee + d12a566 commit daf33bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def main():
filename = make.get_firmware(builddir, "flash")

address_start = platform.gateware_size + make.BIOS_SIZE
address_end = platform.gateware_size
address_end = platform.spiflash_total_size

elif args.mode == 'other':
filename = args.other
filename = args.other_file
address_start = args.address
address_end = platform.gateware_size
address_end = platform.spiflash_total_size

else:
assert False, "Unknown flashing mode."
Expand All @@ -60,8 +60,8 @@ def main():
file_size = len(open(filepath, 'rb').read())

file_end = address_start+file_size
assert file_end < address_end, "File is too big!\n%s file doesn't fit in %s space." % (
address_end - address_start, file_size)
assert file_end < address_end, "File is too big!\n%s file doesn't fit in %s space (%s extra bytes)." % (
filename, file_size, address_end - address_start)

prog = make.get_prog(args, platform)
prog.flash(address_start, filepath)
Expand Down

0 comments on commit daf33bc

Please sign in to comment.