ZakKemble / AVRDUDESS

A GUI for AVRDUDE
https://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/
GNU General Public License v3.0
596 stars 129 forks source link

Leonardo support #3

Open cb88 opened 8 years ago

cb88 commented 8 years ago

I have my own frontend just for Arduino Leonardo's and similar boards that use the Catarina bootloader that I currently use and this is the code I use to program them. I hope it is of use to you.

                mySerial.Close();
                Thread.Sleep(500);

                int OldBaud = mySerial.BaudRate;
                mySerial.BaudRate = 1200; // toggles the Leonardo into programming mode
                mySerial.Open();     
                Thread.Sleep(1000);
                mySerial.Close();
                Thread.Sleep(4000);
                int progPortNum;
                //Note that the port is whatever com port it was before + 1
                //So I grab the port number and add one to it here.
                int.TryParse(mySerial.PortName.Replace("COM", ""), out progPortNum);

                var app = new ConsoleAppLauncher.ConsoleApp(avrDudePath, String.Format(@"""-C{0}"" -v -patmega32u4 -cavr109 -P{1} -b57600 -D -Uflash:w:{2}:i", confPath, String.Format("COM{0}", progPortNum + 1), HexPath));
                app.ConsoleOutput += updateListBox;
ZakKemble commented 10 months ago

It looks like avrdude will soon have built-in support for this in 7.3 via the -r option https://github.com/avrdudes/avrdude/pull/1507