Developing an embedded system; from arduino to microcontroller?
Generally this would be possible, but not the best way. But first things first. The so called microcontroller is already on the the so called Arduino Board. Arduino is nothing more than a marketing trademark for microcontrollers. For example the Arduino nano is essentially a PCB with an Atmega328 with a little peripherial - the same microcontroller you would later put on your custom PCB in an embedded system.

For the migration from the prototyping stage to some production embedded system some things have to be considered.


If you want to flash the already compiled hex file to your custom board, its important to choose exact the same microcontroller as the prototyping Arduino platform for production. This means that not the general name (for example Atmega328) but the full name of the controller has to be chosen. For example the Atmega328 has  more than 50 variations which differ in packaging, pin numbers and peripherial. Flashing the same hex on a slightly different controller can result in different register numbers in the controller and could lead to unforseen behaviour of the controller, which leads to the next point.
Don't use your Arduino hex in production. The Arduino IDE and libaries are great for prototyping and getting a fast proof-of-concept but are bad for production level. Arduino is so easy and fast to develop because a lot of things are handled in the libaries which are build on each other. The deeper concepts of register and hardware handling are buried under the so called hardware abstraction layer(HAL). The HAL often generates a lot of overhead because its designed to be as universal and easy as possible. This means on the other hand not specifially suited for your particular application. Its more memory and runtime efficient to rewrite the code in plain C and do all the low level stuff on your own and application tailored. And of course you can compile your program for the controller you choose and not vice versa.