Simulation Notes Europe, Volume 28(2), June 2018

MbedTarget - A Simulink Target for Cortex-M Microcontrollers

Simulation Notes Europe SNE 28(2), 2018, 75-80
DOI: 10.11128/sne.28.sw.10417

Abstract

The MATLAB/Simulink add-ons for C and C++ code generation, MATLAB Coder, Simulink Coder and Embedded Coder, are a widely used and well established technologies for rapid prototyping, model based design, real-time simulation and similar technologies. Mathworks provides the prerequisites for code generation for many Simulink blocks and MATLAB functions. Missing is the direct support of peripheral functions like digital and analog input/outputs, communication functionalities and other microcontroller features when the goal is to execute a Simulink model within a small embedded system. To extend the above coders to support these functions, several add-on toolboxes exists, delivered by Mathworks itself or by third-party suppliers. In the following, the programming of microcontrollers is shortly introduced and their resource utilization is compared, starting with assembler up to code generation by a Mathworks coder products. After introducing and comparing different Cortex-M coder toolboxes, the MbedTarget toolbox as an open source alternative is presented. With examples and code snippets, the principle of the code generation process, the work flow of MbedTarget together with the principle to define a Simulink block is shown.