This repository contains a project example that can be developed from within a Dev Container using Visual Studio Code with its remote development extensions.
A Dev Container provides a pre-configured development environment. It allows you to work in a development environment that has been specifically configured for your repository. It will have all the tools, scripts and configurations you need to work on that project. Everyone who works on that repository will have the same environment, reducing the ocurrence of environment-related problems. Each repository can have settings that will give contributors a ready-to-use, fit-for-purpose environment, and the environment on your local machine will be unchanged.
Out of the box, the demonstration project is set to work with the IAR STM32F429II-ACA board while the debugger lauches with the IAR C-SPY Simulator, or IAR I-jet, or the SEGGER J-Link probes. Also, the project sources can be modified for working with other boards.
This project example makes use of one of the IAR public container images for Arm with device support.
Perform the following:
- Launch Visual Studio Code.
- If running from Windows, connect to WSL.


- Clone and open this repository.

Tip
This functionality depends on having Git installed. You might need to sudo apt install git
or equivalent on your Linux distribution.
- A toaster notification in the lower right corner will offer to reopen the folder to develop in a container.

Tip
The toaster nofitication only appears for a short while. If you miss it, you can use the palette (CTRL+SHIFT+P) and use, for example, "Dev Containers: reopen in container".
-
Once all project's submodules were cloned, clicking CMake extension's "Run CTest" will automatically build the project with the IAR Build Tools prior to running unit tests using the IAR C-SPY Simulator.
-
The Dev Container also installs automatically the IAR Debug extension with support for the IAR C-SPY Simulator, IAR I-jet, and the SEGGER J-Link probes. Press F5 to run with the Simulator or select the desired launcher from the Debug menu.
The IAR Build Tools require an user license to operate and, for that reason, the project will not build at first. Choose one of the following methods:
This method uses the Microsoft Entra ID technology and it requires your user mail account associated to this service.
-
Choose Terminal/Run task.../IAR Cloud login.
-
Select the authentication code and copy it to the clipboard (CTRL+C).
-
CTRL+Click on the provided link, enter with the provided code, click "Connect" and then "Continue".

- Go back to Visual Studio Code and build the project using the IAR Build Tools.
Alternatively, it is possible to use a time-limited Evaluation Token provided by IAR.
- In your host environment, set the following variable:
export IAR_LMS_BEARER_TOKEN=<the-evaluation-token-you-received>
- From within your Dev Container, access the command pallete and select "Dev Containers: Rebuild Container".
It should now be possible to build the project using the IAR Build Tools.
Amongst the many ways of building a CMake project with IAR, it is possible to use CMake Presets. The project comes with a preset for cxarm
which generates its default build scripts. Below you will find some simple sequence of commands:
# Configure the project (Debug, Release, RelWithDebInfo, MinSizeRel)
$ cmake --preset cxarm
# Build the Debug configuration
$ cmake --build --preset debug
# Run unit tests using the previous build
$ ctest --test-dir build --preset debug
Tip
You can append --verbose
when building the project or running ctest
for additional details on what CMake is executing behind the scenes.
Dev Containers simplify bootstrapping the whole development environment with the IAR Build Tools in Visual Studio Code.