Platform Migration Guide to Qt for MCUs 2.0
Here are the changes to be aware of when porting a platform from Qt for MCUs 1.x to 2.0.
Qt for MCUs now uses architecture-based builds, so it's important to specify the target platform's architecture. This can be done by using the
QUL_PLATFORM_ARCHITECTURE variable in cBoardDefaults.cmake. See Architecture and Platform-specific Build Settings for more information.
BoardDefaults.cmake configuration variables
The following CMake configuration variables that are used in the
BoardDefaults.cmake, have been renamed:
|Qt for MCUs 1.9||Qt for MCUs 2.0|
In addition, the QUL_PLATFORM_DEFAULT_RESOURCE_PIXEL_FORMAT_ALPHA and QUL_PLATFORM_DEFAULT_RESOURCE_PIXEL_FORMAT_OPAQUE variables should be set. See CMake API changes in 2.0 for more information.
Compile and link options for the platform
CompilationOptions.cmake file, containing the compiler and linker flags specific to your platform, to
Set the default linker script using the
qul_platform_add_default_linker_script() CMake function in the platform's
In the previous Qt for MCUs versions, this was done using the
LINKER_SCRIPT variable in
Platform kit configuration file
envVar attribute of the
boardSdk attributes are replaced by the
cmakeCacheEntries attribute. See the Creating the platform kit configuration file section for more information.
Platform target name
The platform target has been renamed from
Platform. Update the
target_compile_definitions, and other relevant CMake commands to use the new target name.
Move the implementation for the following fuctions into a sub-class of the Qul::Platform::PlatformContext class:
frameBufferingType should be
const member functions.
In addition, add the initializePlatform member function to perform any platform initialization that is not directly hardware related.
Finally, implement the Qul::Platform::getPlatformInstance() function and make it return a pointer to a singleton platform instance.
QUL_STATIC_ASSET_SEGMENT is no longer used. Instead, memory for preloaded assets is allocated using the memory allocator returned from Qul::Platform::PlatformContext.
Refer to Memory allocation in Qt Quick Ultralite platform abstraction for details about how preloading can be implemented.
Resource storage location
Instead of using
QUL_STATIC_NO_PRELOAD_ASSET_SEGMENT, now the resources are by default placed in the
QulFontResourceData segments. See Getting started for more information.
Available under certain Qt licenses.
Find out more.