Application Resource Usage

Overview

OpenECU provides a lot of information to help you determine how your application is using the CPU resources. This information can be found in the following locations:


How to determine RAM usage

At the end of the build, RAM usage will be printed to the Simulink diagnostics window.

The build information output will look as follows:

### Build information: 
..Strategy memory: 
    184548 bytes of strategy/code memory used 
    339676 bytes remaining 
..Calibration memory: 
      2514 bytes of calibration memory used (rough indication, includes Simulink support data) 
    259629 bytes remaining 
..Workspace memory: 
     25896 bytes of workspace/displayable memory used, including 
         0 bytes of adaptive data, and 
        52 bytes of diagnostic trouble code data, and 
      8192 bytes of model stack 
     39639 bytes remaining

The RAM is listed as Workspace memory. In the above example, the model used 25896 bytes of RAM, and 39639 bytes of RAM remain.


How to determine stack allocation

At the end of the build, stack allocation will be printed to the Simulink diagnostics window.

The build information output will look as follows:

### Build information: 
..Strategy memory: 
    184548 bytes of strategy/code memory used 
    339676 bytes remaining 
..Calibration memory: 
      2514 bytes of calibration memory used (rough indication, includes Simulink support data) 
    259629 bytes remaining 
..Workspace memory: 
     25896 bytes of workspace/displayable memory used, including 
         0 bytes of adaptive data, and 
        52 bytes of diagnostic trouble code data, and 
      8192 bytes of model stack 
     39639 bytes remaining

The stack allocation is listed in the Workspace memory area. In the above example, the model allocated 8192 bytes for the stack.

How do I determine how much stack my application is using?

How do I change the stack size in my application?

How can I tell if stack overflow is the cause of my ECU resetting?


How to determine application flash usage

At the end of the build, application flash usage will be printed to the Simulink diagnostics window.

The build information output will look as follows:

### Build information: 
..Strategy memory: 
    184548 bytes of strategy/code memory used 
    339676 bytes remaining 
..Calibration memory: 
      2514 bytes of calibration memory used (rough indication, includes Simulink support data) 
    259629 bytes remaining 
..Workspace memory: 
     25896 bytes of workspace/displayable memory used, including 
         0 bytes of adaptive data, and 
        52 bytes of diagnostic trouble code data, and 
      8192 bytes of model stack 
     39639 bytes remaining

The application flash usage is listed as strategy/code memory used. In the above example, the model used 184548 bytes of flash memory for the application, and 339676 bytes of application flash remain.


How to determine calibration flash usage

At the end of the build, calibration flash usage will be printed to the Simulink diagnostics window.

The build information output will look as follows:

### Build information: 
..Strategy memory: 
    184548 bytes of strategy/code memory used 
    339676 bytes remaining 
..Calibration memory: 
      2514 bytes of calibration memory used (rough indication, includes Simulink support data) 
    259629 bytes remaining 
..Workspace memory: 
     25896 bytes of workspace/displayable memory used, including 
         0 bytes of adaptive data, and 
        52 bytes of diagnostic trouble code data, and 
      8192 bytes of model stack 
     39639 bytes remaining

The calibration flash usage is listed in the Calibration memory section. In the above example, the model used 2514 bytes of flash memory for calibrations, and 259629 bytes of calibration flash remain.


How to determine stack usage

OpenECU includes many variables in the A2L file to help you determine the performance of your ECU. You can view these variables using a CCP calibration tool such as PiSnoop or ATI Vision.

To view the stack usage, use the following variable:

Additionally, you can use the Stack Used block to monitor stack usage in your application code.

How do I determine how much stack my application is using?

How do I change the stack size in my application?

How can I tell if stack overflow is the cause of my ECU resetting?


How to determine CPU load

OpenECU includes many variables in the A2L file to help you determine the performance of your ECU. You can view these variables using a CCP calibration tool such as PiSnoop or ATI Vision.

To view the CPU load, use the following two variables:


How to determine how much time each task is using

OpenECU includes many variables in the A2L file to help you determine the performance of your ECU. You can view these variables using a CCP calibration tool such as PiSnoop or ATI Vision.

To view the instantaneous time that a task is taking, the variable name will be:

Example:

To view the maximum time that a task has used since the last ECU reset, the variable name will be:

Example:

Additionally, you can use the Task Duration block to monitor stack usage in your application code.


How to determine if a task is close to overrunning

See How to determine how much time each task is using, and read the information regarding the maximum time that a task has used since the last reset (i.e. the mpl_mtt_ variables).

Example:

      Copyright © 2016 Pi Innovo, All rights reserved