OK3568 4.19.206 Buildroot Qt-creator Remote Debug

Revision History

Date

Version

Revision History

15/09/2023

V1.0

Initial Version

Qt-creator Remote Debug

Note: Set the virtual machine IP address and the development board IP address in the same network segment.

Virtual machine IP: 172.16.0.174

Development board IP: 172.16.0.169

Install debugging software in Ubuntu virtual machine.

sudo apt-get install gdb-multiarch

Modify the source code file.

/OK3568-linux-source/buildroot/output/OK3568/host/mkspecs/devices/linux-buildroot-g++/qmake.conf

Just comment out the variables as follows:

#QMAKE_CFLAGS_OPTIMIZE =

#QMAKE_CFLAGS_OPTIMIZE_DEBUG =

#QMAKE_CFLAGS_OPTIMIZE_FULL =

#QMAKE_CFLAGS_OPTIMIZE_SIZE =

#QMAKE_CFLAGS_DEBUG =

#QMAKE_CXXFLAGS_DEBUG =

#QMAKE_CFLAGS_RELEASE =

#QMAKE_CXXFLAGS_RELEASE =

Set development board ssh password.

Passwd: root

Enter the password “root” twice.

Add qmake.

Tools->options->Kits->Compilers->Add(The red path is configured according to the customer path

/home/forlinx/linux-3568/OK3568-linux-source/buildroot/output/OK3568/host/bin/qmake

Image

Add gcc.

Tools->options->Kits->Compilers->Add(The red path is configured according to the customer path

/home/forlinx/linux-3568/OK3568-linux-source/buildroot/output/OK3568/host/bin/aarch64-linux-gcc

Image

Add g++.

Tools->options->Kits->Compilers->Add(The red path is configured according to the customer path

/home/forlinx/linux-3568/OK3568-linux-source/buildroot/output/OK3568/host/bin/aarch64-linux-g++

Image

Add the gdb tool.

Tools->options->Kits->Debuggers->Add

Name: 3568

Path:/usr/bin/gdb-multiarch

Image

Configure devices.

Image

Configure complete test.

Note: To configure the development board and the computer virtual machine to be on the same network segment.

Image

Host name: Development board IP address

SSH port:22

Username:root

Password:root

Then click “Test” to test the ssh communication.

The diagram indicates a successful connection.

Image

Configure the Kit Suite.

Image

Select the previously configured Kit Suite 3568 for the project code.

Image

Specify the installation directory for the program on the development board: target.path = /home/forlinx

Image

After configuration, the executable files can run on the development board.

Click the Run button:

Image

The development board displays the following:

Image

To enable remote debugging of the development board application, proceed with the following settings:

Remote Debugging the Application.

Close the application that was just launched on the development board.

Image

Enter the following command on the development board to enter listening mode:

[root@ok3568:/home/forlinx]# gdbserver 172.16.0.169:2345 ./fltest_qt_backlight

Image

On the virtual machine:

Debug->Start Debugging->Attach to Running Debug Server…

Image

Image

Connect to the development board service to enter debug mode.

Breakpoint Debugging Example:

Set a breakpoint in the application, then click the Step Over button repeatedly.

Image

The development board will output breakpoint debugging information.

Image