Author Topic: Is there any way to remove the 5 seconds programming delay at powerup ?  (Read 47057 times)

Rimbaldo

  • Newbie
  • *
  • Posts: 2
Re: Is there any way to remove the 5 seconds programming delay at powerup ?
« Reply #60 on: September 14, 2019, 08:51:25 pm »
I know it’s an old topic, but would this changing bootloader method work on the Digispark Pro, so it could boot without waiting 5 seconds? Do they share the same bootloader? If not, is there an workaround to the Digispark Pro, to allow it to boot without waiting those 5 seconds?

Thanks!

granzeier

  • Jr. Member
  • **
  • Posts: 60
Re: Is there any way to remove the 5 seconds programming delay at powerup ?
« Reply #61 on: September 15, 2019, 03:08:07 am »
I (and possibly most others here) do not have, nor know much about, the Digispark Pro. You will probably get better help if you go to the Pro Support board (http://digistump.com/board/index.php/board,19.0.html,) rather than this board for the Original.

velodrom

  • Newbie
  • *
  • Posts: 1
Re: Is there any way to remove the 5 seconds programming delay at powerup ?
« Reply #62 on: October 12, 2019, 01:48:30 pm »
Hi. I'm having challenges changing the default bootloader activation pin from PB0. Any help would be appreciated, thanks!

I'm working with a Digispark Attiny85 board. After several attempts I was finally able to get rid of the 5 second bootloader wait (steps how I did this are listed below). I even later managed to enter bootloader by shorting PB0 to ground, and upload new applications with Arduino IDE (hooray). However, what does not seem to work is changing the bootloader activation pin (PB0). I need PB0 (and PB2) for I2C purposes in my project, so I would rather use PB1 or PB4 to enter bootloader. What I've done to change the pin is
  • clone micronucleus repo (https://github.com/micronucleus/micronucleus.git)
  • modify firmware/configuration/t85_default/bootloaderconfig.h as illustrated in a code snippet below
  • compile new bootloader .hex file using make clean; make CONFIG=t85_default
  • use an Arduino Uno as an ISP programmer to connect to the Digispark Attiny85
  • use avrdude to change fuse settings and flash the new .hex file (this turned out to be a great guide). If someone is reading this to repeat it, avrdude is located under your Arduino install path which defaults to: Program Files (x86)\Arduino\hardware\tools\avr\bin.
  • upload a project to the board using Arduino IDE, meaning disconnecting the board from Arduino Uno and plugging it in to a USB port
  • repeat step 6. with the jumper to verify I still have access to bootloader
The avrdude command that worked for me was:
Code: [Select]
avrdude.exe -c stk500v1 -p attiny85 -P com5 -U flash:w:..\t85_default.hex -U lfuse:w:0xf1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m -v -C ..\etc\avrdude.conf -b 19200
My diff to bootloaderconfig.h:
Code: [Select]
diff --git a/firmware/configuration/t85_default/bootloaderconfig.h b/firmware/configuration/t85_default/bootloaderconfig.h
index 9b3ac63..6de518f 100644
--- a/firmware/configuration/t85_default/bootloaderconfig.h
+++ b/firmware/configuration/t85_default/bootloaderconfig.h
@@ -107,9 +107,9 @@
  *
  */

-#define ENTRYMODE ENTRY_ALWAYS
+#define ENTRYMODE ENTRY_JUMPER

-#define JUMPER_PIN    PB0
+#define JUMPER_PIN    PB1
 #define JUMPER_PORT   PORTB
 #define JUMPER_DDR    DDRB
 #define JUMPER_INP    PINB

I'm wondering do I need to change eg. JUMPER_INP to something else if I want to use PB1 as the entry pin? Why I'm saying this is that the bootloaderconfig.h seems to define a bootLoaderStartCondition() function like so:
Code: [Select]
#define bootLoaderStartCondition() (!(JUMPER_INP&_BV(JUMPER_PIN)))

Thanks already in advance for your help!
« Last Edit: October 12, 2019, 01:58:06 pm by velodrom »