Digistump Forums

The Digispark => Digispark (Original) Support => Topic started by: DeuxVis on February 07, 2013, 03:32:27 am

Title: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: DeuxVis on February 07, 2013, 03:32:27 am
I understand that delay is here to allow uploading of its executable code to the digispark, but I have an use in mind which would require a digispark to "start working" as soon as it is powered up.

Is there any existing way to skip that pause (by pulling a pin down or low, etc) or do I need to go tinker with the bootloader to achieve that ?

Thanks for your attention.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: digistump on February 07, 2013, 01:20:39 pm
You'd have to remove or change the bootloader for that - which means you'll need to use a HVSP programmer since the reset pin is disabled - we'll hopefully have a chance to provide some tutorials on how to do this, but to be honest we have a long list before we get to that
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on February 07, 2013, 03:02:37 pm
... you don't need a high voltage serial programmer to update the bootloader. the micronucleus upgrader tool can do this just fine.


@DeuxVis: If you let me know what you have in mind for how you'd like to signal to your digispark that it should skip bootloader, I can generate a version of the bootloader which does that and explain how to do the mod without needing any special tools. Keep in mind that replacing your bootloader is unsupported by digistump, so if something goes wrong you can't go to them for help, but I am quite confident in the upgrade mechanism and would do some testing on my end first.


Depending on your application, you might like the bootloader to pull a certain pin high then check if it's low, so you could hook a button up to it which you can hold down while plugging it in to enable programming mode. I'd probably push the duration up from 5 seconds to 10 seconds or even disable the timeout entirely.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: semicolo on February 07, 2013, 05:58:47 pm
Could we use a standard avrisp (or an arduino with the arduino-isp sketch) to restor the bootloader if something goes wrong?
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on February 07, 2013, 06:24:08 pm
No, you need a high voltage serial programmer, or you'd need to make the attiny fuse resetter: https://sites.google.com/site/wayneholder/attiny-fuse-reset You'll need a 12v battery or DC power supply to run this project. The voltage level needs to be between 11.5 and 12.5v.



The digispark comes with the reset pin disabled so you get six pins to play with in your programs instead of five, which is why an ISP cannot be used to reprogram a digispark (unless treated with fuse resetter first). Once you're done replacing your bootloader, you can use the ISP to restore the fuses and regain use of the reset pin.


That said, I would never recommend someone install an upgrader program which I haven't tested myself on a digispark and found to work. I have a collection of handmade digispark-equivilents with reset pin enabled which I use to test upgrader programs work correctly so that I can easily restore them to previous bootloader versions and quickly test different combinations. These digispark-analogues have an ISP attached so I can also dump the firmware and check everything uploaded correctly. I'm confident in my upgrader program - I've never observed it fail to work. The main issue it can have is if people upgrade the bootloader to a version which doesn't work well with their computer, but I think version 1.05 solves this reliability problem and still gives you an extra 66 bytes of program space (though you need to mod the digispark arduino program slightly to be able to use it - just changing a number in a text file)


So in summary, I don't expect you to need any sort of programmer tool to upgrade micronucleus from one version to another, or even to change the bootloader to a different type, like a serial bootloader.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: digistump on February 07, 2013, 07:20:41 pm
@Bluebie - is 1.05 compatible with the upload tool we are shipping with the Digispark arduino package? We're down to 50 pre-orders to ship and almost done packing some huge wholesale orders - after that I am very eager to test the upgrader as well, and while I'm not sure we'll ever remove the "If you brick it we won't replace it" warning -  I don't know any company would, I'd certainly like to add to the wiki how to upgrade and actively encourage it for those who want to.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on February 07, 2013, 09:26:21 pm
Yep 1.05 works fine with the upload tool in your Arduino software. The commandline tool was mostly tested with 1.04 and the 1.02 support is actually through a version-specific bug workaround. If you find 1.05 reliable I think it'd be a better version to ship with in the future- less bugs, a little more program space, cleaner spec-compliant programming protocol.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: DeuxVis on February 08, 2013, 12:57:10 am
First, thank you all for the informative replys.


Bluebie, your idea seems fine, a pushbutton - or a simple on/off switch on any unused pin would do.
It would be great if you can do that modified bootloader for me.

To clarify the need, I'm going to build a battery powered door bell. The digispark will generate some sound, and also control the power to the amplifiying circuit through a relay to spare battery life. So the door button would just send some power up to the digispark, which would then need to immediately start keeping that power on for some time - and start ringing too, a 5 seconds delay before a button push turns into a ring would be very effective to repel visitors.

So for pin choice, skipping anything pwm-able (wanna make noise) and I2C needed (in case I want to play samples out of some form of external memory in a future revision).
I'd say go for P5.

I understand the updater process is not digistump supported. I'm still ok with trying it - I bought 5 units just in case bricking happens. This is one of the nice thing with those cheap beasts : you can experiment and don't lose that much if you do errors.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on February 08, 2013, 01:56:32 am
Alright. I'll setup a version of micronucleus 1.05 which enables pullup on pin 5 then checks if the pin is low, and if it is, enters bootloader. After I've tested it a few times I'll post again with details on how to do the brain surgery. :)
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on February 08, 2013, 03:04:25 am
Alright, I've made this version of the micronucleus bootloader. It pulls D5 high, waits 10 milliseconds, checks if the pin is pulled low by a button or something, then if it is it enters bootloader, otherwise it immediately runs the user program. To program the digispark after installing this upgrade you can connect a jumper wire directly from D5 to the GND connection point on the spark before plugging it in. Keep in mind pressing a button attached to this wire will not reset the spark - you need to unplug it and plug it back in while holding the button down.


To replace the bootloader, right click, download linked file: https://raw.github.com/Bluebie/micronucleus-t85/DeuxVis-button-to-program/upgrade/releases/deuxvis-1.05-digispark-d5-progbutton.hex to somewhere on your computer. Next, you'll need to use the 'micronucleus' program to upload this hex file to your digispark. The micronucleus program is bundled in with the digispark arduino software. I'm not totally sure where to find the files specifically on linux or windows, but I have made a tutorial video for mac which will at least give a general idea. http://vimeo.com/57036841


Just be sure to ignore the stuff about downloading bits of littlewire, and when the video drags main.hex on to the terminal, instead drag on deuxvis-1.05-digispark-d5-progbutton.hex


If there's any sort of upload error, try it again, otherwise once it's succeeded start counting - after it's had ten seconds to process, unplug the digispark, connect pin5 to ground, plug it in, and see if you can upload a program using the digispark arduino software. If all went according to plan, it will take the upload happily. If it doesn't work, try a few more times (unplugging and replugging the digispark too) and it'll start working happily. :)


If you have any trouble or want any extra changes, do let me know ^_^ <3


Oh and if you want to revert to the old-style bootloader, I whole heartedly endorse uploading this hex file: https://github.com/Bluebie/micronucleus-t85/blob/master/upgrade/releases/micronucleus-1.05-upgrade.hex - it has the usual five second timeout mechanism. I've upgraded one of my own regular digisparks via the deuxvis button upgrader linked before and then this regular 1.05 version and both upgrades (crossgrades really..) worked fine, so you shouldn't have any trouble reverting your digispark to the normal functionality ^_^
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: DeuxVis on February 08, 2013, 06:45:13 am
Thanks a lot Bluebie, will try that later tonight when back from work.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: DeuxVis on February 08, 2013, 11:19:17 am
Works !

Uploading new bootloader : check (after a couple of aborted micronucleus runs)
Uploading new code with P5 grounded : check
Immediately running when P5 is not grounded : check
Learning you can drag a file onto a terminal to copy-paste its path : check ;)

Thanks a lot Bluebie. Dunno how I can express you my gratitude, if you ever need some custom made plastic parts for a project, my 3D printer is yours.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on February 08, 2013, 03:13:26 pm
Wow that's awesome! I'll probably take you up on that some time! <3 ^_^
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Mark on February 09, 2013, 07:19:09 pm
Bluebie
Thanks for the new bootloader, it works great.

For windows, here is a how to do it:-

Firstly make sure your device is recognised by Windows, and that you have a means of connecting P5 to GND (ie ...fit the header)

Download the file https://raw.github.com/Bluebie/micronucleus-t85/DeuxVis-button-to-program/upgrade/releases/deuxvis-1.05-digispark-d5-progbutton.hex (https://raw.github.com/Bluebie/micronucleus-t85/DeuxVis-button-to-program/upgrade/releases/deuxvis-1.05-digispark-d5-progbutton.hex) and save it in a known place on your computer.

  Open a Command Prompt (Start. All programs. Accessories ...for Win7)
  Open File Explorer ( right click on Start select Open Windows Explorer) and navigate to the directory you unzipped Digispark IDE in.
  Locate the zip file micronucleus-t85-master.zip and right click, select Extract All.
  Navigate to the micronucleus.exe file  (...\micronucleus-t85-master\micronucleus-t85-master\commandline\builds\Windows )
  Drag it onto the Command Prompt window and press space.
  Navigate back to where you saved the .hex file above, and drag that onto the Command Prompt window
    (At this stage you'll have a really long string that shows the path and name of the .exe with space and then the path and name of the hex file.)
  Press enter and it should ask you to plug the device in.

  Plug it in, and it should start.
  Don't worry about the messages as long as the last one is ..
writing: 100% complete
 >> Micronucleus done. Thank you!


As Jenna said
Quote
- after it's had ten seconds to process, unplug the digispark, connect pin5 to ground, plug it in, and see if you can upload a program using the digispark arduino software.

Cheers
Mark
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: bboyes on February 10, 2013, 11:00:02 am
Wow, thanks to you all for making this mod - I had wondered the same thing, nice to know it is an option now. I have a similar idea for some off the grid lighting where the 'on' switch would first power up the 'spark and then it would turn on the lights, so a faster startup would be essential there too.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on February 10, 2013, 08:00:32 pm
Glad you guys are finding it useful!  ;D  <3
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: XtremeIN on March 09, 2013, 12:18:46 am
Hello all,
I have messing around with removing the bootloader for sometime and I can not get it to work.  I have Vista and it took some searching to figure out how to get the needed code in the Command Prompt window (Vista does not allow drag and drop to/in the Command Prompt window). Once I got past that everything seemed to go smooth until I tested my DS. The code run in the Command Prompt seemed to work fine. It tried a couple of times and finally gave me a 100% complete. I downloaded a simple sketch that blinks the internal LED on PIN1.  It does nothing. Yes I unplugged the DS after changing the bootloader. Yes I had a jumper going from PIN 5 to GND. with no luck getting the sketch to work I tried it on a stock DS, works fine.  After a few more hours of trying with no avail I decided to revert the DS back to the original bootloader. SAME SENEARO.... Command Prompt gave a 100% complete and I cannot get the sketch to run.

Please help
Micheal
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Mark on March 09, 2013, 12:40:08 pm
Michael

Out of interest did you wait 10 seconds after the new bootloader upload, before unplugging.?
Jenna made the comment, and I assume it was for the bootloader to finish internally writing.

Mark
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on March 10, 2013, 08:44:28 pm
Yep you need to give it a few seconds to rewrite the bootloader. Please understand that you are not "removing the bootloader", you are just replacing it with a different version which uses a button or jumper instead of a delay. I don't know why your blink sketches wouldn't be working, but it sounds like you're having a lot of trouble uploading programs to your digispark regardless?
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: XtremeIN on March 10, 2013, 10:45:15 pm
I waited atleast 30 seconds to make sure it had time to rewrite the bootloader. I went back to rewatch the video and I noticed some thing. I inserted a stock DigiSpark then removed it and replaced it with the alt bootloader DS, they both show the same in the Device Manager......
 
Micheal
 
 
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on March 11, 2013, 12:41:07 am
It's the same bootloader, so it shows up as the same device, it is just configured slightly differently to use a button instead of a timeout. This is the expected behaviour.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Mark on March 11, 2013, 04:27:44 am
Michael
You say you are using Vista.
I wonder if there is a permissions issue.

I haven't had or touched Vista, but is it possible to start the Command Prompt with Administrator rights.?
I'm wondering if its some form of permissions issue.
The fact it comes back with writing and the 100% is puzzling.

Has anyone else running Vista tried the new bootloader.?

Mark
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: XtremeIN on March 11, 2013, 10:10:59 pm
Thanks for the info Jenna.
 
Mike, I tried running the Command Promt in as Admin, same effect......
 
Micheal
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Mark on March 11, 2013, 11:32:20 pm
Michael.
Answered your PM ... probably not a lot of help to you.

This is a nuisance I know, but can we step through the process, just to (a) be sure, (b) try to isolate the cause (c) help someone in future that might have the same issue?


I'm making the assumption that once you've programmed the DS, you remove the jumper from Pin5 ??? ?
This takes it out of 'bootload mode' to 'run my sketch as soon as I'm powered' mode.


If we can verify the following.
1. Does a normal DS cause the computer to make a noise when its plugged in.?
2. Does the revised DS also make a noise.?
3. Does the revised DS make a noise if the jumper from Pin5 to ground is in.? (means its accepted the new bootloader)
4. Is the Pin5 lead/jumper/wire a good fit in the socket.? (A slight kink will help)
5. Is the slight wear pattern on the USB aligned with the gold pcb tracks.?
6. Is the wear present on all 4 pins.?
7. Can you program sketches into an unmodified DS, without any issues.?
8. When the DS is present, what CommPort is it using.?

A simple Yes/No unless it needs more is fine.


In the meantime I'll ask some questions about Vista, and why it appears to be so different.


Mark
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on March 11, 2013, 11:36:44 pm
Digisparks do not use comm ports. The Serial Port setting in the digispark arduino software is not used by any aspect of the program uploading. The bootloader works via raw USB messages.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Mark on March 12, 2013, 12:50:16 am
Oops true.

I'll edit it.
It's a strange problem.
I would have thought that Vista would have rejected the program and not come up with the 100%, otherwise it should work.

Its likely to be something simple, as I know your bootloader works...

Mark
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: XtremeIN on March 13, 2013, 12:12:24 am
 OK, so now I have a new issue.....
 
 I tried to change the bootloader using my wifes computer (Windows 7).  Plugged in the DS that I have been trying to get working with the new BL. The computer made the ding sound, but it showed up as an Unknown Device. After several failed attempts to correct the drivers I gave up. I then tried an stock DS. Works fine. USB see its, knows what it is.  I then went on to trying to update the BL on this DS.  Using the drag and drop method I placed the files into the Command Prompt and hit enter. The Command Prompt then said please plug in device. I plugged in the older DS, the computer dinged, said not recognized and did nothing. Removed that DS and placed in a stock DS, it started rewriting the BL. After a few tries it said 100%. While waiting the recommended 10 sec the computed then dinged again and said it was now an unrecognized device.........
 
 Micheal
 
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Mark on March 13, 2013, 03:11:23 am
Okay I know this is getting frustrating...

1. On the wife's Laptop did you run the driver  .....\DigiSpark\Digispark - Windows Driver\InstallDriver.exe  before plugging in any DS.?

Any chance you can go through the 7 questions in my post so we can establish a benchmark?

Any time a device is unplugged from a USB, windows knows, and when a device is detected it wants to run to the internet to find a driver .. and it fails because they aren't there in www land, then the 5 sec time disconnects the device.

Now you have 2 DS (in theory) that have a 'no delay' bootloader, can you program either once you insert the wire in Pin5 and plug in.??



mark
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Sergio on March 13, 2013, 03:40:14 am
From your post it appears the digisparks only malfunction "after" you download the .hex file.
I would check the .hex bootloader file you have saved from github does not have "garbage" characters or it is truncated. Open it in notepad (not wordpad) and check that the first and last line match the one online. Also, are you using 1.05 or 1.06 bootloader?

Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: digistump on March 13, 2013, 10:06:07 am
It would make sense it would show up as an unknown device unless you are connecting P5 to GND - since it won't run the bootloader anyway - are you connecting P5 to ground when you try to program it?
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on March 13, 2013, 06:44:53 pm
.hex files have checksums, so it probably isn't garbage, and if it was a html file saved to disk or something like that it wouldn't program it even if it were reading it in raw mode because it would certainly be too big for the chip. I guess truncation is plausible.
Title: Success, mostly…….
Post by: XtremeIN on March 14, 2013, 12:17:46 am
 After reading digistumps post I could not recall using the jumper on the DS that I reflashed using the Windows 7 machine. So, I installed the jumper and plugged it in. After a few seconds it started searching for/installing the driver. After about a minute it had successfully installed drivers and recognized the DS. I then wrote the Starter Sketch to it. After removing the DS and the jumper I reinserted the DS and it works perfectly. THANK YOU everyone for working through this with me.  As far I as I know I did both DS’s the same way only difference was the machine/software.  I am curious if it was me or is there something going on in Vista. Either way, I am just glad to have gotten it to work.  Again, THANK YOU all so very much. Now back to making things blink :) !!!!!!
Micheal
Any suggestions as what to do with the one I "messed up"?
Anyone want to take a crack at it.........

 
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on March 14, 2013, 12:34:40 am
Yay! But please keep this thread on topic - only for talking about things specifically related to the jumper bootloader.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on May 19, 2013, 06:45:30 pm
Because I am stoopid, I broke all your digisparks. Please install this update ASAP if you've been using any version of the jumper firmware http://digistump.com/board/index.php/topic,960.msg3530.html#new


Previous versions create short circuits, which will break your digisparks sooner or later if not resolved.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Norbert on August 14, 2013, 04:40:31 am
Successfully managed to use the micronucleus-1.06-jumper-v2.hex with my DIY Digispark after some troubles.

the key issue:
-  my fuses bit setting was E1 DD FE which did not work

( changed to E1 5D FE and it works now )

I flashed firmware and fuses with AVR Studio 5.0.1223 and programmer AVRISP mkII ( clone from http://www.ullihome.de/ ) on Windows XP.

ATTENTION:
There is still a dangerous issue with with this version.

If I make the connection between ground and resetpin P5 to activate the bootloader
uploading from Arduino IDE works fine
but
right after the flashing Digispark is starting this new software.

This start must be avoided as the reset pin is still fixed to ground at that moment.
( if your application uses P5 as an output line there will be a problem )

It would be better to restart from scratch ( in this case restart the bootloader )
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on August 14, 2013, 04:51:22 am
If you're worried your program will make short circuits when it runs, connect the P5 to ground using a 250 to 2000 Ohm resistor - then the pin in output mode will never source or sink enough current to cause any problems, but it should still be detected correctly. Hope this helps! Modifying the IDE to detect jumper bootloaders and not ask them to launch the program would be too hard I think, and modifying the bootloader to selectively ignore specific commands because of idiosyncracies of how the digispark IDE is configured would be too hacky I think. Resistor seems better. Maybe in some future version of the digispark IDE there will be a setting for if the program should run immediately after upload. It's also possible future versions of the IDE could automatically quick boot the bootloader in to the program to reduce 5 seconds to around 1 second when the IDE is open..  Just kooky ideas for now.


If you're not using arduino stuff, just omit the --run option when running the micronucleus tool and it wont ask the chip to run the app after the upload is done - staying in bootloader forever instead.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: jaghvi on August 24, 2013, 06:39:53 am
This is strange
I dont have digispark but a raw attiny85 .I burn this hex file to remove delay of 5 seconds.
When I connect reset pin (pin5) with GND ,it wont detect but if I remove it detects very well.
But now when I upload the sketches I don't have to unplug my circuit and replug it .I can  upload without deplugging it .
and also my fuse settings are e1 ,dd ,fe meaning that my reset pin is disabled ?do i have to enable it ??
I have another attiny85 on which I have set my fuses to be e1,5d,fe ?should I put this hex file on this ??
Thanks bluebie for ur support btw
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: jaghvi on August 24, 2013, 06:52:26 am
and also if I disconnect the device now and plug it in , my programme doesnt run though my device is detected :'(
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Bluebie on August 24, 2013, 07:40:25 am
The jumper version uses pin 5 - the "reset" pin - so if you install it on to a raw attiny85 which has not been reconfigured to disable the reset pin (so it can be used as IO instead, but cannot be programmed using an ISP device), it should work, but if not reconfigured like that, connecting reset to ground just resets the chip - nothing to do with bootloader. Also note that the clock source must be set to PLL, to get the needed 16mhz clock signal, and ckdiv8 must not be enabled.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: jaghvi on August 24, 2013, 08:03:52 am
@bluebie then why now I dont have to unplug the device while programming and neither did I connect reset and ground .I haven't changed the fuses , just that my reset is disabled.
and my clockdiv8 is disabled too.
If unplugged,after replugging  my device does get recognized but digiterm cant read data ,it keeps looking for the device.
http://digistump.com/board/index.php?topic=123.0 (http://digistump.com/board/index.php?topic=123.0) this is what fuse settings I have been using for all my projects.


@digistump please tell the details of fuse setting u have used
I  am using l:e1 h:dd e:fe
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: digistump on August 24, 2013, 10:53:50 am
lfuse:w:0xe1:m -U efuse:w:0xfe:m -U hfuse:w:0x5d:m
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: jaghvi on August 24, 2013, 11:26:08 pm
1 : was using your previous bootloader 1.05.hex (impatient me ,didn't go through entire forum)
but despite using the upgraded version it didn't work when my fuses were still set to reset enabled (I could programme it with ISP)


But
Now it's working
used upgraded version and set the fuses so that reset is disabled (enabled as i/o)
PS:I removed my 5 seconds delay to read a temp sensor immediately for real time plot :)
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: germ on October 14, 2013, 01:58:36 pm
So I'm about to put my latest project together. I need to remove the startup delay, and also get the power usage down.
Where do I get the files for the bootloader? The link is rather dead.
Also, if I destroy the power LED, will that break something or save me power?
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: digistump on October 14, 2013, 03:33:31 pm
Link to file: http://digistump.com/board/index.php/topic,960.msg3530.html (http://digistump.com/board/index.php/topic,960.msg3530.html)


Removing the power LED wills ave power, won't break anything - it was designed to allow for removal without aaffecting anyhting else.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: bobricius on October 14, 2013, 11:43:04 pm
I tested gemma boot from adafruit .... if is plugged in usb led flashing 10 seconds, if only power is applied program start immediately.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: tom-englert on September 18, 2015, 11:02:41 am
This seems to be exactly what I need - however all the links are outdated.
Can someone help me to find the latest hex files that remove the 5sec delay?
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: tom-englert on September 19, 2015, 03:06:03 am
I think I figured out the file locations by my own:
https://github.com/embedded-creations/micronucleus-t85/tree/master/upgrade/releases
and
https://github.com/micronucleus/micronucleus/tree/master/commandline/builds/Windows

But now I have another problem:
- I can change the bootloader, that works fine
- I can upload my program with Arduino, works fine, too
- After uploading, my program starts immediately, and works fine
- But after restarting my digispark nothing happens, my program does not start.

I have tried all boot loaders, with and without delay, but none of them seem to work

@bluebie any idea what I did wrong?
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: tom-englert on September 26, 2015, 10:48:07 pm
Finally I found the working version with jumper at PB0:
https://github.com/micronucleus/micronucleus/tree/v1.11/upgrade/releases
micronucleus-1.11-entry-jumper-pb0-upgrade.hex
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: PeterV on October 29, 2015, 05:38:27 pm
I can't get this to work. Tried all firmwares from this:
https://github.com/micronucleus/micronucleus/tree/v1.11/upgrade/releases

The micronucleus.exe displays
writing: 100% complete
>> Micronucleus done. Thank you!

I waited minutes before disconnecting, but it looks like just the same firmware all over again.
It doesn't matter if I burn one with jumper or just a normal. After disconnecting and connecting it boots into development mode and doesn't run the app.

When I use arduino to upload a program, it uploads fine and the program runs fine until I disconnect, and it never runs again.

Any way to reset my firmware?
I'm really desperate.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: yoh-there2 on November 22, 2015, 09:43:59 am
Peter, sorry, a bit late to reply but you probably forgot to add the --run option to the command line. Been there, done that.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Grezzo on December 14, 2015, 06:06:56 am
Sorry to resurrect and old thread, but I think this is the right place to post...

I tried updating the firmware to micronucleus-1.06-jumper-v2-upgrade.hex and it appeared to work, but I wasn't able to program it using arduino IDE, even if I connected P5 to GND as I plugged it in.

I then updated to micronucleus-1.06-upgrade.hex, and was able to program it using the arduino IDE.

I then tried switching back and forth a few times, and now it doesn't work at all. I can't even change the firmware any more. As soon as I plug it in, Windows says that it doesn't recognise it, regardless of whether I have P5 connected to GND as I plug it in (which looks like it's skipping the bootloader - right?)

Does it sound like I've buggered the firmware upload somehow, or does it sound like a hardware failure? Am I shorting the right pins? Do I need to try to use an arduino to update it using ISP mode?

Thanks in advance for any help
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Grezzo on December 14, 2015, 09:32:50 am
I think it's probably beyond my current ability to fix this because the attiny is soldered to the board and appears to no longer have a working micronucleus on it.

Oh well, at least they are cheap.

I've ordered a replacement, but I would like to upgrade the firmware on the new one to remove the 5 second delay, so I would like to know what is likely to have gone wrong with this one, so I can try to avoid it in future.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: smartynov on December 20, 2015, 05:00:19 pm
Sorry to resurrect and old thread, but I think this is the right place to post...

I tried updating the firmware to micronucleus-1.06-jumper-v2-upgrade.hex and it appeared to work, but I wasn't able to program it using arduino IDE, even if I connected P5 to GND as I plugged it in.

I'm not sure about v1.06, but I micronucleus-1.11-entry-jumper-pb0-upgrade.hex (https://github.com/micronucleus/micronucleus/blob/v1.11/upgrade/releases/micronucleus-1.11-entry-jumper-pb0-upgrade.hex) requires P0 to be connected to the ground for programming, not P5. I tried it on my and it works fine.

Make sure you first connect P0 to GND, then start uploading from IDE, and then connect digispark to USB. Make sure you have a good contact between P0 and GND. If uploading of program fails (it fails sometimes), just try once more.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: DeuxVis on January 25, 2016, 04:45:07 am
FYI that thread explains how to get a recent micronucleus firmware with the jumper programming scheme on your digispark : http://digistump.com/board/index.php/topic,1868.msg2555.html
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: JS7777 on February 15, 2017, 12:57:08 pm
Hello,

got this message when uploading micronucleus-1.06-jumper-v2.hex with micronucleus.exe :

Program file is 1838 bytes too big for the bootloader!

i don't understand, anyone ?

Regards
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: JS7777 on February 16, 2017, 12:27:46 pm
Got it fix because i took the wrong .hex, it should be micronucleus-1.06-jumper-v2-upgrade.hex and not micronucleus-1.06-jumper-v2.hex.

But as soon as I plug it in with pin5 to ground, Windows says that it doesn't recognise it. if i don't connect p5 it goes to program mode. So it's all messed up.

micronucleus-1.11-entry-jumper-pb0-upgrade.hex works fine.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Fardenco on February 18, 2017, 04:43:04 pm
For me the easiest way is either to use the modified bootloader that wait for programming only if an input is grounded (you can find it previously on this thread), or if you need to free memory by removing the bootloader, just reset the hv fuses and use a usbasp with a soic8 clip like this one
(http://static4.tme.eu/products_pics/e/3/6/e36adcd075caa8f93a98788a0c8e950d/prime_presentation/prime_presentation_pres_0000.jpg)
to come directly around the chip to flash it.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: JS7777 on March 09, 2017, 12:43:48 pm
Thanks

I'm finding the source code for micronucleus-1.11-entry-jumper-pb0-upgrade.hex

Make file etc...
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: nobsy on October 28, 2018, 12:20:40 pm
This does not work on my Mac, nor on Window10.
Any suggestions welcome.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: Rimbaldo 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!
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: granzeier 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.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: velodrom 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 (http://homemadehardware.com/img/attiny85_pinout.jpeg) 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
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!
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: rubberduck on October 31, 2019, 08:07:43 am
My bunch of 5 'rev 3' clones had the P5 NOT redefined as useable pin so that a normal ISP Programmer will work on them. P5 = reset here.
Title: Re: Is there any way to remove the 5 seconds programming delay at powerup ?
Post by: SilentWarrior on January 05, 2020, 03:06:50 pm
Anyone finding this in the future looking for a way to remove the startup delay on their Digistump Attiny85 (or other) here are the instructions:

- Go here: https://github.com/micronucleus/micronucleus/tree/v1.11
- Download the whole project on 1.11 (thats the tag where the needed .hex files are at this point in time) and extract it to a dir.
- On Windows, open the command line and drag the file "micronucleus-1.11\commandline\builds\Windows\micronucleus.exe" to the command line so it pastes the whole path in it
- Click on the command line window, put a space in front of the path and add "--run" and another space
- Drag the "micronucleus-1.11\upgrade\releases" file you want to burn to your device, in my case, I use the PB0 as a push button (the only one) for my project, so I am just going to re-use it, so I picked the "micronucleus-1.11-entry-jumper-pb0-upgrade.hex"
- Once you drag you should see the full path of the exe + " --run " + the full path of the hex file
- Make sure the device is disconnected.
- Press enter and it will ask you to connect your device, it will then burn the new bootloader.
- Now when you want to program your device just keep the push button (PB0 in my case) pressed while you plug in the USB.

Note: There is two directories with .hex files, one is for FULL bootloaders (this will fail because of not enough space since there is a bootloader already on the device) and an UPGRADE dir. In the example I used the UPGRADE dir since my device came with a bootloader.

Example output :

Code: [Select]
C:\Users\silent>C:\Users\silent\Downloads\micronucleus-1.11\micronucleus-1.11\commandline\builds\Windows\micronucleus.exe --run C:\Users\silent\Downloads\micronucleus-1.11\micronucleus-1.11\upgrade\releases\micronucleus-1.11-entry-jumper-pb0-upgrade.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 16% complete
connecting: 19% complete
connecting: 22% complete
connecting: 25% complete
connecting: 28% complete
connecting: 33% complete
> Device has firmware version 1.6
> Available space for user applications: 6012 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94  page size: 64
> Erase function sleep duration: 752ms
parsing: 33% complete
parsing: 50% complete
parsing: 50% complete
> Erasing the memory ...
erasing: 50% complete
erasing: 50% complete

....

erasing: 66% complete
erasing: 66% complete
> Starting to upload ...
writing: 66% complete
writing: 66% complete
writing: 67% complete

.....

writing: 83% complete
writing: 83% complete
> Starting the user app ...
running: 83% complete
running: 100% complete
>> Micronucleus done. Thank you!

C:\Users\silent>