For the people who do not like Java, now we can use Qt creator to make and debug our application remotely instead of Eclipse.
First, better to use 20190127.bin or later version as your firmware, after the tutorial, once you connect VoCore2 to internet, it is easy for you to download applications from openwrt.
We need to install some packages on VoCore2:
opkg install openssh-sftp-server
opkg install libstdcpp
opkg install gdbserver
Now VoCore has setup.
Let’s setup Qt and openwrt on your PC.
- We need to patch gdb, I have submitted the patch to github.com/vonger/vocore2, just do all the compile as Beginner Tutorial, it will be ready.
- Install gdb. Ye, it is right, if we do not install gdb there will missing some package.
- goto path/to/openwrt/build_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/gdb-8.0.1
- call “make install”
- Make and install Qt.
- in make menuconfig -> Library -> Qt5, you can select qt5-core, and ‘M’ is OK, it is pretty big, so do not select as ‘*’
- make everything, takes pretty long time.
- goto path/to/build_dir/target-mipsel_24kc_musl/qt-everywhere-opensource-src-5.9.7
- call “make install”
Final step, setup Qt creator on your PC(path is just example, use your path of openwrt).
-
- Qt Creator -> Preferences -> Devices -> Devices -> Add -> Generic Linux Device
- Name: VoCore2
- Authentcation Type: Password
- Host name: 192.168.61.1
- SSH port: 22
- Username: root
- Password: vocore
- Qt Creator -> Preferences -> Kits -> Compilers -> Add -> GCC -> for both C/C++
- Name: VoCore2 GCC and VoCore2 G++
- Compiler path (GCC): openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-gcc
- Compiler path (G++): openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-g++
- Qt Creator -> Preferences -> Kits -> Compilers -> Debuggers -> Add
- Name: VoCore2 GDB
- Path: path/to/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/mipsel-openwrt-linux-musl-gdb
- Qt Creator -> Preferences -> Kits -> Qt Versions -> Add.
- Version Name: Qt 5.9.7 for VoCore2 mips
- qmake location: path/to/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.4.0_musl/bin/qmake
- Qt Creator -> Preferences -> Kits -> Kits -> Add.
- Name: VoCore2 Qt 5.9.7 (gcc OpenWrt mips)
- Device Type: Generic Linux Device
- Device: Generic Linux Device (default for Generic Linux)
- Compiler: C, VoCore2 GCC; C++, VoCore2 G++
- Debugger: VoCore2 GDB
- Qt version: Qt 5.9.7 for VoCore2 mips
- Qt Creator -> Preferences -> Devices -> Devices -> Add -> Generic Linux Device
Then create a project, in .pro file, add this lines:
target.path = /tmp INSTALLS += target
Then you can debug it as your other Qt application.
note: for macos, you need to install texinfo, or gdb will fail to install.