This page was machine-translated and may differ from the original. View original
[Serial] ST Yuji Kawano Engineer④ - MCU Programming, IDE Functions Must Be Repeated
MCU programming, IDE functions must be repeated
Editor, compiler, assembler, linker, programmer, and debugger configuration
Equipment such as PC, target board, IDE, and debug cable are required.
Editor, compiler, assembler, linker, programmer, and debugger configuration
Equipment such as PC, target board, IDE, and debug cable are required.
[Editor's Note] When people think of semiconductors, they usually think of familiar semiconductors like computer CPUs and memory. Conversely, MCUs (Micro Controller Units), the core semiconductors that power electronic devices, are widely used in virtually every electronic device we encounter, yet they remain relatively unfamiliar to the general public. Recently, MCUs have been making headlines due to the semiconductor shortage, drawing public attention. Therefore, this magazine has prepared a series of articles by Yuji Kawano, Manager at STMicroelectronics, a company specializing in MCU semiconductors, to provide an in-depth look at MCUs.
There are two methods for developing programs. The first is native development. Here, the PC environment used for program development (development environment) and the environment in which the developed program is executed (execution environment) are identical (Figure 1a).
Second, there is cross-platform development, where the development and execution environments are different (Figure 1b). A more common use in MCU programming is cross-platform development. A variety of development tools can be used for cross-development.
Hardware tools
- PC for program development (development environment)- Target board (execution environment) equipped with an MCU for executing the developed program
- Debug cable to connect the PC to the target board
- In-circuit emulator (ICE) or other types of emulators
software tools
- Integrated development environment
- Operating system (OS)
- Library
- Middleware
Of the tools listed above, you must have at least a PC, a target board, an integrated development environment, and a debug cable.
▲Figure 1: Native development and cross-platform development
■ Integrated Development Environment
▲Figure 2: Software development process
Figure 2 shows the software development process. An integrated development environment (IDE) is a PC application package that provides various functions necessary for software development. These IDEs typically include an editor, compiler, assembler, linker, programmer, and debugger.
To create a program that performs its purpose well, the above steps (editing, building, writing, and debugging) must be performed repeatedly.
An editor is used to edit program code. High-level programming languages like C are typically used for MCU programming, but assembly language is often used when program size or processing time is limited. High-level programming languages allow programs to be written in a way that's easy for humans to understand, and these programs are written using an editor.
Once the code is written, it is compiled using a compiler. Here, the word "compile" refers to converting a high-level programming language into object code (e.g., a language that the MCU understands). On the other hand, code written in assembly language is converted into object code using an assembler. All of these compiled object code files are collected and linked by a linker to create an executable file suitable for the target MCU. The executable file may be in Intel format (.hex), Motorola format (.s19), or one of several other formats. The executable file contains information about which data should be written to each address. Terms such as "build" or "make" are sometimes used to describe the entire compiling, assembling, and linking process.
Once the executable file is ready, it is written to the MCU via a programmer. To do this, the PC (development environment) must be connected to the target (execution environment) via a debug cable (Figure 1b). Once the writing process is complete, a debugger is used to execute the program and verify that the target is operating as intended. The debugger can execute the entire program as well as execute code line by line (stepping), execute a function and stop (stepping over), stop at the first line of code in the middle of a function's execution (stepping into), stop after executing a function (stepping out), or continue execution until a breakpoint is reached. The debugger also has memory, register, and various monitoring capabilities, allowing you to observe how variables or registers change as specific code is executed. Some IDEs can monitor how variables change during program execution.
본 기사에 대한 정정·반론·추후보도 청구는 보도 청구 안내를, 그간 게재된 보도문은 정정·반론보도 모아보기를 참고해 주세요.















