Create a bespoke bootloader programmer for gammaBoot trinkets
This commit is contained in:
parent
dab99c0823
commit
a536a01ebf
|
@ -1458,6 +1458,23 @@ programmer
|
||||||
usbpid = 0x0c9f;
|
usbpid = 0x0c9f;
|
||||||
;
|
;
|
||||||
|
|
||||||
|
#------------------------------------------------------------
|
||||||
|
# gemmaBoot
|
||||||
|
#------------------------------------------------------------
|
||||||
|
|
||||||
|
# Serving the Gemma bootloader
|
||||||
|
# https://github.com/adafruit/Adafruit-Trinket-Gemma-Bootloader
|
||||||
|
|
||||||
|
programmer
|
||||||
|
id = "gemmaBoot";
|
||||||
|
desc = "Gemma bootloader disguised as USBtiny";
|
||||||
|
type = "usbtiny";
|
||||||
|
prog_modes = PM_SPM;
|
||||||
|
connection_type = usb;
|
||||||
|
usbvid = 0x2341;
|
||||||
|
usbpid = 0x0105;
|
||||||
|
;
|
||||||
|
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
# arduinoisp
|
# arduinoisp
|
||||||
#------------------------------------------------------------
|
#------------------------------------------------------------
|
||||||
|
|
|
@ -618,7 +618,13 @@ static int usbtiny_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||||
if (! usbtiny_avr_op( pgm, p, AVR_OP_CHIP_ERASE, res )) {
|
if (! usbtiny_avr_op( pgm, p, AVR_OP_CHIP_ERASE, res )) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
usleep( p->chip_erase_delay );
|
|
||||||
|
if(pgm->prog_modes & PM_SPM) { // Talking to bootloader directly
|
||||||
|
AVRMEM *fl = avr_locate_mem(p, "flash");
|
||||||
|
// Estimated time it takes to erase all pages in bootloader
|
||||||
|
usleep(p->chip_erase_delay * (fl? fl->num_pages: 999));
|
||||||
|
} else
|
||||||
|
usleep(p->chip_erase_delay);
|
||||||
|
|
||||||
// prepare for further instruction
|
// prepare for further instruction
|
||||||
pgm->initialize(pgm, p);
|
pgm->initialize(pgm, p);
|
||||||
|
|
Loading…
Reference in New Issue