I am about to ask a kind of complex question due to the number of system parts involved and the system architecture I am planning to use.
First of all I have a tiny bit of experience with the Arduino Nano and a professional experience with C microcontroller programming.
What I would like is to create a custom ATMega328p board that does something and be able to update whatever firmware is running on it using the UART port.
1) Firmware updating
Since I am not so familiar with bootloaders, I would skip for now writing my own, so I would like to use the newest Arduino Bootloader for ATMega328p to support the firmware updates.
2) Custom program compilation
What I definitely do NOT want is use Arduino Sketch IDE to compile whatever application code. I am using Atmel Studio up to now for whatever bootloaderless applications I was doing and I would like to keep using that with my own project and code structure. The question here is, do I need to make any linker modifications or modifications in the code in Atmel Studio projects in order to be able to "transform" my code into application code so that can coexist with the bootloader?
3) Updated firmware programming
After the board is on the field running with the Optiboot bootloader and an outdated firmware, I would like to use a thirdparty software to communicate with the bootloader and update the application code. Since the optiboot bootloader used by Arduino uses the STK500 communication protocol and functionality, could I use AVRdude to communicate with the bootloader and flash the applications code only through UART?
Do you think this concept could work?
Thank you in advance. polylogic