This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can a program detect the uVision simulator?

Is there a way for a program to know if it's executed under the simulator and not on an actual CPU?

Parents
  • It would be simple to put a sim script in that watched for a particular variable / address to be written then modify it, invert it, or something else specific as desired. You likely would have ignore the zero init of the variable.

    In the application, write this item then read it back - treating it as volatile.
    If it reads back different than written, it would indicate simulator.

    This should be quite generic and not rely on specifics of the CPU, build configuration, or simulator flaws (features ) that do not exactly match the CPU.

Reply
  • It would be simple to put a sim script in that watched for a particular variable / address to be written then modify it, invert it, or something else specific as desired. You likely would have ignore the zero init of the variable.

    In the application, write this item then read it back - treating it as volatile.
    If it reads back different than written, it would indicate simulator.

    This should be quite generic and not rely on specifics of the CPU, build configuration, or simulator flaws (features ) that do not exactly match the CPU.

Children