C

STM32F7508 Discovery Kit Setup Instructions

This topic helps you setup the development environment for STM's STM32F7508 discovery kit.

Board features

  • STM32F750N8H6 MCU featuring ARM® Cortex®-M7, 64-KBytes Flash, 340-kbytes RAM
  • 4.3” 480x272 Touch Display
  • 16-Mbit SRAM memory
  • 128-Mbit Quad-SPI Flash memory
  • 128-Mbit SDRAM

Setting up development environment

Qt Creator IDE

  • Launch Qt Creator and select Tools > Options > Devices > MCU.
  • Select the one of the targets from the drop-down list for Target supported by the Qt for MCUs SDK:
    • Qt for MCUs 1.6 - STM32F7508-DISCOVERY-BAREMETAL 16bpp
    • Qt for MCUs 1.6 - STM32F7508-DISCOVERY-BAREMETAL 32bpp
    • Qt for MCUs 1.6 - STM32F7508-DISCOVERY-FREERTOS 16bpp
    • Qt for MCUs 1.6 - STM32F7508-DISCOVERY-FREERTOS 32bpp
  • 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.

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.
    <QT_INSTALL_PATH>\QtMCUs\<VERSION>

    where,

    • <QT_INSTALL_PATH> is the Qt install directory,
    • and <VERSION> is the directory containing the Qt Quick Ultralite version you are using, for example 1.1.0.
  • Toolchain install path, depending on which toolchain is being used

    OR

    • For the IAR toolchain, set IAR_ARM_COMPILER_DIR to the IAR Build Tools install path.
  • 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 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

    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_F7_SDK_PATH environment variable and set it to the following path:
    <QT_INSTALL_PATH>\Tools\QtMCUs\STM\STM32Cube_FW_F7_V<version>

    where, <QT_INSTALL_PATH> is the Qt install directory.

Build configuration

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 Manual.

  • QUL_PLATFORM

    The platform to build must be set to stm32f7508-discovery-baremetal for this board.

    -DQUL_PLATFORM=stm32f7508-discovery-baremetal
  • CMAKE_TOOLCHAIN_FILE

    This platform supports the armgcc and IAR toolchains.

    -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake

    OR

    -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\iar.cmake
  • QUL_COLOR_DEPTH

    The supported color depths by this platform are 16-bit or 32-bit, with 32-bit being the default.

    Note: If this variable is not set, default color depth is used while configuring for the platform.

    -DQUL_COLOR_DEPTH=32
  • 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.

Prebuilt demos and examples

The package for STM32F7508-DISCOVERY board comes with the following prebuilt demo binaries

You can find it in the demos_images directory.

See Flashing Instructions for ST boards, for information about flashing the device.

For this board, select N25Q128A_STM32F7508-DISCO as the external loader.

Demos and examples source code

Qt for MCUs provides the source code of several demos and examples. You can modify, build, and flash custom binaries onto the target device.

Source code for supported demos and examples is organized in the following directory structure:

Note: Demos or examples that are highlighted in bold are the only ones supported on this board.

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:

cd %Qul_DIR%\demos\watch
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_PLATFORM=STM32F7508-DISCOVERY-baremetal
cmake --build .

Once you have successfully built the watch demo, you can flash it from the command line:

cmake --build . --target flash_watch

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:
    ST-LINK_gdbserver.exe -cp "<STM32_CUBE_PROG_INSTALL_PATH>\bin"

    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
    %ARMGCC_DIR%\bin\arm-none-eabi-gdb.exe <PATH_TO>\your_app.elf
  • Connect to the target via the gdbserver in the arm-none-eabi-gdb console using
    (gdb) target remote 127.0.0.1:61234

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 ).

Available under certain Qt licenses.
Find out more.