This topic helps you setup the development environment for STM's STM32F769I discovery kit.
More information from STM32F769I Discovery Website
Use the Qt online installer to install the following prerequisites. You can download the installer from your Qt account .
注意: Ninja is an optional build tool and can be replaced with others like JOM or NMake. It is not needed when using Qt Creator.
注意:
Ensure that it is installed in the default location (
C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\
).
注意: 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.
注意: You could also manually create/remove kits using Create Kit and Remove Kit .
注意: 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 .
To get started from the command line, ensure that the following these instructions:
Qul_DIR
to the Qt for MCUs SDK install path.
<QT_INSTALL_PATH>\QtMCUs\<VERSION>
其中,
<QT_INSTALL_PATH>
is the Qt install directory,
<VERSION>
is the directory containing the Qt Quick Ultralite version you are using, for example
1.1.0
.
ARMGCC_DIR
to the ARM Toolchain install path.
OR
IAR_ARM_COMPILER_DIR
to the IAR Build Tools install path.
PATH
. If you installed these tools using the Qt online installer, they are installed under
<QT_INSTALL_PATH>\Tools
.
System PATH
若它未安装在默认位置。
ST-LINK_gdbserver.exe
directory to your
System PATH
<STM32_CUBE_IDE_INSTALL_PATH>\stm32cubeide_1.3.0\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_1.3.0.202002181050\tools\bin
其中,
<STM32_CUBE_IDE_INSTALL_PATH>
is the Cube IDE install path.
注意: STM32CubeIDE is optional and required only for on-chip debugging purposes.
STM32Cube_FW_F7_SDK_PATH
environment variable and set it to the following path:
<QT_INSTALL_PATH>\Tools\QtMCUs\STM\STM32Cube_FW_F7_V<version>
其中,
<QT_INSTALL_PATH>
是 Qt 安装目录。
Qt Creator provides a build configuration with the kits that you created earlier for the targets. If you are using a command-line setup, configure using the following CMake variables. For more information, see the CMake 手册 .
The platform to build must be set to
stm32f769i-discovery-baremetal
for this board.
-DQUL_PLATFORM=stm32f769i-discovery-baremetal
-DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake
OR
-DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\iar.cmake
The supported color depth by this platform is 32-bit.
注意: If this variable is not set, default color depth is used while configuring for the platform.
-DQUL_COLOR_DEPTH=32
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
.
The package for
STM32f769I-DISCOVERY
board comes with a prebuilt
thermo
demo binary. As Qt Quick Ultralite supports both bare metal and FreeRTOS on this board, there are different binaries for both under the
demos_images
directory. Also
Thermo
demo has two variants, one with metric units and another with imperial units.
见
flashing instructions for the ST boards
section, for more information on flashing the device. For this board, select
MX25L512G_STM32F769I-DISCO
as the external loader.
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 运行 or press Ctrl+r on your keyboard to build and flash the binary to the target.
以下范例构建
thermo
demo for this board:
cd %Qul_DIR%\demos\thermo mkdir build cd build cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_PLATFORM=STM32F769I-DISCOVERY-baremetal cmake --build .
Once you have successfully built the
thermo
demo, you can flash it from the command line:
cmake --build . --target flash_thermo_big
The same procedure applies to any other application.
To build demos or examples for FreeRTOS, add the
STM32F7_FREERTOS_DIR
environment variable and set its value to the FreeRTOS source directory from STM32CubeF7. For example:
STM32F7_FREERTOS_DIR=%STM32Cube_FW_F7_SDK_PATH%\Middlewares\Third_Party\FreeRTOS\Source
The build steps are the same as for bare metal, just the platform name is different:
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_PLATFORM=STM32F769I-DISCOVERY-freertos
注意:
If you already built the example earlier with the default configuration, you must clean the build directory or use another build directory (
build_freertos
for example).
For more information about FreeRTOS integration, refer to 使用 Qt Quick Ultralite 采用 FreeRTOS .
By default, the output of
printf
calls are redirected to STLink virtual COM Port, which is exposed on the host machine via USB. The serial configuration is the following:
Baud rate: 115200 Data bits: 8 Stop bits: 1 Parity: None Flow control: None
ST-LINK_gdbserver.exe -cp "<STM32_CUBE_PROG_INSTALL_PATH>\bin"
其中,
<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
.
注意:
Actual TCP port used by
ST-LINK_gdbserver
is printed out on gdbserver's console.
arm-none-eabi-gdb
in a separate console
%ARMGCC_DIR%\bin\arm-none-eabi-gdb.exe <PATH_TO>\your_app.elf
arm-none-eabi-gdb
console using
(gdb) target remote 127.0.0.1:61234
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 工具。
If the problem persists after upgrade, retry with
ST-LINK Upgrade
tool from the ST webpage (
下载
).