Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 483730 - Auto-reset support
Summary: Auto-reset support
Status: CLOSED WONTFIX
Alias: None
Product: CDT
Classification: Tools
Component: cdt-arduino (show other bugs)
Version: 8.8.0   Edit
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Doug Schaefer CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-05 17:16 EST by Vlad Gheorghe CLA
Modified: 2020-05-23 10:54 EDT (History)
2 users (show)

See Also:


Attachments
pyton script that resets the Arduino Micro board connected on /dev/micro (Linux) (483 bytes, text/x-python)
2015-12-05 17:24 EST, Vlad Gheorghe CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vlad Gheorghe CLA 2015-12-05 17:16:25 EST
Arduino CDT should support the auto-reset feature of Arduino boards and the loading of a program on the board without the need to press the board's hardware reset button.

This feature is implemented by the Arduino IDE.

Note that there are different auto-reset strategies for different Arduino boards.
Uno:
https://www.arduino.cc/en/Main/ArduinoBoardUno#documentation
"Automatic (Software) Reset
One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the reset
 line of the ATmega328 via a 100 nanofarad capacitor. When this line is asserted (taken low), 
 the reset line drops long enough to reset the chip. The Arduino Software (IDE) uses this
  capability to allow you to upload code by simply pressing the upload button in the interface toolbar. "

Leonardo/Micro:
https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc12
"(Note that the auto-reset is initiated when the computer opens the serial port at 1200 baud 
and then closes it; this won't work if something interferes with the board's USB communication
 - e.g. disabling interrupts.)"
Comment 1 Vlad Gheorghe CLA 2015-12-05 17:24:09 EST
Created attachment 258466 [details]
pyton script that resets the Arduino Micro board connected on /dev/micro (Linux)
Comment 2 Doug Schaefer CLA 2015-12-06 13:54:14 EST
Isn't that implemented in the Arduino uploaders? The IDE just calls out to them passing them the arguments specified in the platform.txt file.
Comment 3 Vlad Gheorghe CLA 2015-12-06 17:39:02 EST
(In reply to Doug Schaefer from comment #2)
> Isn't that implemented in the Arduino uploaders? The IDE just calls out to
> them passing them the arguments specified in the platform.txt file.

https://github.com/arduino/Arduino/blob/master/arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java#L106

It seems that it is implemented in the IDE.
Also, according to the comments, it seems that only Leonardo and derivatives need this "use_1200bps_touch" strategy.
Comment 4 Doug Schaefer CLA 2015-12-06 20:34:56 EST
I don't have a Leonardo but I do have a Uno and I'm getting auto-resets without this. Seems like this should be avrdude's responsibility. But I'm not sure about the Leo.
Comment 5 Vlad Gheorghe CLA 2015-12-08 06:03:53 EST
(In reply to Doug Schaefer from comment #4)

I have an Ardiuno Micro, which is a Leonardo "derivative". (same hardware, different form factor).
I am quite sure it does not reset if just avrdude is started.

See "Uploading Code to the Leonardo and Micro" https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc12

Also - the Ardiuno IDE sourcecode (see github link in bug description) shows that the IDE performs the Leonardo-specific reset sequence "open/close 1200 baud".
Comment 6 Marius K. CLA 2018-09-02 12:47:32 EDT
> Also, according to the comments, it seems that only Leonardo and derivatives
> need this "use_1200bps_touch" strategy.

It seems as the Arduino IDE has definitely to set the port to 1200 bps to initiate the reset into the bootloader. Further on the bootloader is now on a different COM port that has to be identified and then passed to avrdude to achieve a sucessful upload.

A batch file perfoming the necessary steps under windows can be found here:

https://github.com/p1ne/arduino-leonardo-uploader

Could this be implemented into Eclipse C++ IDE for Arduino ?


I think this might improve the acceptance for users that have experiences on the arduino IDE and might give eclipse with its more sophisticated code management a chance.

greetings
Comment 7 Marius K. CLA 2018-09-03 17:25:05 EDT
I modified the batch script mentioned in the previos comment a little bit:

https://github.com/zephram2015/avrdude_autoreset_wrapper

Not quite the pure eclipse way, but flashing and uploading now works seamlessly.
Comment 8 Jonah Graham CLA 2020-05-23 10:54:25 EDT
Thank you for taking the time to file a bug report about the Arduino component of the CDT project. The Arduino component is no longer maintained and will be removed from CDT 10 (Bug 562498). The final Eclipse CDT version that will include Arduino support is the CDT 9.11 series. 

Please consider using The Arduino Eclipse IDE and plug-ins named Sloeber (https://marketplace.eclipse.org/node/2637354) for your future Eclipse CDT powered Arduino development.