Qt Application Development¶
Note
This section assumes that the development environment is set up and functioning:
Either the Reach Technology G3 Developer VM or the Reach Technology G3 Developer SDK has been installed and tested.
Qt Creator is properly configured to develop and test applications. If not, see here for configuration instructions for Qt Creator on a Linux host, or see here for configuration instructions for Qt Creator in the Reach Technology G3 Developer VM.
The serial and network connections from host to target are functioning properly.
Fire up Qt Creator and lets get started.
First up is downloading code to the target.
As noted in the Quick Start Guide, there are a few sample applications already in the VM. The bulk of them are available in our GitHub repo for download.
1# to clone our sample applications repo in your VM
2joe@reach-qt5-nxp-dev-vm:~$ git clone https://github.com/jmore-reachtech/reach-g3-qt5-sample-apps.git
Open “mainApp” from the sample projects provided. Start with “File” ->
“Open File or Project”, then find the sample projects. On the VM the
files are stored in /data/app
.
Todo
(Mark) some things to add…
quick discussion of how a project is laid out
what’s in the various sub-directories?
what’s in the project file?
probably should add some links (use the local subs.inc)
This app displays some system resources. The screen should look something like this.
Select the mainApp deploy/run box as shown below. Ensure that the configured Yocto SDK kit1 and “Release” are selected.
To run the application on the target, click the green “play” arrow2 just below it.
Tip
Ensure no other applications are running. This can be done by running
the command ps ax | grep tslib
from a shell on the target and checking
the output. Then run kill -9 <nnn>
where <nnn> is the process id of
the running application.
Note
If you see the warning “The build directory needs to be at the same level as the source directory” go to Projects -> “Build and Run” -> “Yocto Warrior SDK” -> “Build” (all on the left pane) and look at the “Build directory” (under General). Qt Creator wants “Source” and “Build” directories in the same parent directory.
After clicking the play arrow, Qt Creator will compile and download the code to the target device.
You should see the “mainApp” running on the target. On Qt Creator click on “Edit” on the left side panel. WHY???
Assuming all went as planned - Congrats! you are up and running!!
Footnotes:
- 1
In this example, the Yocto SDK configured in Qt Creator is called “Yocto Warrior SDK”. Yours will probably be different.
- 2
The play arrow with a bug will run the debugger.