Replies: 18 comments 32 replies
-
Bootloader and Programmer benchmark results -- using This will be the preferred method moving forward. To be updated. The following is with avrdude MSVC64 binary, Arduino Uno Rev 3 clone using ATmega16U2 as the USB to Serial chip (fastest USB to Serial chip so far).
|
Beta Was this translation helpful? Give feedback.
-
Dr Azy has some interesting data for serialupdi here for modern AVRs.
https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md megaTinyCore At 921600, only the CH340 worked anywhere without the delay. This should only be used when the voltage on the target during programming is 4.5V or more. DxCore |
Beta Was this translation helpful? Give feedback.
-
From @Ho-Ro
My timing shoot-outtiny85 - stk500v1
tiny85 - scratchmonkey
mega328p - stk500v1
mega328p - scratchmonkey
Fazit:
I will touch this function at some point (priority C) :)
I had no peace before I also optimised the writing of the EEPROM in my nanoSTK_V1 - now I write the EEPROM data page by page instead of single bytes
|
Beta Was this translation helpful? Give feedback.
-
I compared three programmers last year using ATmega328P as the target with a 32KB hex file, in Nov 2022.
|
Beta Was this translation helpful? Give feedback.
-
Indeed AVR chip tested: ATmega2560, page size 256
click for detail run log
|
Beta Was this translation helpful? Give feedback.
-
From #1106, results from @MCUdude using STK600: reading the ATmega2560 in 12.8s. This beats my AVRISP mkii result of 14.52s. @MCUdude thinks that the reason is probably because of the use of a USB AVR in STK600 vs the use of an non-USB AVR plus a USB controller in AVRISP mkii.
|
Beta Was this translation helpful? Give feedback.
-
The following page is a good summary of AVR programmers (in German but Google Translate seem to work well). It has some benchmarks as well with avrdude 5.5. The test file was 29704 bytes in size. Target is an ATmega6490 clocked at 8MHz by the RC oscillator. All this was tested with an AVRDUDE 5.5.
|
Beta Was this translation helpful? Give feedback.
-
@flyandancexo has posted some good results with his AVR910 compatible programmer. HW design info and firmware binaries here, no firmware source codes available as of now |
Beta Was this translation helpful? Give feedback.
-
The fastest I see so far is from FTDI FT232H/FTDI2232H JTAG (8MHz): 128KB Flash reading at 0.40 seconds.
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I am thinking that avrdude can do that. Maybe this is a worthy improment. Something like the following.
Current output.
|
Beta Was this translation helpful? Give feedback.
-
@mcuee TLDR; I argue we should look at typical practical tasks for benchmarking. The suggestion above to add something like
So, a suite of tasks takes 10.81 seconds in this example. I would always advise to verify written memories, so a more useful benchmark is the 2.008 s it took to write/verify our standard test file Fun fact: when you show in above table that urboot 1Mbit/s CH340 has an ATmega328P flash writing speed of 10738 Bytes/s this is only true for urboot bootloaders that provide a writepage function ( |
Beta Was this translation helpful? Give feedback.
-
Indeed this is much faster. Previous results: New results:
|
Beta Was this translation helpful? Give feedback.
-
Check out PR #1709 |
Beta Was this translation helpful? Give feedback.
-
@mcuee BTW, I get it that different projects use read/write speeds, eg, Ethernet, USB or communication chips. With microchip programming the typical user task is to upload & verify a sketch, upload and verify data to EEPROM or to backup a memory. Singling out memory write speed isn't helpful: for example, bootloaders in particular can decide whether to erase a page as part of the page write process (Optiboot does this) or they can decide to erase the flash (except obvs the bootloader) when avrdude issues a chip erase command before writing to flash. So, although the overall time is the same, in one example the write speed looks smaller than in the other approach. The other problem is that write time reported by avrdude is vvv small when the driver uses a cache (and the write speed would be phenomenal), but flushing the cache before closing the driver does all the hard work. So, all things considered, I have come to the conclusion that more often than not is is unhelpful or outright misleading to report memory write speed. The other bit with bootloaders is that there is, as virtually always, a trade-off between code space saving and time saving. The optiboot and urboot projects are firmly in the first corner, urboot actually more so than optiboot 😉. These projects know about tricks to save time, eg, the previously mentioned "smart" page erase or receiving data while erasing a page, but decided to save the needed code for more interesting features and/or leave flash for the application. See, for example, this comment by Bill Westfield a decade ago or so. |
Beta Was this translation helpful? Give feedback.
-
PR #1709
The reported times are realistic times with overhead of starting avrdude, resetting the board via DTR/RTS, establishing comms, including erasing the flash before writing/verifying the sketch and disengaging the chip. Once PR #1709 is merged, I will adopt it as well for benchmarking. Example test results under Linux, with ATmega328P (ATmega16U2 USB to Serial chip) and urboot.
|
Beta Was this translation helpful? Give feedback.
-
The lack of response from @stefanrueger either means you don't want to argue with me or you admit the fact that there is no chip erase on a bootloader. Technically, you can call anything anything, but chip erase should only reserved for a programmer, and it's absolutely not about whom is right or wrong, but about not to spread false and dumb info, and make people confused with the info you have provided. By definition, chip erase erases the whole chip, including the EEPROM unless the fuse is programmed to preserve the EEPROM, and its lock fuse; so a bootloader that does chip erase would delete itself, and it's a very wrong term. Instead, it should be called: App-erase, app-clear or anything else of your choosing, but definitely not chip erase. I don't need to read your code to know how it works. It could be a bug not to do a full app section erase because for example, if previous upload is 5k, and now a 4k hex file is uploaded to the MCU. The 1k residue from previous upload is not cleaned, and is still in the chip. While normally this is not an issue, In a rarely case, either a bug in the code or a memory leak, the MCU could jump into the 1k residue and struck there forever. That means not cleaning all previous upload is considered a bug, if that is the case for your bootloader. So an "chip erase" or app-erase should be mandatory because it's the correct way. You don't need to erase every application section pages with the app-erase command, a smarter approach to that problem would be 1, do a quick scan on pages with data, and determine what pages are to be erased; 2, then erase those page with content in it; I have yet to perfect the algorithm to do that correctly, so my bootloader is still under development. You want to do read before erase, because reading is faster than erasing, so here is about speed efficiency, but of course it's totally okay to ignore this new feature if size efficiency of your bootloader is your main concern. |
Beta Was this translation helpful? Give feedback.
-
Close this discussion and I will create a Wiki page to document new test results using |
Beta Was this translation helpful? Give feedback.
-
Discussions about Flash Read/Write benchmark, both programmers and bootloaders. EEPROM may be covered as well.
Note: speed is not the most important factor when choosing a programmer or bootloader. Stability may be more important. In terms of programmer, budget may play a part as well. In terms of bootloaders, code size can play a part as well.
This is the continuation from #1022.
Some general findings for avrdude 7.3 release (should be correct for older 7.0/7.1/7.2 release as well).
-b 2000000
)-B 0.25
vs-B 0.5
). It may still help the reading speed.My own tests will be focusing on the programmers and bootloader recommended in the FAQ.
https://github.com/avrdudes/avrdude/wiki/FAQ
I am new to avrdude and I do not have a programmer, what are the recommended programmers to be used with avrdude?
avrdude supports many programmers. Here are some examples of low cost and well-supported programmers.
I have got the programmer working. Now I want to try using bootloader. Which bootloader should I use?
Survey of AVR bootloaders:
We recommend urboot for classic AVR chips.
For xmega, you may want to try xboot (AVR109 based)
For UPDI parts, you may want to try optiboot_x and optiboot_dx.
If you use USB AVRs, you may want to try Caterina (AVR109 based) or FLIP1/FLIP2 (Atmel extension to USB DFU).
Beta Was this translation helpful? Give feedback.
All reactions