simulink-generate-embedded-code

Configure Simulink models for Embedded Coder and AUTOSAR production code generation.

1.0k|98|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-generate-embedded-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simulink-generate-embedded-code
Source: https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/code-generation/simulink-generate-embedded-code
Command: npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-generate-embedded-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Setting up a Simulink model for production code generation involves dozens of interdependent configuration decisions — target framework, hardware device, optimization objective, MISRA compliance, and interface style — that are easy to get wrong and tedious to apply across a model reference hierarchy. This Skill applies the correct Embedded Coder (ERT) or AUTOSAR configuration atomically, propagating settings across referenced sub-models and reverting entirely on failure.

Core Features & Use Cases

  • Target and hardware configuration: Selects ERT, ERT shared library, AUTOSAR Classic, or AUTOSAR Adaptive targets and maps hardware device strings (ARM Cortex-A, x86-64, etc.) to the correct word sizes and endianness.
  • Optimization and compliance cascades: Applies speed, RAM, or debug optimization objectives and MISRA C/C++ compliance profiles, driving the underlying ConfigSet parameter changes automatically.
  • Build orchestration and reporting: Supports configure-only, generate-code-only, and full build modes, returning JSON with configured models, generated artifacts, report path, and pending saves.
  • Use Case: A controls engineer says "configure my model for production C code on ARM Cortex-M, optimized for RAM, MISRA compliant" — the Skill infers the ERT target, asks one batched question for anything missing, and applies the full configuration in a single call.

Quick Start

Ask the agent to configure your open Simulink model for embedded code generation, for example: "Configure my model for AUTOSAR code generation in C targeting ARM Cortex-A, optimized for speed."

Frequently Asked Questions about simulink-generate-embedded-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a Simulink model for Embedded Coder code generation?

Open the model in MATLAB, then ask the agent to configure it for embedded code generation with your target, hardware, and optimization objective. The Skill calls configure_for_codegen once, applying ERT or AUTOSAR settings across the model hierarchy atomically.

How do I generate MISRA compliant code from Simulink?

Request MISRA compliance when configuring the model; the Skill applies a MISRA C or MISRA C++ profile matching the source language. If you say only "MISRA", it infers the standard from the language and states the assumption.

Does this skill support Simulink Coder GRT targets?

No. It only handles Embedded Coder (ERT, ERT shared library) and AUTOSAR Classic/Adaptive targets. GRT/grt.tlc rapid-prototyping targets, DDS, and ROS are explicitly out of scope.

What MATLAB products are required for embedded code generation?

The Skill requires MATLAB R2023b or later with Simulink, Embedded Coder, Simulink Coder, and MATLAB Coder installed. AUTOSAR targets additionally require the corresponding AUTOSAR Blockset to be installed and licensed.

Why did code generation configuration fail with success:false?

Failures occur when prerequisites are missing, such as an unlicensed AUTOSAR Blockset, a model that is not loaded, or an invalid MISRA/language combination. The Skill relays the script's error message verbatim so you can fix the environment rather than masking the issue.

Does the configuration save my model automatically?

No. Configuration changes exist only in memory until you approve saving. The Skill lists every pending file (model .slx and any backing .sldd data dictionary) and saves only after your explicit confirmation.