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, seeStatic and Constant Memory

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

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

将块信号和状态配置为autosar静态内存

生成StaticMemoryblocks for Simulink block signal and discrete state data in your AUTOSAR model, open the Code Mappings editor and select theSignals/States标签。Select signals and states and map them toStaticMemory。For example:

  1. Open an AUTOSAR model that contains signals or states that you want to generateStaticMemoryblocks for. This example uses modelautosar_swc_counter

  2. In the AUTOSAR Code perspective, open the Code Mappings editor and select theSignals/States标签。In the list of available signals, select等于_to_count。Selecting a signal highlights the signal in the model diagram. In the映射到drop-down list, selectStaticMemory。To view and modify AUTOSAR attributes for the static memory, click theIcon to configure additional code mappings propertiesicon. For more information about signal code and calibration attributes, seeMap Block Signals and States to AUTOSAR Variables

  3. Select theSignals/Statestab, and then select stateX。来自映射到drop-down list, selectStaticMemory。To view and modify AUTOSAR attributes for the static memory, click theIcon to configure additional code mappings propertiesicon.

When you generate code:

  • Exported ARXML files containSTATIC-MEMORYSdescriptions for signals and states that you configured asStaticMemory

  • 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 AUTOSARArTypedPerInstanceMemoryfor multi-instance model reference or to AUTOSARStaticMemoryfor single-instance model reference.

Configure Data Stores as AUTOSAR Static Memory

生成StaticMemoryblocks for Simulink data store memory blocks in your AUTOSAR model, open the Code Mappings editor and select the数据存储标签。Select data stores and map them toStaticMemory。For example:

  1. Open an AUTOSAR model that contains data stores that you want to generateStaticMemoryblocks for. This example uses modelautosar_bsw_sensor1

  2. In the AUTOSAR Code perspective, open the Code Mappings editor and select the数据存储标签。从可用数据存储的列表中,选择数据存储LowSetPoint。选择数据存储在模型图中突出显示数据存储存储器块。来自映射到drop-down list, selectStaticMemory。To view and modify AUTOSAR attributes for the static memory, click theIcon to configure additional code mappings propertiesicon. For more information about data store code and calibration attributes, seeMap Data Stores to AUTOSAR Variables

When you generate code:

  • Exported ARXML files containSTATIC-MEMORYSdescriptions for data stores that you configured asStaticMemory

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

Note

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

See Also

||||||

Related Examples

More About