C

Integrating Qt Quick Ultralite with Qt Creator

This topic describes how you can manually integrate Qt Quick Ultralite into Qt Creator to build, deploy, and debug Qt Quick Ultralite applications.

Prerequisites

The manual integration with Qt Creator assumes that you have the prebuilt Qt Quick Ultralite binaries. The compiled application sources are linked with the Qt Quick Ultralite binaries.

In Qt Creator, you must be able to create a custom kit for all your target platforms. The custom kit is required for building, linking, and deploying external applications.

Before proceeding, make sure your JOM installation is added to PATH. By default JOM is a part of Qt Creator installation, so make sure bin directory (e.g. C:\Qt\Tools\QtCreator\bin) is in your system PATH variable.

To be able to build Qt Quick Ultralite applications running on desktop, you will need Microsoft Visual Studio Compiler (MSVC). MSVC is a part of Visual Studio 2017 Express for Windows Desktop. It can be downloaded from Microsoft.

Building with CMake

To run Qt Quick Ultralite applications, you must configure a kit in Qt Creator to build with CMake. For more information about adding a new kit in Qt Creator, see Adding Kits.

Configuring kit for desktop

To configure the kit, launch Qt Creator and select Tools > Options > Kits > Kits. Select the kit for your desktop platform.

In Environment, define the Qt Quick Ultralite installation directory as follows:

Qul_DIR=<\Qt Quick Ultralite installation path>

In CMake Configuration, define the congfiguration as follows:

CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}
CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
QUL_COLOR_DEPTH:INTERNAL=32
QUL_PLATFORM:INTERNAL=Qt

Select OK to save your changes.

Configuring kit for NXP 1050

The NXP 1050 kit uses the CMake toolchain file to set a C compiler and a C++ compiler. The kit does not use Qt at all.

To configure the kit, launch Qt Creator and select Tools > Options > Kits > Kits. Select the kit for your NXP 1050 device.

Leave the following fields blank:

  • Compiler_C
  • Compiler C++
  • Qt version

In Environment, define the environment as follows:

ARMGCC_DIR=<Path to your arm toolchain installation>/gcc-arm-none-eabi-8-2019-q3-update-win32
EVKB_IMXRT1050_SDK_PATH=<Path to your NXP SDK>/SDK_2.5.0_EVKB-IMXRT1050
Qul_DIR=<\Qt Quick Ultralite installation path>

In CMake Configuration, define the congfiguration as follows:

CMAKE_TOOLCHAIN_FILE:INTERNAL=<\Qt Quick Ultralite installation path>/CMake/evkbimxrt1050-toolchain.cmake
QUL_TARGET_STORAGE:INTERNAL=Flash

Note: To set Device Type and Debugger, see NXP 1050 environment.

Note: You can ignore warnings that are related to the kit configuration.

Configuring kit for STM 32F769i

The STM 32F769i kit uses the CMake toolchain file to set a C compiler and a C++ compiler. The kit does not use Qt at all.

To configure the kit, launch Qt Creator and select Tools > Options > Kits > Kits. Select the kit for your STM 32F769i device.

Leave the following fields blank:

  • Compiler_C
  • Compiler C++
  • Qt version

In Environment, define the environment as follows:

ARMGCC_DIR=<Path to your arm toolchain installation>/gcc-arm-none-eabi-8-2019-q3-update-win32
STM32CUBE_FW_F7_SDK_PATH=<Path to your STM32CUBE SDK>/STM32Cube_FW_F7_V1.15.0
Qul_DIR=<\Qt Quick Ultralite installation path>

In CMake Configuration, define the congfiguration as follows:

CMAKE_TOOLCHAIN_FILE:INTERNAL=<\Qt Quick Ultralite installation path>/CMake/stm32f769i-discovery.cmake

Note: To set Device Type and Debugger, see STM 32F769i environment.

Note: You can ignore warnings that are related to the kit configuration.

Configuring kit for Renesas RH850

Note: Support for Renesas is available in the later Qt Quick Ultralite releases.

The Renesas RH850 kit uses the CMake toolchain file to set a C compiler and a C++ compiler. The kit does not use Qt at all.

To configure the kit, launch Qt Creator and select Tools > Options > Kits > Kits. Select the kit for your STM 32F769i.

Leave the following fields blank:

  • Compiler_C
  • Compiler C++
  • Qt version
  • Debugger

In Environment, define the environment as follows:

GHS_COMPILER_DIR=<path to the Green Hills C/C++ compiler>/comp_201815
RGL_DIR=<path to the RGL installation>/D1x_RGL/rgl_ghs_D1Mx_obj_V1.9.1a
Qul_DIR=<\Qt Quick Ultralite installation path>

In CMake Configuration, define the congfiguration as follows:

CMAKE_TOOLCHAIN_FILE:INTERNAL=<\Qt Quick Ultralite installation path>/CMake/renesas-rh850d1m1a-toolchain.cmake

Note: You can ignore warnings that are related to the kit configuration.

Deploying and debugging

Desktop environment

When you use Qt as a back-end for Qt Quick Ultralite, you can run and debug your Qt Quick Ultralite applications just like other Qt desktop applications.

NXP 1050 environment

To deploy and debug applications in the NXP 1050 environment, you must first set up the J-Link GDB server as follows:

  1. Install J-Link GDB server.
  2. Start the GDB server in a terminal as follows:
    JLinkGDBServer -device MCIMXRT1052 -if SWD -scriptfile <\Qt Quick Ultralite installation path>/CMake/evkbimxrt1050/evkbimxrt1050_sdram_init.jlinkscript

    You can also start the GDB server via its user interface:

Launch Qt Creator and enable the Bare Metal plugin:

  1. Select Help > About Plugins > Device Support > Bare Metal (experimental).
  2. Check the Load checkbox to enable the Bare Metal plugin.
  3. Select Close.

Add the default GDB server provider as follows:

  1. Select Tools > Options > Devices > Bare Metal.
  2. Select Add > Default to add your custom provider.
  3. In Name, enter a name for the J-Link GDB server.
  4. In Startup, select No Startup.
  5. In Host, enter localhost and 2331.
  6. In Init Commands, enter as follows:
    mon reset
    mon halt
    load
    mon reset
    mon halt
    eval "monitor reg pc %#x", &Reset_Handler
    mon go
  7. In Reset Commands, enter as follows:
    mon reset
    mon halt
    eval "monitor reg pc %#x", &Reset_Handler
    mon go
  8. Select OK.

Add a new NXP device as follows:

  1. Select Tools > Options > Devices > Devices.
  2. Select Add > Bare Metal Device.
  3. Select Start Wizard.
  4. In New Bare Metal Device Configuration Setup, enter a name for your NXP device.
  5. In GDB server provider, select the J-Link GDB server that you added in the earlier steps.
  6. Select Finish.
  7. In Device, select your NXP device. Its GDB server provider is the installed J-Link GDB server.
  8. Select Apply.

Set a custom debugger for your NXP device as follows:

  1. Select Tools > Options > Kits > Debuggers.
  2. Select Add.
  3. In Path, browse to the path of arm-none-eabi-gdb-py.exe.
  4. Select OK.

Update your NXP 1050 kit to use the added NXP device and the custom debugger:

  1. Select Tools > Options > Kits > Kits.
  2. Select your NXP 1050 kit.
  3. In Device type, select Bare Metal Device.
  4. In Device, select the NXP device.
  5. In Debugger, select the custom debugger.

Now your environment is ready for deploying and debugging code that runs on your NXP 1050 board.

STM 32F769i environment

To deploy and debug applications in the STM 32F769i environment, you must first set up the GDB server as follows:

  1. Install STM32CubeIDE.
  2. Install STM32CubeProgrammer.
  3. In a terminal, go to a folder where you can start the GDB server. For example, in Windows the folder can be as follows:
    C:\ST\STM32CubeIDE_1.0.2\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_1.0.0.201904160814\tools\bin

    It is possible that you need to add the path to the PATH environment variable.

  4. Start the GDB server. For example, in Windows the command can be as follows:
    ST-LINK_gdbserver.exe -l 31 -p 61234 -r 15 -d -cp "C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin" -el "C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\ExternalLoader\MX25L512G_STM32F769I-DISCO.stldr"

Launch Qt Creator and enable the Bare Metal plugin:

  1. Select Help > About Plugins > Device Support > Bare Metal (experimental).
  2. Check the Load checkbox to enable the Bare Metal plugin.
  3. Select Close.

Add the default GDB server providers as follows:

  1. Select Tools > Options > Devices > Bare Metal.
  2. Select Add > Default to add your custom provider.
  3. In Name, enter a name for the ST-LINK GDB server.
  4. In Startup, select No Startup.
  5. In Host, enter localhost and 61234.
  6. In Init Commands, enter as follows:
    load
  7. In Reset Commands, enter as follows:
    mon reset
  8. Select OK.

Add a new STM 32F769i device as follows:

  1. Select Tools > Options > Devices > Devices.
  2. Select Add > Bare Metal Device.
  3. Select Start Wizard.
  4. In New Bare Metal Device Configuration Setup, enter a name for your STM 32F769i device.
  5. In GDB server provider, select the ST-Link GDB server that you added in the earlier steps.
  6. Select Finish.
  7. In Device, select your STM 32F769i device. Its GDB server provider is the installed ST-Link GDB server.
  8. Select Apply.

Set a custom debugger for your STM 32F769i device as follows:

  1. Select Tools > Options > Kits > Debuggers.
  2. Select Add.
  3. In Path, browse to the path of arm-none-eabi-gdb-py.exe.
  4. Select OK.

Update your STM 32F769i kit to use the added STM 32F769i device and the custom debugger:

  1. Select Tools > Options > Kits > Kits.
  2. Select your STM 32F769i kit.
  3. In Device type, set Bare Metal Device.
  4. In Device, select the STM 32F769i device.
  5. In Debugger, select the custom debugger.

Now your environment is ready for deploying and debugging code that runs on your STM 32F769i board.

Renesas RH850 environment

Note: Support for Renesas is available in the later Qt Quick Ultralite releases.

Renesas RH850 environment has the following restrictions:

  • There is no GDB server available so you cannot use Bare Metal plugin.
  • You can only deploy from Windows.
  • You cannot debug directly in Qt Creator.

You can deploy to the Renesas RH850 board in the following ways:

You can integrate Qt Quick Ultralite with Qt Creator in the following ways:

Both the deployment methods can be used with both the integration methods.

Defining external tool

To flash with Renesas Flash Programmer, you can define an external tool in Qt Creator. First, set up Renesas Flash Programmer as follows:

  1. Install Renesas Flash Programmer.
  2. Launch Renesas Flash Programmer.
  3. Create a project for connecting with the Renesas RH850 device.

Add the external tool in Qt Creator as follows:

  1. Launch Qt Creator.
  2. Select Tools > Options > Environment > External Tools.
  3. Select Add > Add Tool.
  4. In Executable, enter as follows:
    C:\Program Files (x86)\Renesas Electronics\Programming Tools\Renesas Flash Programmer V3.05\RFPV3.exe
  5. In Arguments, enter a path of the PRJ project file that you created with Renesas Flash Programmer:
    /silent [PATH-TO-RPJ-FILE] /file "%{CurrentRun:Executable:FilePath}.run" /command epv
  6. Select OK.

You can flash your Renesas RH850 board in Qt Creator by selecting the defined external tool via Tools > External.

Note: This only flashes the Renesas RH850 board. To run the application, you must disconnect the E1 emulator and reset the board.

Adding custom deployment step

To flash and debug with Green Hills MULTI debugger, you must first install Green Hills MULTI IDE. Then in Qt Creator, update the kit as follows:

  1. Launch Qt Creator.
  2. Select Tools > Options > Kits > Kits.
  3. Select your Renesas RH850 kit.
  4. In Device Type, select Desktop.
  5. In Debugger, select None.

Set up the project's run settings as follows:

  1. Select Projects mode > Build & Run.
  2. Select the Renesas RH850 kit.
  3. Select Run to edit the run settings.
  4. Select Add Deploy Step > Custom Process Step.
  5. In Command, enter a path to your Green Hills MULTI Debugger installation. For example, C:\GHS\multi_716\multi.exe.
  6. In Arguments, enter a path to a device file in your Green Hills compiler installation. For example, the path can be as follows:
    -nosplash -cmd r -connect="850eserv2 -df=\"C:\\GHS\\comp_201815\\rh850\\dr7f701461.dvf\" -rh850 -e1lpd4=default -dclock=8000,0,swoff -fastflashload -id ffffffffffffffffffffffffffffffff" %{CurrentRun:Executable:FilePath}

Select Run to flash and run the application. MULTI Debugger is launched automatically.

Available under certain Qt licenses.
Find out more.