Vehicular software is a key driver of innovation and revenue in the automotive industry. However, the increasing complexity of vehicular software, driven by shorter development cycles, more frequent updates, and tight coupling of software with hardware, presents significant challenges. Microcontroller-based vehicular software is particularly affected due to resource constraints, which limit flexibility and complicate software updates. To address these challenges, we propose a modular reference architecture that enhances flexibility for microcontroller-based vehicular software, facilitating software modifications in the context of regular updates. The reference architecture is systematically derived from general requirements for microcontroller-based vehicular software and proposes a domain-based structure. It divides embedded vehicular software into five domains: the application domain, responsible for control, regulation, and monitoring functions; the base domain, managing hardware access; the mediator domain, providing a mediation infrastructure; and two protocol domains, which provide adaptation mechanisms between the mediator and the application or base domains, respectively. A scenario-based evaluation assesses the reference architecture using typical software update operations, such as extension, modification, removal, and hardware replacement. These scenarios are applied to a prototype implementation of an emulated door control unit with a corresponding door simulation environment, demonstrating feasibility of the architecture. Preliminary results indicate that the proposed architecture supports flexibility in embedded vehicular software systems. Future work is necessary to further refine the reference architecture and evaluate its real-time performance, functional safety, and security.