2
\$\begingroup\$

I'm programming an ATmega328p using avrdude, and with a program size of 3074B, I am experiencing approximately 13 seconds of programming time. This is painfully slow when developing with the microcontroller. I've tried using both the internal oscillator, and an external oscillator both set at 8MHz. The CKDIV8 fuse is also unprogrammed. I'm not sure what I am doing wrong, I remember it being much faster when programming in the past.

EDIT: As requested, here is the output of avrdude:

avrdude -c atmelice_isp -p m328p -U flash:w:debug.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
 To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "debug.hex"
avrdude: input file debug.hex auto detected as Intel Hex
avrdude: writing flash (3074 bytes):
Writing | ################################################## | 100% 12.57s
avrdude: 3074 bytes of flash written
avrdude: verifying flash memory against debug.hex:
avrdude: load data flash data from input file debug.hex:
avrdude: input file debug.hex auto detected as Intel Hex
avrdude: input file debug.hex contains 3074 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 13.06s
avrdude: verifying ...
avrdude: 3074 bytes of flash verified
avrdude: safemode: Fuses OK (E:FF, H:D9, L:E0)
avrdude done. Thank you.

Also the programmer that I am using is the Atmel-ICE

asked Jun 5, 2021 at 8:39
\$\endgroup\$
6
  • \$\begingroup\$ I don't know, but it might be interesting to see your avrdude command line \$\endgroup\$ Commented Jun 5, 2021 at 9:04
  • \$\begingroup\$ @mmmm I updated the question. \$\endgroup\$ Commented Jun 5, 2021 at 9:26
  • 3
    \$\begingroup\$ Try avrdude -c atmelice_isp -B1 -p m328p -U flash:w:debug.hex \$\endgroup\$ Commented Jun 5, 2021 at 10:17
  • \$\begingroup\$ Have you tried another entirely fresh ATmega328p chip? Is the cable damaged? Process of elimination should solve this for you. \$\endgroup\$ Commented Jun 5, 2021 at 15:24
  • \$\begingroup\$ How many times did you flash the chip, estimated? I'm not sure, but the program's flash might wear out... \$\endgroup\$ Commented Jun 5, 2021 at 16:49

1 Answer 1

4
\$\begingroup\$

There seems to be a common problem with the Atmel ICE being very slow to program using avrdude. It's to do with the programmer seemingly defaulting to a low clock rate for programming.

The problem can be resolved by instructing avrdude to run the programmer at a higher speed by adding -B1 to the command line arguments, for example:

avrdude -c atmelice_isp -B1 -p m328p -U flash:w:debug.hex
answered Jun 5, 2021 at 20:57
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.