Unlock all 68 lessons of Embedded Programming EssentialsFull course ₹40,000 · paid
What Is an Embedded System and the Toolchain Overview
A free lesson from Skill-Lync's Embedded Programming Essentials course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “W1 S1 Part 1 Introduction to Embedded System and installing STM32Cube IDE”
What will you learn in this free Embedded Programming Essentials lesson?
The instructor defines an embedded system and gives examples such as a weighing machine and vehicle ECUs. He compares embedded and desktop hardware in RAM, ROM, power and cost, explains why C is preferred, then introduces STM32CubeIDE with GCC and runs a first program.
- Definition and traits of an embedded system
- Vehicle ECUs as a distributed embedded system
- Small RAM, ROM and power limits versus a desktop
- Build and run steps in STM32CubeIDE with GCC
What comes after lesson 1?
The next free lesson is lesson 2, “C Program Layout and Standard Input and Output Functions” (38 min). Later in Skill-Lync's Embedded Programming Essentials course (paid): lesson 4, W1 S3 C Datatypes,FPU,Enum & Typedef; lesson 5, W1 S4 Operator Precedence & Associativity; lesson 6, Week 2 Session 1. The full course has 68 lessons (34 h 47 min of video); see the course overview or its price and syllabus.
Lesson transcript
Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.
Hello everyone, welcome to the Embedded C Essentials program. So in this session, we will see about C language for embedded programming. So in today's video, we will see what is an embedded system and we will try to understand the different characteristics of an embedded system and the respective architecture of a typical embedded system. So we will also figure out different embedded hardware and software and we will also try to understand why C language is considered as a preferred choice for the embedded software development. So as the course goes, we will try to be bringing up a tool chain for writing our embedded programs as well as for starting with our programs that runs on the host machine.
So for this exercise, we will be using an integrated development environment called as STM32 cube IDE and the compiler that would be running behind that is our GNUC compiler, which is GCC. So in today's session, we will try to bring up this tool chain installation and we will have a quick demo on the same. So the learning objective of this video or this session is going to be understanding the typical embedded system or typical architecture of embedded system, I would say. Then we will try to understand how to install the required tool chains so that you can write and run the C program in the host machine.
At this moment, let's not worry about the term host machine. As it goes, we will understand what is mean by this host machine. So let's try to answer this typical question. What is an embedded system? So embedded system, it is a system that performs certain computational operation on the given input with the minimalistic hardware and a dedicated software. So the whole idea of embedded system itself is to satisfy a certain functionality, a certain specific functionality. So for that specific functionality, we are trying to build a dedicated software which runs on a minimalistic hardware.
Why do I say minimalistic hardware? Because this dedicated functionality may not be so computationally demanding functionality. So in that case, it would be so easy for manufacturer to keep the hardware cost as low as possible. So the whole objective of embedded system is all about building a minimalistic hardware with a bare minimum software that performs a dedicated functionality. If you have all these three cause and effects, then you call it as an embedded system. So generally embedded systems are programmable. So when I use the term programmable, you can be able to alter the functionality during its development and way beyond its development phase.
And these embedded systems are typically low power systems since we cannot be able to afford the continuous energy supply. And these are which have very little amount of memory in terms of RAM and ROM and very little amount of peripherals. Let us consider a very quick example on a weighing machine. So a typical weighing machine will have a LCD screen and a pressure sensor. So just by sensing the pressure, it is going to compute the weight of a person in terms of kilogram and going to display in the typical LCD screen.
So for this application, you don't really demand a computationally good hardware. With a very limited hardware, this functionality can be implemented. So that's a perfect example of a typical embedded system. Here I try to bring you some more detailed, very well structured examples on embedded system. You can consider your handheld PDAs as a typical embedded system because your PDA contains enormous number of sensors, dedicated operating systems, and a GUI based application and a processor. So with having all this, you can be able to say that it is performing some sort of dedicated application with sophisticated hardware.
Similarly, if you consider a typical vehicle where you will find 100 plus electronic control units performing different kinds of applications. Let's say, for example, let's say, for example, let's say, for example, there could be an ECU. The ECU stands for electronic control unit. The ECU that's residing in a vehicle can perform or can support in the cruise control application or can perform a suspension control application or can able to perform airbag deployment application or can able to control entire engine management system. So all these ECUs are electronic control units are interconnected and they share data among themselves.
So this architecture is considered as kind of a sophisticated distributed embedded computing system. So automotive electronic system or a vehicle itself is a typical example of a distributed embedded system, which exchanges complex set of values between each of different ECUs. So let's say other examples from other different domains, such as industrial machines, you see all the automated system and autonomous robotic systems, all these systems fall under the family of embedded system. And we have embedded system applied in medical electronics field for certain complex diagnostics and for surgical robots and much more.
So if you take embedded system itself as horizontal, you can cut that horizontal across many verticals such as the automotive, aero, medical, industrial, energy sectors and so on. Now, let's have a quick look on rates and architecture of a typical embedded system. So as I told you earlier, embedded system should contain a minimalistic hardware resource and a dedicated firmware. So firmware is nothing but the software that's very closely running on the hardware or you can assume the word firmware as a device driver that's running on your computer.
So it is either a microcontroller based system or it could be either a micro processor based system, but still a embedded system should be a low power consuming hardware. So often these systems require to meet real hard timing constraints. When I say real hard timing constraints, let's assume embedded system is controlling a nuclear power plant to control the temperature coolant flow. So let's say on every first minute or every tenth minute, if I have to change the flow of the temperature coolant into a nuclear reactor.
So if that kind of a critical system is controlled by an embedded electronics, then it's a very, very hard time constrained system. So you can think of employing embedded system in a typical ignition control unit. So if I want to ignite my first cylinder on 10th millisecond and my third cylinder on 20th millisecond, exactly I have to ignite on 10th and 30th millisecond. If I'm missing it, it is my engine able to or my embedded system will really fail to control the engine, the whole engine.
So my whole engine is going to get stalled and I'm not going to see any output. So in most of the cases, the embedded system is bound to have a very hard timing constraint. And these families of systems are called as real time systems. So generally, these systems are standalone systems or it could be part of a other larger system. So you can see embedded system itself as a standalone system. When I say standalone, it could be ideally as a separate unit itself. It can serve a particular functionality or it can be a part of a really big system.
A typical embedded system architecture will have these three things. So it should have a hardware, a reprogrammable hardware. On the top of this, it will have firmware and the real time operating system may or may not have a real time operating system, but really need to have a firmware or a device driver. And on top of this, you need to have an application software. So a hardware can be a microprocessor, can be a microcontroller, can be a system-on-chip unit or can be an ASIC completely. So ASIC stands for application-specific integrated circuit.
So other than this, you may have on-chip peripherals and on-board peripherals. So all together, it formulates your hardware unit of a typical embedded system. So on top of this, we have our device driver developed for driving the hardware interfaces as well as the hardware low-level peripherals, I would say. So basically, it is going to contain the required amount of device drivers. And the device drivers are sufficient enough to abstract the... Referrals and you may or may not have an operating system depending on your application whether if your application needs a real-time constraint you may use a real-time operating system if your application demand some sort of multi-threading or multi-tasking you may use RTOS so this term RTOS is pronounced as RTOS on top of this you have a typical application software this application software can be viewed as a complex computational function such as a digital filtering logic or such as a PAD control algorithm or some more complex control algorithm it could be anything or even it could be a GUI based application but these application software are very clearly divided from the hardware through the device drivers or through the firmware so I mean to say the application software is also written in C language and firmware and RTOS even these are written in C languages and everything is compiled together and everything is compiled together and put it on the hardware but as a process of development application software follows a different or undergo a different cycle of development a firmware will undergo or firmware and RTOS the base software will undergo a different form of development cycle this is about the typical embedded system architecture a typical embedded system structure will look like this so it will have a sensor for sensing something it will have the microcontroller unit inside the microcontroller unit you may have many on-chip peripherals like ADC, ADC, memory and you also will have processor and R-ASIC which is comprising the core part of your microcontroller unit you also have the output device as the output device as the output device as the output device as the actuator could be a display device it could be a mechanical system moving something closing opening something it could be of anything so the output device is typically called as actuators these interfaces are collectively called as onboard peripherals so there could be a even the sensor can detect a change that's accustomed by or created by the actuator and it could be a closed loop system it could be open loop system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from system from How much amount of delay that I can be able to accommodate in one complete cycle of operation of a typical embedded system is what I call it as latency here.
So based on the latency, you can assume latency as a unit delay, like delay that is created by one complete run of the embedded code. So based on that, we can classify the embedded systems into real-time systems or non-real-time systems. So instead of the word non-real-time systems, I'm using the word soft real-time. Based on several literature, even this word is producing the same meaning. So it is termed, some systems are termed as hard real-time. And the system which can accommodate more amount of latency are called a soft real-time system.
So again, there are two different flows. So since this course is pertaining more towards EV application of embedded system, so I have come up with a category. So classifying the real-time system into non-automotive and automotive. A typical non-automotive system will have some sort of real-time operating system plus low-level drivers comprising of their basic software and some sort of application that's written with C and C++. And if it is a typical automotive application, you have your basic software coming from the Autosar stack and microcontroller abstraction layer, which is also part of most of the time part of Autosar stack.
So this comprises my basic software. Here the flow is slightly different where this Autosar stack is available as off-the-shelf product. You buy it, you configure it, and you use it as per your application need. And that's one flow of having the basic software. Then you have your application, which is built on top of this basic software. Follow a different approach. So where MBD stands for model-based design, the application on the high level is done with model-based design plus autocode generation. So converting the autocode generation is all about the process of converting the developed model into an equivalency code.
So finally, this is compiled together and put it on the hardware. So this is a typical workflow that happens with any of the automotive industry. So on the soft real-time side, where you have application built on sophisticated GUI tools such as Qt, QML framework, or Python, and your basic softwares are reused as embedded Linux drivers. So in software real-time or in soft real-time systems, I can afford more amount of delay in one complete iteration. So it is a slightly heavier system. I assume your infotainment system in the vehicle is a best example of a soft real-time system.
I can, even after pressing a button, I can wait for 5 seconds, 10 seconds. Nothing, big catastrophe is going to happen and system is still going to work. So for this kind of soft real-time system, one can use the embedded Linux drivers and build the application with a very beautiful GUI-based framework. So let me move on. Here I have given several examples based on automotive embedded software domains and what are different skill requirements that is needed to get into each of these projects or to get into each of these verticals.
The verticals that you are seeing here are categorized into four from Powertrain, EV, ADAS, AD, AD stands for Autonomous Diving, and Body Control Module, and Instrument Cluster, and Infotainment System. So this Powertrain and ADAS uses a different set of skill set or require different set of skill set, which I call it as MBD with Autosar, as I've explained in my previous slide. And if you are completely working on pure Autonomous Diving, you need to have a skill of ROS and C++, working with the ROS and C++ stack.
And if you are completely working on the body control module, still body control module goes with MBD and Autosar part. And this telematics and infotainment system is completely built with the horizontal skill set of Qt, QML, plus Linux driver and Android. So ideally, these are not a typical entry-level job if you are claiming as an embedded engineer in your career. So one point or the other, you need to upskill these technologies to enter into any of these streams. Now, let me discuss some part about the embedded software architecture.
So, so far, we have seen about the embedded system classifications based on the latency requirement. Now, I'm going to speak about how different forms of embedded software can be possible or can be created. One is we can have a pooling-based super loops. Other one is interrupt-based software. And third one is multitasking or multithreading. So, let me take you through one by one. A pooling-based super loop is nothing but you have one continuous loop or which is continuously running or which is, let's say, for example, it has 10 lines of code.
And 10 lines of code is running at a delay time of 10 millisecond. Then every one second, the one line may run. Or after completing this 10 millisecond, again, the first line is started. It goes in a cyclic way. At a periodic interval, all the subroutines are addressed once. So, there, in the fifth line, if you are trying to read a sensor value, and on the eighth line, if you are trying to write that sensor value in certain memory, so this is going to happen only once in the entire infinite loop or once in that loop.
So, ideally, you can end up with having these operations performed on a periodic interval. This is what I mean by pooling-based super loop methods. And, but there is other architecture, so where you have a chance of, based on your priority and based on that triggering, irrespective of this pooling operation, you can start your subroutine. Whereas, here, the subroutines' intervals were periodic. Whereas, in here, the subroutines' intervals are not executed. So, here, it's an activity. There, I mean, in there, I don't know. The periodic rate. So I think there is a typo in this slide. The subroutines are really not executed on a periodic rate, on a fixed periodic rate, I would say, in the case of polling, whereas here it is executed on a different periodic rate based on the need and the triggering.
So let's say, for example, I'm assigning a task to someone and that was interrupted by myself and again I'm assigning other high priority tasks, then the assignee should take the high priority task which I have assigned. If I build a software architecture based on this triggering method, then this interrupt service based software, interrupt based software, will be running certain interrupts and before completing that routine, it will jump into other part. So that kind of requirement is also there in the embedded software. For that, we are creating interrupt based software.
And the third one is multitasking and multithreading. So which is really needed when you need to have multiple tasks or when simultaneously multiple tasks has to run and there should be a strategy for switching between one task to other's task and there should be a mechanism to exchange value between multiple tasks and there should be a need or a feature for synchronizing multiple tasks together. All these, all these, all these, all these, all these comes with the multitasking and multithreading implementation. So this threading implementation is possible in C language too. And most of the times if we are using multithreading application, we will be going with OS based strategies or OS based systems.
Now let's do a quick comparison on the computational hardware size. So typical computational hardware of a desktop or a mobile phone shown in the left hand side and embedded system hardware is shown in the right hand side. So a desktop is used for general purpose application and embedded system is used for a dedicated digital control application. So here we will have a few RAM ranging from few MBs to GBs. Whereas here you have RAM ranging only in few KBs. And here we can offer unlimited amount of energy and here we cannot able to offer that amount of energy since it's battery operated.
Here our goal is basically between cost versus performance. Here our need was to meet the necessary performance at the lowest possible cost. Because most of the time the embedded system is seen as a very mass market. If I could be able to save 10 rupees per system per hardware, assuming that I'm going to sell one lakh number of pieces that will introduce a huge cost saving for me. Now let's try to understand what is the RAM limitation that we have in the embedded system. So as I told you, the size of RAM in the embedded system is as low as possible as mentioned here.
So different microcontrollers, I have listed a few different families of microcontrollers such as Atmega 328p, STM32F from STM, Atmega is from Atmel. This kinetics scale series from NXP. So each of them has a very low amount of memory ranging from 2 KB to 16 KB. So these kind of microcontrollers are really sufficient enough to do the digital control applications. Let's say I want to turn on something, turn off something, do some small computation. So for this, for doing those things, this RAM should be really sufficient.
So being an embedded engineer, one has to really think in a minimalistic way so that they can be able to use this microcontrollers for their application development. So coming to the memory ROM limitations in the embedded system. So as I shown you the RAM limitation, still we have limitations on the ROM side. So RAM is for performing or just temporarily holding few intermediate variables that are used during the calculation. Whereas ROM is a place where your algorithm is going to decide. So some typical ROM values or ROM sizes will range from 32 KB to 128 KB.
So this point we have already re-iterated or iterated multiple times. So energy consumption in embedded system is very critical. We cannot able to afford more amount of energy in most of the times. Being this embedded system devices are having a small battery and it cannot able to afford multiple battery replacements. And many of the microcontrollers even offer something called as low power modes at the hardware level. Since in the computer we have the battery saving option and the different power modes on the software level. Microcontrollers still offers low power modes at a hardware level also.
Many of the unused peripherals and architecture is built in such a way that you can put your or operate your microcontroller in the low power mode. Then coming to the processing power. So every microcontroller will typically have two buses. One is called as address bus and the other one is called as data bus. So in this the data bus width is going to decide your processing power along with the clock frequency. So the processing power of a typical embedded system can be understood by two parameters.
One is the width of the data bus as well as the clock frequency. And the width of the address bus denotes the maximum amount of memory location that an embedded system can be able to access. So here I have given some of the numbers. So based on the architecture of the microcontroller it varies from 8 bit to 64 bit. And how do I select my hardware for embedded system. So these are the following criteria I would say. One is we need to look into our application latency.
Other one is we need to look into our application footprint size. Footprint size is nothing but the compiled code size. If my compiled code size is not able to or unable to fit into the available memory of that microcontroller. Then there is no point in choosing that microcontroller. So we need to look for processing capability, ROM RAM size. Along with that we also need to look whether we have a proper tool chain for that particular selected version of microcontroller or microprocessor. And we have enough documentation support.
And again the cost that we are efforting like spending on that microcontroller is really reasonable. Now we will discuss why still after the advent of multiple programming languages, still we are using C language as a preferred embedded software development language. So the answer is C is always considered as a middle level language. Why? Because C supports the very low level memory access, especially memory access. I can be able to access the variables memory through its address with the help of pointer. This is one of the great features of C language so that it can be easily adapted in the embedded program development.
And C language is a processor independent language. Just with a little amount of change I can make my program to work or can be ported across multiple different architectures as well. And C 99 offers a set of data types, standard integer data types, which are really suitable for embedded system application. And with the use of C 99 data types, only we can able to achieve the portability of the code. So C supports some of the low level operations such as bit manipulation, dynamic memory allocation, memory management, multi threading.
So C offers these amount of enormous features. So still C is considered and C will be continued always for a preferred language or preferred choice of embedded system. So still a thought for the participants who are watching this video, there are new language such as Rust are coming up in the market, which also can be seen as a better language for developing embedded software. So you can do a quick Google search on the Rust language, try to understand its feature. And if you feel it, it is interesting for you, try to upskill yourself on Rust programming too.
Now we will see a quick demo on setting of the toolchain. As far this course is concerned, we will be installing the STM 32 cube IDE. IDE is a typical integrated development environment, which will have multiple things like there will be a provision for developing an embedded software, which we call it as an editor. And it will have a compiler. Compiler can be a native compiler and a cross compiler and it will have a linker and it will have a debugger. So all these collectively is what we call it as a ST like IDE integrated development environment.
This course, we will be using the STM 32 cube IDE. You can use any IDE of your choice. This IDE really doesn't matter what kind of compiler that we use and what kind of debugger that we use is something that really matters. So if you are learning this particular IDE, this is going to help in the upcoming courses also. So... REGGIE WATER ... ... ... That's the reason why we are going with this IDE as such. Just go to this link that's shown here or do a Google search on STM32CubeIDE.
You'll end up with this page where you could be able to select the latest version. I think on today's date, the latest version is 1.8.0. Just click the selected version and according to your OS. So, I'm preferring the Windows IDE so I can be able to select this particular version. So, this, once you selected this, it will verify your email address and it will generate a link. From that link, you can be able to download the available or the Win installer for Windows installer for STM32CubeIDE.
Once you start downloading the STM32CubeIDE, so you will have this kind of zipped package around 820 MB got generated or got downloaded. You just go ahead and unzip this particular package. Once you unzip this particular package, you will have the STM-EXE as shown here. Just right-click and try to run as an administrator. So, that will avoid all the possible problems. Once you did this, we will be invoking this particular window. From here, it is all about clicking next installation. Just, you have to choose a path where you want to install it.
It is up to your choice. And make sure that you check these two drivers turned on. And the ideal required space is around 2.3 GB. And it takes some 5 to 10 minutes to complete or to reach this completion phase. So, in my PC, I have already installed the STM-CubeIDE with following all the steps. So, there is one important catch here. STM32CubeIDE, by default, it contains a cross-compiler. So, since in this course, so this course is going to focus more on the feed programming on the host machine.
So, we may not use the cross-compiler as such. So, we are going to download a native compiler. So, whereas that you build the application to run on this host mission itself. For that, we are going to use a GNUC compiler. So, let me explain what is the terms host and target. So, generally, for any embedded system, the software is developed on a computer and executed on another device. Another computer, which is going to be a microcontroller and a processor. So, here this microcontroller and processor is called as the host.
Whereas, this is called as a target and computer is called as the host. So, here is the key differentiation between host and target. So, host is usually a high-performance computer, which has higher memory, in which the embedded software is created. Whereas, the target machine is typically a microcontroller or microprocessor with limited amount of resources in which the developed embedded software is executed. It means I am going to develop my embedded software in the host machine. Then, I am going to port it or cross-compile it and put it on the target machine.
So, for this, you require a cross-compiler. Whereas, if you are building an application or you are writing the code in the host machine and building the application for the host machine, then only the native compiler itself should be sufficient. So, a typical example for native compiler is GCC in Windows. And the cross-compiler would be target-specific compilers for AVR, ARM, and so on. So, basically, it translates the program for the same platform in which it is running. This cross-compiler actually translates the program to a different platform.
So, I am going to copy this particular URL and put it here. Already, it is there. So, it is the official MinGW64. Just look for Windows Build. So, and in the Windows Build, just go ahead and click this one. You will be able to see the WinBuilds available for Windows. So, I have already downloaded it. Let me go straight away run the WinBuild that we downloaded. So, it is going to take some time. So, once you have this WinBuild installation up, just go ahead and give that your system to install for should be SIGWIN or MSYS.
And your architecture to install for is x86-64 in my case. So, mostly everybody would be using some sort of x86 architecture. So, go ahead and browse. So, you need to enter a folder where your necessary C files should get installed. Already, in the C drive, I have created a folder named MinGW. I am just selecting it. If you don't have that, just go ahead and create it. Then, once this is selected, now all the necessary package required is going to get downloaded. And, so, very importantly, we need to have these, all these tools is good to have.
Very importantly, you need to have GNU binary development tools, which will have all our GCC packages. And, so, base GCC package with C support and C++ for GCC and GNU symbolic debugger. All these are very small in sizes. So, just go ahead and process all those. Even there could be 92 packages. It may take a while, not more than 10 minutes, depending on the speed of the internet. Let it get downloaded. And, once it got downloaded, it will be successfully installed in the folder that you have already selected.
Once all this downloaded happened successfully, it will proceed to install each of the packages in the respective folder that we have selected. So, here you could see on the console window, you could see that GCC, GDB, the respective version installing is done. So, all these 92 packages will proceed to install. So, once you see that all the packages are installed, you could see this, all the state has been changed to key passes. And, just proceed to check whether they have been installed successfully. So, before that, you can go ahead and see the folder where you have mapped for installing it.
So, under min.gw, you will see opt created and you will see all the respective binaries. Just look for the GCC, GDB. So, you have GCC and G++, you have GDB. So, just copy this link, so that you can be able to add this in the path. Just, to add the path, go for System Advanced Settings. Under System Advanced Settings, so just go ahead and edit this variable path. So, I have already mapped it. So, just to create a new one, click new and paste it. Since, I have already added it, I am removing one.
Click OK. Now, to check this, whether it got properly installed, to check the version, just go for your command window. And, type for GCC as an iPhone version. This is going to tell you what is the GCC version and just type GDB. This is going to get into you the GNO debugger. So, to come out of it, just execute quit. So, this is how you can able to successfully install the necessary GCC package for your host machine. So, once you have done the environment variable setting and you have done mapping all your GCC compiler, now let's go ahead and open the toolchain and we'll go ahead and create our first project.
So, there are certain catches here when we are creating a new project. First, we need to create a workspace. Inside a workspace, our workspace is a place where you have collection of projects. So, inside workspace, you have to create a project and that project can be of any of this type. It could be a C++ project. Other than that, you can go ahead and create STM projects as well. And, very importantly, now we are going to write C programs which are going to be compiled for the host machine.
So, when you create your project type and you map your toolchain, Make sure that you are not choosing cross-gcc or mcu-hom-gcc. Rather, you have to choose min-gw-gcc. So that's the package which we have installed just now. So once that is created, now then we can be able to directly write our first allow-world program and we'll see how to execute and I'll take you to the execution step and bringing up your first output. And we also will see and understand and spend some time in seeing the IDE layout.
So here I have listed some of the steps that are really necessary to build a binary with our stm32 IDE with the gcc compiler. Now let me show the real demo. I am about to open the stm32 IDE. It will take a while. So the very first step is to create the workspace. So already I have created a workspace. Workspace is nothing but a folder inside which we are going to have a collection of projects. So once I launch it, so my IDE is going to open with that particular workspace.
Now let me close all the projects that I have. I'll go ahead and delete. So generally if you are opening it for the first time, you'll have the information center popped out and you have this window. The correct step or correct way for creating the project is just go to your file and create a new C or C++ project. Please don't choose STM or STM project or STM for a QMX configuration. So just choose only C or C++ project. So instead that you can choose C++ Manage Build.
Still you can choose C Manage Build also. I am choosing C++ Manage Build and give a project name. So my first project, I am going to name it as First Project. And as I told you, very importantly, we need to choose our MinGW GCC as our toolchain. So if not, we end up in cross-compiling our executable rather creating it for the host machine. Just go ahead and finish it. So then you will see. So this is your workspace. Inside your workspace, your first project is created.
And now inside your project, you need to add your C programs. So that I right-click, I will go to New. And so to create that, I am going to create a C source file. So here you need to give the file name. I am just creating it as Hello World. Very importantly, you need to give the extension as .c or else it is not going to be created as a C file. Now this is created. Just go ahead and type your first program. And we will also see how to compile and build this.
I am going to write a simple Hello World program. So those who are completely new to C programming, let's not worry about what is actually getting in now. I will explain the layout and arrangement of the program in the upcoming slides. But the objective here is to understand the IDE and how to write a first program and run it. Simple Hello World. So once you have written this, you can be able to save it by just by clicking this button or this button. And the two steps that is involved to see the output is first we have to build it.
Then we have to run the executable. So building will result in creating the executable for host machine and running it will help you to see the output in the console. So on back of this, there are some four-step process that's happening. So we will discuss about that four-step process involved in the compilation process in our upcoming classes or in our upcoming lectures. So now let me go ahead and build the selected file. So you can do the build process in two steps, either by choosing the selected file.
Sometimes your project may have N number of C files and N number of user added H files. And if you want to build only one selected file, you can do that. In our case, or at least in this example, we have only one C file per project. You can directly go ahead and build the entire project. So both are equivalently the same. So I'm going and selecting the... So now it is going to run this particular command with passing this. So the result of this is going to be creation of object file once that is there up and linked with the library.
You could be able to see the executable binaries created. So this is my executable binary that got created. Now let me try running this. So to run this, again, there is a catch, very important catch here. Just right click your project and try to run that application as local C or C++ application. Why? Because you are not creating an application for STM Cortex. You are creating an application as a C or C++ local application. So now it is going to show me the output here. So let...
This is how you can able to execute your very first program. Let me spend some time in explaining the layout of this IDE. So this part is called as your project explorer. This entire part is called as the project explorer. So this is your project explorer. So which will have or which will actually load the workspace. So your workspace is actually opened as a project explorer. Inside that workspace, you will see all the loaded projects, multiple projects. Inside the projects, you will see your source file and your created executable file, source, exe, and your necessary header files or your library files.
Then this part is called as your editor. So editor is the place or it's a layout where we can edit our program, read and write your program. And this is our console. Console is a place where we see our standard output. All the standard output that we are streaming to the screen are displayed on the console. So this is a place where you can see the outline of the C program. So if your C program has 100 plus functions like this, all those 100 plus functions are listed here.
You can jump from one function to other function. And this is a place where we call it as the stack analyzer or the build analyzer. So this part we will discuss in the later phases of this course. So that's about the layout of this particular IDE, STM32. So there are multiple IDEs you can, for this course, you can use GCC with multiple IDEs such as code blocks. These are free IDEs and these are much sophisticated than STM32 IDE, which we are using. But there is a reason for the selection of STM32 due to its usage and continuation in the upcoming course.
So this STM32 is an Eclipse-based IDE. For that matter, you can use any Eclipse-based IDE. And you can use VS Code. VS Code is another IDE, other popular IDE. So GCC is running at the backend. It's your toolchain. This is going to comprise your toolchain. And this could be your IDE. Hope this is clear. And we are at our end of first session. So let's catch up in our second session. Thank you.