Best practices for developing Simulink driver blocksets for custom ECU hardware

Hello everyone,
Our company develops custom ECU hardware for our customers. Currently, we provide low-level peripheral drivers (ADC, PWM, CAN, SPI, I2C, GPIO, etc.) as C libraries, and customers develop their application software directly in C.
However, an increasing number of customers want to develop their application software in Simulink and automatically generate code for our ECU. They expect the hardware drivers to be available as native Simulink blocks, similar to the target support packages available for STM32, NXP, TI, Speedgoat, and other hardware platforms.
I would like to understand the standard approach for building such a development environment.
Specifically, I have the following questions:
  1. What is the recommended MathWorks workflow for creating a Simulink blockset that wraps custom hardware drivers?
  2. Which MathWorks products or toolboxes are typically required? For example, should we be looking at Embedded Coder, Simulink Coder, Legacy Code Tool, S-Functions, Target Language Compiler (TLC), Target SDK, or Embedded Coder Target Framework?
  3. How are peripheral drivers (CAN, ADC, PWM, GPIO, UART, SPI, I2C, etc.) typically integrated into Simulink blocks while still generating efficient embedded C code?
  4. Is there a standard architecture used by semiconductor vendors or ECU manufacturers when creating target support packages?
  5. Are there any reference examples, documentation, or tutorials that explain how to build a complete target support package for custom embedded hardware?
Our goal is to provide customers with a development experience similar to existing hardware support packages, where they can configure peripherals graphically in Simulink, connect application logic, and generate code that interfaces with our hardware drivers.
Any guidance on the recommended architecture, tools, or best practices would be greatly appreciated.
Thank you!

Answers (0)

Asked:

about 14 hours ago

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!