Skip to content

Commit

Permalink
Merge pull request #188 from joriswit/read-beyond-device-size-warning
Browse files Browse the repository at this point in the history
Added warning when reading beyond device size ( #187 )
  • Loading branch information
JelmerT authored Jan 14, 2025
2 parents 7ada915 + eb257a9 commit bb64711
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cc2538-bsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb64711

Please sign in to comment.