IAR Embedded Workbench for STM8 is a complete development toolchain for STMicroelectronics' 8-bit STM8 microcontrollers. It provides a user-friendly integrated development environment (IDE), a powerful C/C++ compiler, a comprehensive debugger, and an integrated code analysis tool. In this article, we will show you how to get started with IAR Embedded Workbench for STM8 and create a simple project.
Installing IAR Embedded Workbench for STM8
To install IAR Embedded Workbench for STM8, you need to download the installer from the IAR website[^1^]. You can choose either a 14-days trial version or a size-limited version. The trial version allows you to use all the features of the toolchain for 14 days, while the size-limited version limits the code size to 4 KB. After downloading the installer, run it and follow the instructions on the screen. You will need to enter your license information or request a trial license during the installation process.
Creating a Project
To create a new project in IAR Embedded Workbench for STM8, follow these steps:
Launch IAR Embedded Workbench for STM8 and select File > New > Workspace.
Enter a name and location for your workspace and click OK.
In the Project > Create New Project dialog box, select C Executable Project and click OK.
In the Select Device dialog box, choose your target device from the list of STM8 devices and click OK.
In the Select Project Template dialog box, choose Blink LED as an example project template and click OK.
A new project with the name Blink LED will be created in your workspace. You can see the project files in the Workspace window.
Building and Debugging the Project
To build and debug your project, you need to connect your STM8 device to your computer using a debug probe, such as ST-Link[^2^]. Then, follow these steps:
Select your project in the Workspace window and click Project > Make. This will compile your source code and generate an executable file.
Select Project > Download and Debug. This will download your executable file to your device and launch the C-SPY Debugger[^3^]. You can see the source code, disassembly code, registers, memory, breakpoints, watch variables, call stack, and other debugging information in different windows.
In the C-SPY Debugger, click Go. This will start running your program on your device. You should see an LED blinking on your device.
To stop running your program, click Stop. You can then set breakpoints, step through your code, modify variables, evaluate expressions, and perform other debugging actions.
To exit the C-SPY Debugger, click Project > Stop Debugging.
In this article, we have shown you how to use IAR Embedded Workbench for STM8 to create, build, and debug a simple project for STM8 microcontrollers. IAR Embedded Workbench for STM8 is a powerful toolchain that offers many features and benefits for STM8 developers. You can learn more about IAR Embedded Workbench for STM8 from the IAR website[^1^] or watch this video. You can also try it for free by downloading a trial version or a size-limited version from the IAR website[^1^]. Happy coding! 29c81ba772