Automatic C-code generation for ARM Cortex-M3
C-code generation the object oriented code for ARM Cortex-M3 controller for using it in a DC drive control boards
Overview
The task of the work was to check the generation of C-code for an ARM Cortex-M3 processor of the LPC4078FBD208 (NXP) type using MatLab tools.
The goal was to reduce the development time of object-oriented code.
To generate the optimal C-code was used Matlab support package - Supported CMSIS Functions for ARM Cortex-M Processors.
The process of generating C code from a Simulink model and programming the processor includes the following steps:
-
developing a model in Simulink;
-
setting model parameters and variables in Simulink;
-
generation of C-code;
-
connecting the generated code to the template project;
-
programming the control board;
-
checking the program operation in debug mode.
The tests were carried out in several stages:
-
debugging on the open-loop mode
-
debugging on the close-loop mode
-
laboratory tests on power electrical equipment based on DC motor 5kW, 440V.
The control board worked in standalone mode.
In the program, the subsystems were divided into interrupt-running and background-running subsystems, as well as running with different sample times.
Achievements
-
reduce development time for object-oriented code
-
ability to change the control algorithm (simulation - automatic C-code generation - laboratory tests)