Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite fileio functions to cater for a list of memory segments #1392

Merged
merged 16 commits into from
Jun 11, 2023

Conversation

stefanrueger
Copy link
Collaborator

The fileio.c functions all have a granularity of the complete AVR memory, which matches what is needed in -U. In order to enable writing of memory intervals in the terminal this PR updates the I/O functions in fileio.c for later use.

Also fixes Issues #1390 and #1391.

@mcuee
Copy link
Collaborator

mcuee commented Jun 11, 2023

@mcuee
Copy link
Collaborator

mcuee commented Jun 11, 2023

Test using real programmer and not -c dryrun.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1392 -c urclock -p m328p -P COM35 -U .\hex\Blink.ino.standard.hex
avrdude_pr1392: AVR device initialized and ready to accept instructions
avrdude_pr1392: device signature = 0x1e950f (probably m328p)
avrdude_pr1392: Note: flash memory has been specified, an erase cycle will be performed.
                To disable this feature, specify the -D option.
avrdude_pr1392: erasing chip
                delaying chip erase until first -U upload to flash

avrdude_pr1392: processing -U flash:w:.\hex\Blink.ino.standard.hex:i
avrdude_pr1392: reading input file .\hex\Blink.ino.standard.hex for flash
                with 924 bytes in 1 section within [0, 0x39b]
                using 8 pages and 100 pad bytes
avrdude_pr1392: preparing flash input for device bootloader
avrdude_pr1392: writing 924 bytes flash ...
Writing | ################################################## | 100% 6.60 s
avrdude_pr1392: 924 bytes of flash written
avrdude_pr1392: verifying flash memory against .\hex\Blink.ino.standard.hex
Reading | ################################################## | 100% 5.25 s
avrdude_pr1392: 924 bytes of flash verified

avrdude_pr1392 done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1392 -c urclock -p m328p -P COM35 -xshowall
avrdude_pr1392: AVR device initialized and ready to accept instructions
0 2022-06-10 21.21 Blink.ino.standard.hex 924 store 31298 meta 34 boot 512 o4.4 --s-h-r-- 
vector 0 (RESET) ATmega328P

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1392 -c urclock -p m328p -P COM35 -U flash:r:read.srec:s
avrdude_pr1392: AVR device initialized and ready to accept instructions
avrdude_pr1392: device signature = 0x1e950f (probably m328p)

avrdude_pr1392: processing -U flash:r:read.srec:s
avrdude_pr1392: reading flash memory ...
Reading | ################################################## | 100% 5.31 s
avrdude_pr1392: writing output file read.srec

avrdude_pr1392 done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude_bin> srec_cat .\read.srec -output read.bin -binary && echo OK
OK

@stefanrueger stefanrueger merged commit 45217c7 into avrdudes:main Jun 11, 2023
@stefanrueger stefanrueger deleted the save branch June 11, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
2 participants