MATLAB and Simulink Training

Embedded Coder for Production Code Generation

View schedule and enroll

Course Details

This hands-on, three-day course focuses on developing models in the Simulink® environment to deploy on embedded systems. The course is designed for Simulink users who intend to generate, validate, and deploy embedded code using Embedded Coder®. Topics include:
 
  • Generated code structure and execution
  • Code generation options and optimizations
  • Integrating generated code with external code
  • Generating code for multirate and nonperiodic systems
  • Customizing generated code
  • Customizing data
  • Testing generated code on target hardware
  • Deploying code

Day 1 of 3


Generating Embedded Code

Objective: Configure Simulink models for embedded code generation and effectively interpret the generated code.

  • Architecture of an embedded application
  • System specification
  • Generating code
  • Code modules
  • Logging intermediate signals
  • Data structures in generated code
  • Verifying generated code
  • Embedded Coder® build process

Optimizing Generated Code

Objective: Identify the requirements of the application at hand and configure optimization settings to satisfy these requirements.

  • Optimization considerations
  • Removing unnecessary code
  • Removing unnecessary data support
  • Optimizing data storage
  • Profiling generated code
  • Code generation objectives

Integrating Generated Code with External Code

Objective: Modify models and files to run generated code and external code together.

  • External code integration overview
  • Model entry points
  • Creating an execution harness
  • Integrating generated code into an external project
  • Controlling code destination
  • Packaging generated code

Controlling Function Prototypes

Objective: Customize function prototypes of model entry points in the generated code.

  • Default model function prototype
  • Modifying function prototypes
  • Generated code with modified function prototypes
  • Model function prototype considerations
  • Reusable function interface
  • Function defaults

Day 2 of 3


Customizing Data Characteristics in Simulink®

Objective: Control the data types and storage classes of data in Simulink.

  • Data characteristics
  • Data type classification
  • Simulink data type configuration
  • Setting signal storage classes
  • Setting state storage classes
  • Impact of storage classes on symbols

Customizing Data Characteristics Using Data Objects

Objective: Control the data types and storage classes of data using data objects.

  • Simulink® data objects overview
  • Controlling data types with data objects
  • Creating reconfigurable data types
  • Controlling storage classes with data objects
  • Controlling data type and variable names
  • Data dictionaries

Creating Storage Classes

Objective: Design storage classes and use them for code generation.

  • User-defined storage classes
  • Creating storage classes
  • Using user-defined storage classes
  • Sharing user code definitions

Customizing Generated Code Architecture

Objective: Control the architecture of the generated code according to application requirements.

  • Simulink model architecture
  • Controlling code partitioning
  • Generating reusable subsystem code
  • Generating variant components
  • Code placement options

Model Referencing and Bus Objects

Objective: Control the data type and storage class of bus objects and use them for generating code from models that reference other models.

  • Creating reusable model references
  • Controlling data type of bus signals
  • Controlling storage class of bus signals
  • Model Reference software testing

Day 3 of 3


Scheduling Generated Code Execution

Objective: Generate code for multirate systems in single-tasking, multitasking, and function call-driven configurations.

  • Execution schemes for single-rate and multirate systems
  • Generated code for single-rate models
  • Multirate single-tasking code
  • Multirate multitasking code
  • Generating exported functions

Testing Generated Code on Target Hardware

Objective: Use processor-in-the-loop (PIL) simulation to validate, profile, and optimize the generated code on target hardware.

  • Hardware support overview
  • Arduino setup
  • Validating generated code on target
  • Target optimization overview
  • Profiling generated code on target
  • Using code replacement libraries
  • Creating code replacement tables

Deploying Generated Code

Objective: Create a working real-time application on an Arduino® board using provided hardware support.

  • Embedded application architecture
  • Creating a deployment harness
  • Using device driver blocks
  • Running a real-time application
  • External mode

Integrating Device Drivers

Objective: Generate custom blocks to integrate device drivers with Simulink and generated code.

  • Device drivers overview
  • Using Legacy Code Tool
  • Customizing device driver components
  • Developing a device driver block for Arduino

Improving Code Efficiency and Compliance

Objective: Inspect the efficiency of generated code and verify compliance with standards and guidelines.

  • Model Advisor
  • Hardware implementation parameters
  • Compliance with standards and guidelines

Level: Intermediate

Duration: 3 day

Languages: Deutsch, English, Français, 日本語, 한국어, 中文

View schedule and enroll