... But if I had to guess this is about using IDE to restore a bootloader if you over wrote with AVRDude.
From what I understand, this could take hours to do?
I'm not sure if Makerbot writes the proper locks on the MCU, I do know someone else that does it with a smart programer so I believe it might be possible. ...
... For some reason I got the impression that using the Pi would be more like using a smart programer without having to spend the $60 ...
... I guess that was my thought in direction and didn't want to spend another $60-$80 on a smart programer ...
... But if a parallel programer is needed then I'm out of luck ...
... Or will that still need a smart programer? ...
... How much faster is the smart programmers, are they worth the money, or the $20 to build one from adafruit? ...
@Scott
There is no reason to use the expensive equipments. Burning the bootloader is a matter of a few seconds.
For successful writing bootloader you must perform the following essential steps:
1. Unlock bootloader section
2. Set fuses
3. Erase
4. Program bootloader into microcontroller
5. Lock the bootloader section so that it cannot be erased
For example, you can use from the command line directly the AVRDude.
Burn Arduino Mega 2560 bootloader with the USBaspfirst step - unlock fuses, erase, verify:
avrdude -c usbasp -p m2560 -B 0.5 -U lock:w:0x3F:m -U efuse:w:0xFD:m -U hfuse:w:0xD8:m -U lfuse:w:0xFF:m -e -v
the second step - write the bootloader, set the lock fuse, verify:
avrdude -c usbasp -p m2560 -B 0.5 -U flash:"stk500boot_v2_mega2560.hex":a -U lock:w:0x0f:m -v
It's all
FYI:
There are two "major" groups of memory protection bits:
- The
Memory Protection Lock Bits refer to two bits, LB2 and LB1.
- The
Bootloader Lock Bits refer to four bits: BLB12, BLB11, BLB02, and BLB01.
The
Memory Protection Lock Bits define what you're allowed to do using external programming hardware such as ISP or HVPP.
If LB1 is programmed, then you can no longer add new data the existing content in Flash or EEPROM using an external programmer.
If LB2 is programmed, then you can no longer read back existing Flash or EEPROM content using an external programmer.
The combination (LB1 = unprogrammed, LB2 = programmed) is invalid.
You can use an external programmer to totally erase everything (Flash, EEPROM... everything) in one fell swoop. In that case, you will be free to re-program the chip again with no restrictions.
The
Bootloader Lock Bits are further subdivided into two "minor" groups:
- BLB02 and BLB01: the "Application section" bootloader protection.
If BLB01 is programmed, then the bootloader cannot use the SPM instruction to write new data in the Application section of Flash.
If BLB02 is programmed, then the application cannot use the LPM instruction. (And therefore constant data tables, initializers, etc will be broken in C.)
- BLB12 and BLB11: the "Bootloader section" bootloader protection.
If BLB11 is programmed, then the bootloader cannot use the SPM instruction to overwrite itself.
If BLB12 is programmed, then the bootloader cannot use the LPM instruction. (And therefore it will be impossible to verify the success of subsequent bootloader upgrades.)
Best regards
Tomas