Skip to content

Commit

Permalink
Added warning when reading beyond device size ( JelmerT#187 )
Browse files Browse the repository at this point in the history
  • Loading branch information
joriswit committed Jan 2, 2025
1 parent 208cf7a commit eb257a9
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 eb257a9

Please sign in to comment.