Abstract:To overcome the difficulty of today's automotive FlexRay system development, this paper presents a low cost and dedicated approach to the hard real-time simulation in FlexRay enabled electronic control units (ECU). A real-time simulation engine named "RSE" is implemented in micro-controller firmware, which is able to load executable code generated dynamically from the PC environment through high-speed USB interface. With the help of the dynamic code generation, the behavior of the micro-controller can be controlled freely by the script to achieve FlexRay frame transmission and reception, control signals input and output, internal algorithm execution and so on. Firmware reprogramming is not necessary for the micro-controller due to the fact that most of the low-level register access functions and algorithms are exported by the simulation engine as application interface (API) for the user scripts. Experiments prove that with the decent loading and execution performance of the dynamic code, the development efficiency of the automotive FlexRay systems can be greatly improved.