The article proposes a hierarchical model for the design of microcontroller-based systems protected from cyber-physical attacks. Within the framework of this model, a microcontroller-based system is represented as a hierarchical relational set of interacting building blocks with different properties and links between them. The proposed model includes models of hardware, software and hardware-software elements, interfaces, protocols and links between system elements, models of attacker and attack actions. The key difference of the developed model lies in the possibility of full representation of microcontroller-based systems, while other solutions have a drawback of designing such systems without taking into account the interactions of their devices with each other and other systems. In addition, the developed model is modular and extensible, aims to ensure the security of the designed solution from cyber-physical attacks, and considers security elements as an integral part of the final solution.