Is there a ready-made/tested sketch that will upload via stk500 serial?

I've seen sketches to upload bootloaders via ISP automatically without a computer.

Does anyone know if someone has written a sketch that will upload .hex files (ex, off an SD card) over serial through an STK500 bootloader?

The point here is that I want something I can connect to the 6-pin FTDI header, press a button, and have it attempt to upload a hex file that over serial. This is a test rig for testing that an ICSP-installed optiboot bootloader and the autoreset circuit and all on a board works. Doing it without the computer is a big help, because I'll be doing this to dozens of boards at a time.

If I had something that would handle the serial upload, even if it was designed for a specific board or something, I could handle modifying it to identify the chip and pick the appropriate hex file to upload, and have the SD card with a .hex file for every supported board. So I'd just connect to board, press button, verify that the LED blinks (it would just be blink sketches), then move to the next board.

For that matter, if anyone can refresh my memory about where that sketch to upload bootloaders automatically is, that would be sick, though I suspect this one I can find without much effort.

Thanks in advance

if anyone can refresh my memory about where that sketch to upload bootloaders automatically is

OptiLoader, by me.
As Improved by Adafruit
As improved by Nick Gammon

Thanks!

does it work for Arduino Mega with original bootloader?

does it work for Arduino Mega with original bootloader?

Optiloader only does optiboot; one of its limitations is that the code being programmed has to fit in RAM of the program (so, probably 1k max, even with modifications. As written it assumes 512bytes.)

I think Nick's and Adafruit's both store the images in flash and decode a page at a time (or don't need decoding), so they can handle arbitrary bootloaders. But they're not set up with the Mega Bootloader by default.

Interesting (I don't care about the mega bootloader - I'm planning to use it to bootload classic AVR attinys.

westfw:
OptiLoader, by me.
As Improved by Adafruit
As improved by Nick Gammon

this are the ISP flashers, not Serial over bootloader
:frowning:

I know this

(https://github.com/jandrassy/arduino-firmware-wifilink/wiki/lib/dfu.zip)
build from here
GitHub - ciminaghi/libdfu

So ideally, you're looking for something that connects to both ISP and Serial ports, detects the cpu type and uploads the correct bootloader, and then tests to make sure that the bootloader and associated stuff is working by uploading a test pattern over the serial port. And I guess it'd be nice if you could add additional bootloaders "on the fly"...

Seems like a useful idea...

I did find this: GitHub - franck102/SerialUploader: Serial upload sketch for Arduino
I have no idea how "abandoned" it is, or how well it works. Has a GPL2 license attached, so that's good.