diff --git a/cc2538-bsl.py b/cc2538-bsl.py index 9a1cf9f..dd8cfb9 100755 --- a/cc2538-bsl.py +++ b/cc2538-bsl.py @@ -1268,6 +1268,10 @@ def cli_setup(): mdebug(5, "Reading %s bytes starting at address 0x%x" % (length, args.address)) + + if args.address + length > device.size: + mdebug(5, "Warning: reading beyond device size!") + with open(args.file, 'wb') as f: for i in range(0, length >> 2): # reading 4 bytes at a time