INFO:
Valeo shows a concept for debugging code generated from Stateflow while it is running on the ECU in the host vehicle directly. This is achieved via external communication between Simulink and the ECU.
Live Debugging of Stateflow Charts While Running on ECU - MATLAB