Upload to Arduino using own program

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

It is for STM32 but principles are the same.