Main Content

Configure AUTOSAR Static Memory

To model AUTOSAR static memory for AUTOSAR applications, you import static memory definitions from ARXML files or create static memory content in Simulink®. For information about the high-level static memory workflow, see Static and Constant Memory.

AUTOSAR static memory (StaticMemory) corresponds to Simulink internal global signals. In the AUTOSAR run-time environment, calibration tools can access StaticMemory blocks for measurement and calibration.

To model AUTOSAR static memory, you can use Simulink block signals, discrete states, or data stores in your model.

Configure Block Signals and States as AUTOSAR Static Memory

To generate StaticMemory blocks for Simulink block signal and discrete state data in your AUTOSAR model, open the Code Mappings editor and select the Signals/States tab. Select signals and states and map them to StaticMemory. For example:

  1. Open an AUTOSAR model that contains signals or states that you want to generate StaticMemory blocks for. This example uses model autosar_swc_counter.

  2. In the AUTOSAR code perspective, open the Code Mappings editor and select the Signals/States tab. In the list of available signals, select equal_to_count. Selecting a signal highlights the signal in the model diagram. In the Mapped To drop-down list, select StaticMemory. To view and modify AUTOSAR attributes for the static memory, click the Icon to configure additional code mappings properties icon. For more information about signal code and calibration attributes, see Map Block Signals and States to AUTOSAR Variables.

  3. Select the Signals/States tab, and then select state X. From the Mapped To drop-down list, select StaticMemory. To view and modify AUTOSAR attributes for the static memory, click the Icon to configure additional code mappings properties icon.

When you generate code:

  • Exported ARXML files contain STATIC-MEMORYS descriptions for signals and states that you configured as StaticMemory.

  • Generated C code declares and references the static memory variables.

For referenced models within an AUTOSAR component model, Embedded Coder® maps internal signals and states for model reference code generation. Internal signals and states map to AUTOSAR ArTypedPerInstanceMemory for multi-instance model reference or to AUTOSAR StaticMemory for single-instance model reference.

Configure Data Stores as AUTOSAR Static Memory

To generate StaticMemory blocks for Simulink data store memory blocks in your AUTOSAR model, open the Code Mappings editor and select the Data Stores tab. Select data stores and map them to StaticMemory. For example:

  1. Open an AUTOSAR model that contains data stores that you want to generate StaticMemory blocks for. This example uses model autosar_bsw_sensor1.

  2. In the AUTOSAR code perspective, open the Code Mappings editor and select the Data Stores tab. From the list of available data stores, select data store LowSetPoint. Selecting a data store highlights the data store memory block in the model diagram. From the Mapped To drop-down list, select StaticMemory. To view and modify AUTOSAR attributes for the static memory, click the Icon to configure additional code mappings properties icon. For more information about data store code and calibration attributes, see Map Data Stores to AUTOSAR Variables.

When you generate code:

  • Exported ARXML files contain STATIC-MEMORYS descriptions for data stores that you configured as StaticMemory.

  • Generated C code declares and references the static memory variables.

Note

AUTOSAR Blockset does not support static memory code generation for data stores in referenced models.

See Also

| | | | | |

Related Examples

More About