---- Note that it is actually hard to damage the bootloader in the microcontroller. Probably you just need Loopback (eg. if firmware upload was interrupted at a bad moment): http://www.vems.hu/wiki/index.php?page=GenBoard%2FFirmware%2FBootLoaderLoopback ---- It's normally not needed, and Don't do it unless absolutely needed. If you really want to upload an OLD bootloader (eg. swapped atmega after frying the original): The following procedure uploads the old non-crypto bootloader (as on a board purchased before 2011-03) As a consequence only very old firmwares will upload (eg. 1.1.94), but new firmware eg. 1.2.20 firmware will NOT upload. (until a "bootloader upgrade to new uhex type crypto bootloader" is made on an ISP-locked processor... the bootloader upgrade procedure: http://vems.hu/vt/help/v3/general/bootloader_upgrade.html ---- Notes: * If avrdude complains about verify error @ 0x10000 neglect that. (but check that fuses are set as intended). * don't forget to remove ISP before attempting RS232 communications (ISP interferes with RS232 comm). ---- The bigger main_idxxxx_......hex is bootload + firmware bundle (try this first), Assuming -c usbtiny cable (-c bsd or -c stk200 for homemade parallel port cables): avrdude -v -c usbtiny -p m128 -e -U flash:w:main_id..._fw1_1_94_BootUpdate.hex -U lfuse:w:0x2f:m -U hfuse:w:0xc4:m -U efuse:w:0xff:m -U lock:w:0xef:m isp1.bat and isp2.bat might be of use (but might need to consult avrdude manual anyway; Sometimes avrdude reports mismatch at 0x10000 and the bootupgrade still works) If in doubt, please see http://www.vems.hu/wiki/index.php?page=GenBoard%2FFirmware%2FUpload or http://www.vems.hu/wiki/index.php?page=GenBoard%2FFirmware%2FBootLoader and the avrdude manual. In short you will need avrdude or uisp program, and an https://shop.vems.hu/catalog/cable-p-165.html usbtiny or a simple homemade 5-wire "bsd" or "stk200" compatible parallel-port cable to upload the bootloader via ISP connection. Some contributed comments (step-by-step instructions): http://www.vems.hu/wiki/index.php?page=MembersPage%2FMattiasSandgren%2FNickesBMW%2FAvrBootCode REMEMBER to also set the so called FUSES ! fuse_l=2f fuse_h=c4 and fuse_e=ff fuses ... After flash verification, set lock=3C uisp command line options (not needed if avrdude command is used): uisp -dprog=stk200 --erase uisp -dprog=stk200 --upload if=boot/main.hex --verify uisp -dprog=stk200 --wr_fuse_l=2f uisp -dprog=stk200 --wr_fuse_h=c4 uisp -dprog=stk200 --wr_fuse_e=ff uisp -dprog=stk200 --wr_lock=3c avrdude command line options: avrdude -p m128 -c stk200 -e -U flash:w:hexfilename.hex ... avrdude ... lock, l h and e fuses ... (see avrdude manual and terminal mode avrdude -t), for usbtiny, bsd and stk200 cables respectively: avrdude -v -c usbtiny -p m128 -U lfuse:w:0x2f:m -U hfuse:w:0xc4:m -U efuse:w:0xff:m -U lock:w:0x3c:m avrdude -v -c bsd -p m128 -U lfuse:w:0x2f:m -U hfuse:w:0xc4:m -U efuse:w:0xff:m -U lock:w:0x3c:m avrdude -v -c stk200 -p m128 -U lfuse:w:0x2f:m -U hfuse:w:0xc4:m -U efuse:w:0xff:m -U lock:w:0x3c:m ---- For bootloader uploading it's highly recommended to follow the safety precautions (as with firmware upgrade) eg disable fuel-pump and ignition (remove fuses) and disconnect injector-connectors. More details: http://www.vems.hu/wiki/index.php?page=GenBoard%2FUnderDevelopment%2FFirmwareChanges