Due won't start after power off-on, have to reset

RayLivingston:
How does one re-FLASH the 16U2?

sined23:
http://www.arduino.cc/en/Hacking/Upgrading16U2Due

Are there instructions somewhere on how to BUILD the 16U2 firmware? I've got the source, and the LUFA libraries, but I have no clue what environment needs to be setup for the makefile to work.

Regards,
Ray L.

dancombine:
Hi all,

I have the same problem since the beginning, and this is bugging me big time for my projects. I think I have identified a definite solution.
In fact credit is due to the guys of Freetronics about the EtherDue.
see link http://forum.freetronics.com/viewtopic.php?f=45&t=6055

The DUE boards may be affected by the following bug: On power-on the board may start to the bootloader instead of running the onboard program, as if the ERASE button had been pressed. Pressing "reset" resumes normal operation. The bug appears to be caused by undocumented behaviour in the ATSAM3X8E microcontroller regarding the "erase" input pin - according to the specification we shouldn't ever be seeing this.

The fix is to solder a surface mount resistor (0603 size) onto the board: solder a 10k resistor between the ERASE line and +3.3V, close to fet T3. In practice, solder it across the 2 upper pins of T3.

To know if you have a DUE (or derivate/clone) that may be affected, check if fet T3 is soldered horizontally - see picture below:
(fet T3 is in the middle of the picture, just to the right of the 6-pin SPI connector)

(If your DUE has the fet soldered vertically, likely the board is more recent and good, as it has resistor R99 soldered.)

Here is a picture of a fixed DUE with a 10k resistor that I soldered across the pins of T3:

I have tested this and works fine.

-D

Credit to Dancombine,

I'm having this no_reset_onPowerON problem and using the capacitor method does not solve my problem..
I have soldered on the 10K resistor as recommended by Dancombine across the FET and tested. It now restart (reset) everytime when I turn on the power.

Cool Bean.

RayLivingston:
Are there instructions somewhere on how to BUILD the 16U2 firmware? I've got the source, and the LUFA libraries, but I have no clue what environment needs to be setup for the makefile to work.

Regards,
Ray L.

not needed. just upload this file: Due appears as COM6 port but gives error "No device found on COM6" on upload - Arduino Due - Arduino Forum

Just to confirm what sined23 has posted: Like most other Due's in this thread, my new Arduino Due would also fail to start after either uploaded or poweron. I was not happy.

After a bit of research, this thread and an at hand USBasp programmer, I uploaded the latest atmega16u2 firmware, which has completely resolved this issue for me.

Command used:
(Copy avrdude.conf and the hex file to the same folder as avrdude.exe before running.)
R:\Arduino\hardware\tools\avr\bin>avrdude.exe -C avrdude.conf -c usbasp -P /dev/ttyACM0 -b 19200 -p m16u2 -vvv -U flash:w:16u2.hex:i

The new 16U2 firmware seems to have fixed all but one of the boards I've tried so far - they now seem to come up reliably on power-up and after a re-FLASH. I have one board that still does not start properly on power-up, or after a re-FLASH, but works fine under all other conditions. If one of you guys with more patience than me is interested in digging into it, I'd be happy to send you the wonky board, to see if perhaps there is another problem lurking in there...

Regards,
Ray L.

ZartPARZ:
According to dancombine's suggestion, I put normal through-hole 10k resistor in. Everything work correctly. The DUE start the sketch every time I put power in. Thank to dancombine. :wink:

I really like this solution and thought that soldering a normal 10k resistor would be easier than a SMD 0603 resistor. I tried for 10 minutes but was not able to get the 1st pin of the resistor firmly connected. Then I was not able to just get a blob of solder firm as described in the freetronic description. So I had to give up, will ask a colleague at work who is much better in soldering than I whether he can do that soldering of 10k resistor for me.

Hermann.

dancombine:
Hi all,

I have the same problem since the beginning, and this is bugging me big time for my projects. I think I have identified a definite solution.
In fact credit is due to the guys of Freetronics about the EtherDue.
see link http://forum.freetronics.com/viewtopic.php?f=45&t=6055

The DUE boards may be affected by the following bug: On power-on the board may start to the bootloader instead of running the onboard program, as if the ERASE button had been pressed. Pressing "reset" resumes normal operation. The bug appears to be caused by undocumented behaviour in the ATSAM3X8E microcontroller regarding the "erase" input pin - according to the specification we shouldn't ever be seeing this.

The fix is to solder a surface mount resistor (0603 size) onto the board: solder a 10k resistor between the ERASE line and +3.3V, close to fet T3. In practice, solder it across the 2 upper pins of T3.

To know if you have a DUE (or derivate/clone) that may be affected, check if fet T3 is soldered horizontally - see picture below:
(fet T3 is in the middle of the picture, just to the right of the 6-pin SPI connector)

(If your DUE has the fet soldered vertically, likely the board is more recent and good, as it has resistor R99 soldered.)

Here is a picture of a fixed DUE with a 10k resistor that I soldered across the pins of T3:

I have tested this and works fine.

-D

Just wanted to say this works perfect. I used an 0805 instead of 0603. Due works perfect now on power up or reset. Thanks!

Okio:
Just to confirm what sined23 has posted: Like most other Due's in this thread, my new Arduino Due would also fail to start after either uploaded or poweron. I was not happy.

After a bit of research, this thread and an at hand USBasp programmer, I uploaded the latest atmega16u2 firmware, which has completely resolved this issue for me.

Command used:
(Copy avrdude.conf and the hex file to the same folder as avrdude.exe before running.)
R:\Arduino\hardware\tools\avr\bin>avrdude.exe -C avrdude.conf -c usbasp -P /dev/ttyACM0 -b 19200 -p m16u2 -vvv -U flash:w:16u2.hex:i

Any way of doing this without an additional programmer?
Regards,
Graham

ghlawrence2000:
Any way of doing this without an additional programmer?
Regards,
Graham

You can do it using another Arduino as an ISP. There are several websites that explain how to do it.

Regards,
Ray L.

Thanks Ray, found it on the Arduino site.

Regards,

Graham

PS. It turns out, the board I am having problems with, R23 = 10K....... :frowning: but the things are so bloody small I think I will need to live with it, at least the firmware upgrade means I don't need to press reset before programming now :smiley:

HermannSW:
I really like this solution and thought that soldering a normal 10k resistor would be easier than a SMD 0603 resistor. I tried for 10 minutes but was not able to get the 1st pin of the resistor firmly connected. Then I was not able to just get a blob of solder firm as described in the freetronic description. So I had to give up, will ask a colleague at work who is much better in soldering than I whether he can do that soldering of 10k resistor for me.

Hermann.

Here is an update, today my colleague helped me and soldered the SMD 103 resistor onto one of my 3 Arduino Dues:

I did flash "Blink" example program and after disconnecting and reconnecting power Due blinked again. This resolved my real need for Arduebot -- it would be really bad to have Arduebot robot driving some course and getting fully stopped by a voltage spike without any chance to restart.

Next I disconnected the USB cable, went to colleagues computer and connected there -- Due Blink program did NOT start.

After some investigations I can say the following on this 10K resistor fix for my Due:

  • if power disconnect takes less than 4 seconds, blinking starts when reconnecting USB power
  • if power disconnect takes 4 seconds or longer, Due does not start blinking

Can anybody explain this behavior?

Hermann.

Hmmm, I did flash TinyBasic and the behavior is different, even after disconnecting power completely for 1 minute "sudo screen /dev/ttyACM0 9600" connects successfully:

HELLO
TinyBasic Plus v0.14
90865 bytes free.
OK
>

How can the Due bootup process be different for "Blink" vs. "TinyBasic"?

Hermann.

OK, I debugged this further and further and tried to identify the difference between Blink and TinyBasic.

It turned out that just doing the connection to TinyBasic made the difference (I did power via USB cable on programming port). Just repowering after 4 seconds or more did NOT start Blink example program. But as I said, connection as I did describe in previous posting did trigger start of blink program.

Now I even simplified that and remembered that just opening of USB port can be done via "stty -F /dev/ttyACM0 baudrate". I did not want to erase flash (which can be done with baudrate=1200). So I did "stty -F /dev/ttyACM0 9600" and immediately Blink program started working(blinking).

Next I connected only 9V block battery to Arduino Due (GND and Vin pins). Blink program did not start. After pressing Reset button Blink program started. Disconnecting 9V battery for 5 seconds and then reconnecting Blink program did not start.

Summary:
If power break is 4 seconds or longer and there is no "external trigger" Arduino program does NOT start.

These are "external triggers" that worked:

  • power off and back on within less than 4 seconds
  • stty -F /dev/ttyACM0 9600 (when powered by programming port USB cable)
  • pressing Reset button

Can somebody who had declared soldering 10k resistor as I did works please comment on whether for them disconnecting power for more than 4 seconds and then repowering really does restart the program from flash (without any "external trigger" I described)?

Hermann.

Back at home I have access to all my 3 Arduino Dues.
Now I did flash Blink sample on both Arduebots and did the timing experiments:

Interestingly those Dues do not have any 10k resistor soldered and do survive a longer power outage:

  • the leftt (2nd) Arduebot does start when repowering after 5 seconds, but not for longer times
  • the right (1st) Arduebot does start when repowering after 7 seconds, but not for longer times

I did retest my bare Arduino Due I used last night also via power jack, and again up to 4 seconds is fine, but longer power outage needs an external trigger to restart.

Last experiment I did was to remove the soldered 10k resistor that got soldered yesterday. The timing measurements show no difference, up to 4 seconds power outage and the Dues starts automatically, more and an external trigger is needed.

Arduino Due cannot be bought under Product tabs on this website since quite some time not even in the US. I did buy all my Arduinos as China clones from aliexpress, links below. Perhaps these China closes behave differently to the Dues others reported the resistor had made a difference. Again, what exactly was the difference?

Unknowingly what I found out by measuring power off times and extenal trigger needs I have made use of exactly this feature two weeks ago when when making a film of motor forward/backward left/right demo for 2nd Arduebot with L9110S motor controller:

The progam was endless loop and nothing was added to start the program. So I connected power jack and nothing happened because of the missing external trigger. Then I tried to power cycle the power jack with one hand (the other did hold the Android phone camera) and needed needed a little help from the hand holding the Android. After repowering the Arduino program immediately started with roaring motors.

Perhaps the different repowering cycles for the three Arduinos is determined by what is all connected to the Arduino board, but I do not unmount the Due boards from my Arduebots just to find that out.

Summary for me: NO resistors needed for my Arduino Dues, because the behavior did not change, and most importantly, power outages due to voltage spikes will last much less than 4 seconds and therefore restart the program without any changes needed.

Hermann.
http://www.aliexpress.com/item/Free-shipping-Due-R3-ARM-Version-Main-Control-Board-for-arduino/1914744005.html
http://www.aliexpress.com/item/10sets-lot-For-Arduino-Due-2012-R3-ARM-Version-Main-Control-Board/1736339894.html

I have just re-flashed my Arduino Due after seeing this topic and following the instructions on how to use an Arduino Uno to do this. I am using a Mac running El Capitan and I had to make a couple of adjustments to the command line instructions I found.

The first problem I hit was finding where avrdude was hidden away. After Googling - what did we ever do before the internet! - I found avrdude in the following directory:

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin

I didn't even know what a package was until today. So the Arduino icon in Applications is actually a kind of package/directory and you have to use the .app suffix to access the directories inside. I copied the avrdude.conf file and the .hex file into the same directory just to be on the safe side.

The other thing I found was that the device name was different on my Mac. Using ttyACM0 didn't work. When I looked at the port listed under Tools in the Arduino software, it was cu.usbmodem1441. I searched the listed devices and found tty.usbmodem1441. I used this in the command line and it worked correctly.

My Due is now working correctly without the need to solder the resistor on and programs run properly on power up without needing to do a reset.

can I use the due itself as an AVR programmer? Or can I use another due as a programmer? I don't have uno neither mega.

I think no, we cannot use the due as an AVR programmer because the different voltage level.

Adding a bidirectional level shifter to the Due should do, right?

Hermann.

Firstly, big THANKS! to dancombine.

I did the job with my Due from china. This one did the reset after programming via 16u2, it had the correct 1kOhm series resistor, but not after power up, which didn't occur to me some while.
The 10k across T3 fixed it all right.

selfonlypath:
... 0603 which I did not have ...

Me neither.
But some old PCD from junk pile did offer a 10k small enough.
(Smaller ones come from old mobile pcbs, some tin :wink:
On another occasion I soldered it vertically, after contacting the "upper end" with enamel wire.
Good luck!
(When do we print/let grow micro bots, due driven of course, that carry enamel wire across PCBs and solder it, to fix the PCB to our findings? :slight_smile:

Andi