Thanks androidfanboy for the suggestion. In the 16MHz / 5V configuration this really solves the issue.
In the 8MHz / 3.3V configuration it still didn't work.
I tried Nich Gammon's great sketch Atmaga_Board_Detector from github .
It found the "ATmegaBOOT_168_atmega328" booloader, so I assumed the bootloader was working fine.
I guessed there was a problem with the power supply, but using another power supply didn't change it either.
Finally in this thread I found the suggestion to try MiniCore instead of manually adapting the boards.txt.
Using MiniCore it worked with 3.3V @ 8MHz. ![]()
So I analysed the differences between the board.txt files and figured out that the optiboot boards.txt uses 115200 as BAUD rate, whereas MiniCore uses 38400.
When I changed it to 115200 in MiniCore and used the optiboot_flash_atmega328p_115200_8000000L.hex file, the upload was broken again.
That leads me to the conclusion that it indeed is the optimistic BAUD rate setting in the optiboot boards.txt.
Well, wrong BAUD rate is an obvious error at serial communication ![]()
Big thanks to CrossRoads once again! ![]()