Flashing to Arduino using external program

Hey everyone,
I am attempting to make my own GUI for some of my arduino projects. I was hoping to implement flashing of Bin or Hex files.

I have attempted a few python libraries but the ones I have found have compatibility issues with current versions of python. Unsure if I can get AVRdude to work with a python tool.

I also tried the ArduinoProgramUpload library in C# with no luck. DotNet code is outside of my experience but if there is a working library I’m willing to dive in.

If anyone has had luck with flashing from their own program any guidance would be greatly appreciated.

Use whatever. environment you like, invoke ABRDUDE with your preferred command line - and away you go.

If using one of the bootloaders, ensure you have wired RESET as needed.

If your using SPI, also need to consider RESET, but wired differently.

Did you want to upload through the serial bootloader, or through the ICSP header? Same protocol, different interface (UART vs SPI).

The Arduino UNO and Nano are flashed with the STK500 protocol. The MEGA uses the STK500V2 protocol.

Ideally I would like to use serial as I already have my live graphing via Serial on USB.

Do you mean a physical reset? Or a software reset? My apologies still learning the software process.

Example is for eeprom, but any section of flash can be backuped or flashed from command line:

Specifically for EEPROM:

avrdude -c arduino -P com4 -p ATMEGA328P -b 19200 -U eeprom:r:%temp%\backup_eeprom.hex:i

and

avrdude -c arduino -P com4 -p ATMEGA328P -b 19200 -U eeprom:w:\Users\owner\AppData\Local\Temp\backup_eeprom.hex

The first command uses ISP on com4 to create a backup file of the EEPROM contents.
The second command uses ISP on com4 to write the file "backup_eeprom" to the uC

Make changes in the script files to suit your environment.

Paths & enviro for Win 8.1

Added:
AVR Tutorial - AVRDUDE (ladyada.net)

optiboot.c says:

/* What you lose:                                         */
/*   Implements a skeleton STK500 protocol which is       */
/*     missing several features including EEPROM          */
/*     programming and non-page-aligned writes            */

/*                                                        */
/* Optional defines:                                      */
/*                                                        */
/**********************************************************/
/*   
/* SUPPORT_EEPROM:                                        */
/* Support reading and writing from EEPROM. This is not   */
/* used by Arduino, so off by default.                    */

Back early last decade, I used a UNO with a ZIF shield and created a little ISP programmer for Atmeg386P-PU and Attiny85 DIPs. Bootloader at the time was Optiboot in an early stage:

/* Copyright 2013-2015 by Bill Westfield.                 */
/* Copyright 2010 by Peter Knight.

Anyway, my personal stance on bootloaders are they are generally a Pain In The Chip ...
I use ISP programmer:
image

The scripts documented at that time (Aug 2013) for Win 8.0/8.1 did work with confirmation that they also worked on Windows 7.

Copy 'n Paste Arduino Firmware - Community / Exhibition / Gallery - Arduino Forum

Ray

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.