Upload to Arduino using own program

Hello,
is it possible to program my own program in c++ on my computer and use it to upload my own arduino code. To be more exact:

I want to make my own board with an Atmega328p on it. This board will be installed in a washing machine for hospitals and technicians should be able to connct their computer with my board to repair the machine. So far so good, but how can i make a c++ programm for am computer (i know c so i prefer it :wink: to upload the rather complex c program on this washing machine on an empty atmega328p. I think its not professional enought to let the technicians opne the arduino ide and upload the bootloader and my program. I want to implement all this steps and features in my own c program but how can i do this?

Thanks in advance :slight_smile:
Moritz

The easier way to do this would be to use the AVRDUDE command line tool that the Arduino IDE uses to upload to your ATmega328P:
https://savannah.nongnu.org/projects/avrdude/
Then your C/C++ program only needs to provide a nice interface for them to run the AVRDUDE command. You will provide the firmware as a pre-compiled .hex file, which you can easily generate from the Arduino IDE via Sketch > Export compiled binary, which will save the .hex file to the sketch folder.

Of course you could also recreate the specific functionalities of avrdude you need in your own program if you like and the source code of avrdude is there for you to use as a reference.

Please be sure to respect the open source license of all code or applications you use, including the libraries used by your Arduino sketch.

I routinely use the Arduino IDE command line tool to compile and upload my programs using this simple Python upload program.

If you don't like Python it should be straightforward to implement the same thing in your language of choice.

...R

Check this link
http://mightydevices.com/?p=519

It is for STM32 but principles are the same.