1 Introduction
Usually, when debugging Qt programs, engineers need to frequently create images and burn them to the core board to test whether the Qt program is complete. This operation is time-consuming and laborious. At this time, we can use the QtCreator device function to define the device, cross-compile the Qt program on the x86_64 virtual machine, remotely deploy the program to the arm64 machine, and then remotely debug it, which greatly improves development efficiency.
2. Debugging environment
This article is verified based on the HD-T113-EVM evaluation board. The HD-T113-EVM is designed based on the HD-T113-S3 core board and has Gigabit Ethernet port, dual-channel CAN-bus, 2-channel RS-232, 2-channel RS-485, LCD, 4G/5G, WiFi, audio, etc. It has rich interfaces and is suitable for industrial field application needs. It is also convenient for users to evaluate the performance of the core board and CPU.
Linux Hosting
|
VM16.1.0 + Ubuntu18.04
|
Cross-compiler
|
arm-linux-gnueabihf
|
Qt Version
|
Qt5.12.12
|
Core board version
|
HD-T113-S3 v1.1
|
Kernel version
|
Linux kunos 5.4.61 #2 SMP PREEMPT Tue Dec 12 17:29:56 CST 2023 armv7l GNU/Linux
|
Baseplate version
|
HD-T113-EVM v1.2
|
2.1 Preparation before debugging
Make sure the Win10 host, ARM development board and Linux virtual machine are in the same network segment and can ping each other to configure the virtual machine IP. The virtual machine needs to be set up according to the following screenshot steps.
2.2 Cross-compilation environment settings
/work/T113_Tina5.0/out/t113/hd-t113-evm-emmc/buildroot/buildroot/host/qt5/bin/qmake
2.2.1 Compiler
GCC
/work/T113_Tina5.0/out/t113/hd-t113-evm-emmc/buildroot/buildroot/host/bin/arm-linux-gnueabihf-gcc
G++
/work/T113_Tina5.0/out/t113/hd-t113-evm-emmc/buildroot/buildroot/host/bin/arm-linux-gnueabihf-g++
2.2.2 Kits
2.3 Create a new device
Open Tools->Options->Devices and add a new Generic Linux Device.
2.3.1 Test success
2.3.2 Test Failure
1 - Error description SSH connection failure
Error Analysis No route to host cannot be found
Solution: Check whether the virtual machine and the development board IP are in the same network segment and can ping each other.
2 - If the virtual machine and the development board can ping each other normally, but ssh login to the development board is not possible
Reason: There are multiple Linux systems on a host, which are often switched. If these systems use the same IP, the ssh information will be recorded in the local /.ssh/known_hsots file after logging in once. After switching the system, a conflict warning will appear when using ssh to access this host. You need to manually delete and modify the content in known_hsots.
There are two solutions:
1. Delete and modify the known_hsots record, log in again, and generate a new record for known_hsots;
2. Modify the configuration file "~/.ssh/config" and add the following two lines:
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
Restart the server.
Pros and Cons:
1. You need to manually delete the file contents each time, and some automated scripts cannot run (fail during SSH login), but it is highly secure;
2. SSH login will ignore the access of known_hsots, but the security is low;
2.4 Set Kits->Device
2.5 Deploy Application
1 - When creating a new project, select Kits as T113
2 - Compile the application
3 - Deploy the application to the development board
4 - Tips
After successful deployment, you may be prompted. kbcommon: ERROR: failed to add defaultinclude path /usr/share/X11/xkb
5- Display of operation results