Developing for Bare Metal devices
Create kits to use Bare Metal toolchains installed on the computer to build applications for and run and debug them on connected Bare Metal devices.
Run and debug applications on small devices that are not supported by the remote Linux device plugin by using GDB or a hardware debugger.
Note: Enable the Bare Metal plugin to use it.
Install Bare Metal toolchains on the computer to build applications for Bare Metal devices. Connect the devices to the computer to run and debug applications on them.
Note: If you use qmake to build the project and the device does not have Qt libraries, you need a Qt installation that meets the requirements in Self-built Qt versions. In addition, the mkspecs directory needs to be complete enough to parse .pro files.
The following toolchains are supported for building applications:
- GCC: Microchip Technology (AVR, AVR32, PIC16, PIC32), NXP Semiconductors (ColdFire, M68K), Texas Instruments (MSP430), National Semiconductor (CR16C), Renesas Electronics (M32R, M32C, RL78, RX, SuperH, V850), Tensilica XTENSA (ESP8266, ESP32), RISC-V, Arm™
- IAR EW: Microchip Technology (AVR, AVR32), NXP Semiconductors (ColdFire, M68K), Texas Instruments (MSP430), National Semiconductor (CR16C), Renesas Electronics (78K, M16/R8C, M32C, R32C, RH850, RL78, RX, SuperH, V850), STMicroelectronics (STM8), 8051, RISC-V, Arm
- Keil: Arm, C51 (8051), C251 (80251), C166 (C16x, XC16x)
- SDCC: STMicroelectronics (STM8), 8051
The bare metal device type accepts custom GDB commands that you specify in the device preferences. You can specify the commands to execute when connecting using a particular debug server provider.
Debug server providers
The following debug server providers are supported when using GDB:
ST-Link and J-Link debug server providers can be used together with the uVision IDE.
To create connections to bare metal devices using a debug server provider, go to Preferences > Devices > Bare Metal and select Add.
The available settings depend on the debug server provider.
Where do the debug server and the debugger run
Qt Creator starts the debug server on the computer where Qt Creator itself runs, but the debugger connects to it from wherever the kit runs the debugger. The two are the same computer only for a local kit.
Therefore, set Host to an address that is valid where the debugger runs. If the kit runs the debugger in a Docker container, for example, a debug server that listens on the loopback interface only, as OpenOCD does by default, is reachable as 127.0.0.1 just when the container shares the network of the host (--network host). In a bridged container, host.docker.internal resolves to the address of the bridge, where the debug server does not listen, and the connection times out.
When do the commands run
Qt Creator starts the debug server first, and starts the debugger only once the server process is up. The debugger then connects to the server, and runs the commands from Init commands after the connection has succeeded.
Commands such as monitor reset halt or load therefore cannot run any earlier, because they need that connection. If the server needs a setting before it accepts a debugger connection, put it into the configuration file or the command line of the server, not into Init commands. With OpenOCD, for example, a target that it cannot examine makes it answer attempted 'gdb' connection rejected, whatever Init commands holds.
See also Add kits, Enable and disable plugins, and How to: Develop for Bare Metal.