Iar Cmake
This video provides the fundamental steps on how to create a BXARM Docker image and how to run it on a Docker container. For more information please visit. A lot of Embedded Projects use proprietary IDEs and build processes. This make any CI/CD painful. Therefore these simple python scripts allow conversion of existing projects into CMake and corresponding linker file for GCC toolchain. Currently supported are IAR's ewp and ARM's KEIL uvprojx project formats. This tutorial shows how to import IAR projects into Visual Studio using the VisualGDB project importing plugin. We will import a sample project from the STM32 software package and show the necessary manual adjustments.
When setting up a toolchain for your embedded project, you can use the IAR compiler. CLion will detect it as a C/C++ compiler and collect the compiler information. Also, you can open the projects that use the IAR toolchain, and they should load successfully.
IAR has multiple C modes, historically they were reduced c versions for embedded that gradually improved to the full standard (which can be reduced again by e.g. Disabling rtti and exceptions). The new implementation picks the best available, but the c mode can also be overridden by defining `CMAKEIARCXXFLAG`. Cmake, is something that you either love or hate.
Only CMake-based projects are supported at the moment. As a starting point, you can create an STM32CubeMX project and edit the auto-generated CMakeLists.txt. Use our sample project as an example.
Set up the IAR compiler
Download and install the IAR workbench. Open IAR License Manager and make sure that your IAR license is activated. Note that CLion does not provide IAR licenses.
CLion's support for the IAR compiler has been tested on the ARM architecture. Keep in mind that issues or limited functionality are possible if you are targeting another platform.
In CLion, navigate to Settings Build, Execution, Deployment Toolchains
On Windows, create a new MinGW toolchain or select an existing one. Note that MinGW environment is required for you to be able to use the IAR compiler on Windows.
On Linux, use a default local toolchain.
In the C Compiler and C++ Compiler fields, set the path to the IAR compiler:
Select the debugger: you can use the bundled GDB or a custom GDB version, for example, the debugger from GNU ARM Embedded Toolchain.
- Do one of the following:
Set the newly created toolchain as Default by moving it to the top of the list. This way, you will not need to select it manually in the CMake profile.
Go to Settings Build, Execution, Deployment CMake and select the newly created toolchain in the Toolchain field of the current profile:
For details on using IAR toolchain with CMake, take a look at this technical note by IAR Systems: Using CMake with IAR Embedded Workbench
Board features
- STM32F469NIH6 microcontroller featuring ARM® Cortex®-M4 core and 324 Kbytes of RAM
- 4” TFT Color LCD Touch Display
- 128-Mbit SDRAM
- 128 Mbit QSPI NOR Flash
Setting up development environment

Prerequisites
Use the Qt online installer to install the following prerequisites. You can download the installer from your Qt account.
- Qt for MCUs SDK
- Qt Creator v4.12.4 or newer
- CMake 3.15 or newer
- Ninja 1.10.0 or newer
Note: Ninja is an optional build tool and can be replaced with others like JOM or NMake. It is not needed when using Qt Creator.
- ARM Toolchain 8-2019-q3-update or IAR Build Tools for Arm V8.50, depending on which toolchain you are using
- STM32CubeF4 SDK 1.24.0 or newer
- STM Cube Programmer 2.4.0 or newer
Note: Ensure that it is installed in the default location (
C:Program FilesSTMicroelectronicsSTM32CubeSTM32CubeProgrammer
).
Note: The Qt online installer does not install the STM Cube Programmer by default. You must select it explicitly from the list of third-party tools and SDKs.
Qt Creator IDE
- Launch Qt Creator and select Tools > Options > Devices > MCU.
- Select the Qt for MCUs 1.8 - STM32F469I-DISCOVERY-BAREMETAL 24bpp from the drop-down list for Target supported by the Qt for MCUs SDK.
- Provide the STM32CubeProgrammer install path if it is not installed in the default location.
- In the Requirements section, ensure that the platform-specific requirements are met.
- Select Automatically create kits for all available targets on start to create kits automatically.
Note: You could also manually create/remove kits using Create Kit and Remove Kit.
- Click Apply and restart Qt Creator if you choose to create kits automatically.
Cmake Iar Generator
Note: The Automatically create kits for all available targets on start option is available from Qt Creator v4.14 onwards. On older versions of Qt Creator, you have to explictly create or remove kits using Create kit or Remove kit.
Command line setup
To get started from the command line, ensure that the following these instructions:
Qul_DIR
to the Qt for MCUs SDK install path.where,
<QT_INSTALL_PATH>
is the Qt install directory,- and
<VERSION>
is the directory containing the Qt Quick Ultralite version you are using, for example1.8.0
.
- Toolchain install path, depending on which toolchain is being used
- For the armgcc toolchain, set
ARMGCC_DIR
to the ARM Toolchain install path.
OR
- For the IAR toolchain, set
IAR_ARM_COMPILER_DIR
to the IAR Build Tools install path.
- For the armgcc toolchain, set
- Add the CMake and Ninja tools to your system
PATH
. If you installed these tools using the Qt online installer, they are installed under<QT_INSTALL_PATH>Tools
. - Add STM32CubeProg install directory to
System PATH
if it is not installed in the default location. - Add
ST-LINK_gdbserver.exe
directory to yourSystem PATH
where,
<STM32_CUBE_IDE_INSTALL_PATH>
is the Cube IDE install path.Note: STM32CubeIDE is optional and required only for on-chip debugging purposes.
- Create the
STM32Cube_FW_F4_SDK_PATH
environment variable and set its value to the following:where, <QT_INSTALL_PATH> is the Qt install directory.
Build configuration
Qt Creator provides a build configuration with the kit that you created earlier for the Qt for MCUs 1.8 - STM32F469I-DISCOVERY-BAREMETAL 24bpp target. If you are using a command-line setup, configure using the following CMake variables. For more information, see the CMake Manual.
- QUL_PLATFORM
The platform to build must be set to
stm32f469i-discovery-baremetal
for this board. - CMAKE_TOOLCHAIN_FILE
This platform supports the armgcc and IAR toolchains.
OR
- QUL_COLOR_DEPTH
The supported color depths by this platform are 16-bit and 24-bit, with 24-bit being the default.
Note: If this variable is not set, default color depth is used while configuring for the platform.
Note: The precompiled evaluation binaries support only 24-bit color depth.
- QUL_COPY_TO_RAM
By default, the asset data for application is copied to SDRAM on application startup. In order to keep resources in external flash, and not load it to RAM on startup, use the QUL_COPY_TO_RAM CMake option with the value
Never
when adding assets to the application with qul_add_resource.As STM32F469i Discovery board is equipped with a fast external flash, which can be used to store assets that are used for blending/blitting operations, without the need to copy those into RAM.
Iar-c.cmake
Prebuilt demos and examples
Package for STM32F469I-DISCO
board is provided with following prebuilt demos
You can flash them onto the device using images from the demos_images
folder. Follow the flashing instructions for ST boards, and use STM32469I-DISCO
as the board name selecting N25Q128A_STM32469I-DISCO as the external loader script.
Building applications with prebuilt Qt Quick Ultralite libraries
Qt Creator IDE


Open the CMake project file for the example you want to build and configure it with the kit you created earlier. Once the project is configured, select Run or press Ctrl+r on your keyboard to build and flash the binary to the target.
Command line
The following example builds the watch
demo for this board:
Once you have successfully built the watch
demo, you can flash it from the command line:
The same procedure applies to any other application.
Reading debug messages
By default, the output of printf
calls are redirected to a virtual serial port, which is exposed on the host machine via USB.
Debugging
- Open terminal window and run the following command:
where,
<STM32_CUBE_PROG_INSTALL_PATH>
is the directory where you've installed the Cube Programmer tool.GDB Server is now listening for TCP connections on the default port,
61234
.Note: Actual TCP port used by
ST-LINK_gdbserver
is printed out on gdbserver's console. - Run
arm-none-eabi-gdb
in a separate console - Connect to the target via the gdbserver in the
arm-none-eabi-gdb
console using
Troubleshooting
ST-LINK_gdbserver
requires up-to-date ST-LINK firmware to be installed. If you see the following error:
Error in initializing ST-LINK device. Reason: ST-LINK firmware upgrade required.
you must upgrade the firmware to the latest version using the STM32CubeProgrammer tool.
If the problem persists after upgrade, retry with ST-LINK Upgrade
tool from the ST webpage ( Download ).
Cmake Compiler
Profiling application

Qt Quick Ultralite does not support profiling yet.
Cmake Iar Compiler
Known limitations
STM32F469NI does not have double-precision floating-point support. Care should be taken to avoid using them.
Due to limited SDRAM bandwidth, accessing SDRAM with the CPU may cause visual artifacts while the framebuffer is being scanned by the display controller.
Cmake Get Gcc Version
Available under certain Qt licenses.
Find out more.