Why is execution on the microcontroller so important?

Embedded firmware is usually developed on a desktop PC. Code that is not directly dependent on hardware can be compiled with a standard desktop compiler and executed on the development computer (off-target). This approach is often selected, in order to avoid long compile-flash-debug loops on the microcontroller.

However, it should be noted that the code tested by means of this method may demonstrate different behavior when executed on the real target system (on-target). In the best case, an error may already be detected when compiling with the cross-compiler. If you are less lucky, the compiled code will behave differently in terms of details. Code that was “verified” in the off-target procedure is suddenly no longer correct.

Causes of differences in on and off-target execution

Compilers do not support the same features
Bugs in compilers and runtime libraries
Platform-specific features, such as the size of the data types
Undefined behavior and optimization
Hardware bugs
Hardware-specific settings

Technical information, explanations and examples of possible causes can be found in our white paper On and off-target implementation Comparison.

The off-target approach is often selected for the execution of unit tests. In terms of efficient development, this makes sense. However, if these tests are not also executed on-target – which could deliver different results! – a purely “perceived security” can quickly result.

The ExecutionPlatform enables quick, easy and secure on-target execution.

Do you want to know how the ExecutionPlatform can help you with your project? We would be happy to discuss your requirements with you in person.