Tuesday 19 September 2017

QNX-QT-Apps

Project is hosted on my github

https://github.com/varghes/QNX-QT-Apps

Collection of QT applications compiled for QNX

1. Text Editor
   tea
2. File Manager/ Explorer
   qtFileManager
3. Calculators
   calc ,scicalc
4. Games
   chess-qt ,Freecell ,soft336PacmanGame ,BlackJack ,QtLianliankan
   QtMineSweep, multiSnake, QtTetris, snake, solitaire

"exe" folder contains the executable file (Compiled against QNX 6.5 ARMV7)
"image" folder  contains the app final image

QT QNX Installation , refer my other repository
https://github.com/varghes/BeagleboneBlack-QNX-QT

Compilation : (on Windows )

1. open command line  "Cmd"
2. "cd" Change directory to the application directory (.pro )
3. qmake -spec unsupported/qws/qnx-armv7-g++
4. make



Debugging

1.Create Debug version of application
 .pro file  add this on Top

 CONFIG += qt warn_on debug
    debug {
        TARGET = myappdebug
    }
    release {
        TARGET = myapp
    }

2. qmake -spec unsupported/qws/qnx-armv7-g++ CONFIG+=debug
3. make CONFIG+=debug


QNX IDE Changes For Debugging

1.debug configuration-> Environment variable
add this environment variable
 TMPDIR=/ramdisk
 XDG_CONFIG_HOME=/ramdisk

2.compile using commandline , Debug using IDE


 .build File Changes

 1. Copy the executable file to
    prebuilt\armle-v7\sbin
 2. make the script file changes

[+raw perms=+x]calc
[+raw perms=+x]chess-qt
[+raw perms=+x]Freecell
[+raw perms=+x]soft336PacmanGame
[+raw perms=+x]BlackJack
[+raw perms=+x]qtFileManager
[+raw perms=+x]QtLianliankan
[+raw perms=+x]QtMineSweep
[+raw perms=+x]multiSnake
[+raw perms=+x]QtTetris
[+raw perms=+x]scicalc
[+raw perms=+x]snake
[+raw perms=+x]solitaire
[+raw perms=+x]tea

/usr/bin/calc=calc
/usr/bin/chess-qt=chess-qt
/usr/bin/Freecell=Freecell
/usr/bin/soft336PacmanGame=soft336PacmanGame
/usr/bin/BlackJack=BlackJack
/usr/bin/qtFileManager=qtFileManager
/usr/bin/QtLianliankan=QtLianliankan
/usr/bin/QtMineSweep=QtMineSweep
/usr/bin/multiSnake=multiSnake
/usr/bin/QtTetris=QtTetris
/usr/bin/scicalc=scicalc
/usr/bin/snake=snake
/usr/bin/solitaire=solitaire
/usr/bin/tea=tea


License :

Please refer the individual project License Terms



BlackJack

calc 

Chess

Freecell

multisnake

File Manager

Chinese App

Mine sweep

tetris

Scientific Calculator

Snake

Pac Man

Solitare

tea Editor 




Friday 1 September 2017

beaglebone black - QNX QT


           
                  Unlike Raspberry ,beaglebone (AM335X) has a very good documentation , also it has got a very good SDK support which makes porting to any OS is like a cake walk. 
QNX support is already there for this board. only problem is display wont work . It has got some hdmi code , probably thats for some old beaglebone version.  

If you use LCD Cape , please use the original code from QNX site . My focus is only on HDMI & QT .I dont have LCD Cape.


If you want to learn QNX  / If you want work on QNX for the first time, buy this board & use this  BSP ,it has got all the drivers plus graphics /QT support. beaglebone board price is 55$ something last time when I checked. I hate buying bsp from third party vendors, we are paying for QNX , so bsp should be  free , or use the board/processor which has the free bsp support. 


 http://community.qnx.com/sf/wiki/do/viewPage/projects.bsp/wiki/TiAm335Beaglebone

(login required) 

Source Code 

                 
         Source code is maintained here 

            https://github.com/varghes/BeagleboneBlack-QNX-QT

Setup :





Test the board and SD Card First:

        Write any working Linux image to the sd card &  hold the boot button(boot from SD card) , power on , make sure you can see the serial debug messages . 

QT Installation :


              Installation files are here . 


               https://drive.google.com/open?id=0B02sL8YIqsjCNS1ZWFNkQzRRY0E


this was there in the QNX site.. but now the link is removed  (qt_qnx_2011-02-24b.zip) , they might have thought QT support is beyond their scope. So I have uploaded here in my google drive.  qt got lgpl license. which is fine for distribution.


1. unzip it ... Installation folder contains files for different OS , mine is windows. If you are using linux /other OS use the correct folder.





2. qt_qnx_host_win32_x86 goes to  C:\QNX650\host (mine installed here) , just copy the files only 

    dont copy the  folder /replace the folder 

 qt_qnx_targets\target\qnx6\armle-v7  (both bin & lib also copy the qt4/pkgconfig folder )goes to  

C:\QNX650\target\qnx6\armle-v7

qt_qnx_targets\target\qnx6\usr goes to C:\QNX650\target\qnx6\usr



 Build QT Project :


1.Open The QNX IDE -> File ->New -> QNX C++ Project -> 

     build variants -> armV7 

2.Test application code 


#include <qt4/QtGui/QApplication>

#include <qt4/QtGui/QPushButton>
#include <stdio.h>
#include <cstdlib>
#include <iostream>

int main(int argc, char *argv[]){

printf("Application Running... ");
QApplication app(argc,argv);
QPushButton Button1("Hello World");
Button1.resize(180,90);
Button1.show();
return app.exec();

}





3. Right click on the project -> properties  , check build variants



4. Select Compiler Tab ->  Extra Include path 


Add from -> "Disk"  -  then "apply "


[QNX Directory ] /target/qnx6/armle-v7/usr/lib/qt4/imports

[QNX Directory ]/target/qnx6/armle-v7/usr/lib/qt4/plugins
[QNX Directory ]/target/qnx6/usr/include/qt4





5. Linker Tab 

category  "Extra library  "  click "Add"     and type
            QtGui
            QtCore
click "apply "  , click "ok"   , Now "build project" can compile the QT source code.




qnx executable image can be found here  , in the project folder . arm\o-le-v7






.build scripts changes 

 BSP files are here  ... as usual 

a. unzip it  b.create an empty project c. File -> import ->General ->Existing Projects in to Workspace -> File system (select the unzipped folder ) -> build 


#QT requires a RAM File sytem

#QT directory 
     devb-ram ram capacity = 8192 &
     waitfor /dev/hd1  
     dinit -q -h /dev/hd1t77
     mount  /dev/hd1t77  /ramdisk

#environment variables 

       QWS_KEYBOARD=qnx
#QWS_MOUSE_PROTO=qnx
#QWS_MOUSE_PROTO= qnx:/dev/devi/ touch0
QWS_MOUSE_PROTO=qnx

TMPDIR=/ramdisk
XDG_CONFIG_HOME=/ramdisk
QWS_DISPLAY=qnx

#dont start photon 

     display_msg Starting graphics driver
     io-display  -dvid=0,did=0
     waitfor /dev/io-display 2

#usb mouse Keypad 

io-hid -d usb -v &
mount -Tio-hid devh-usb.so
devi-hid -Pr -vvv mouse kbd  &

# finally run the application with this 

qt_v7_demo -qws &

###########################################################################

## QT Library
###########################################################################
libQtGui.so.4
libQtCore.so.4
libQtNetwork.so.4
libcpp.so.4
libz.so.2
libstdc++.so.6

libhiddi.so.1

devh-usb.so

##########qtdemo dependency############

libQtHelp.so.4
libQtDeclarative.so.4
libQtXml.so.4
libQtSql.so.4
libQtXmlPatterns.so.4
libQtSvg.so.4
libQtScript.so.4
libQtCLucene.so.4

##designer

libQtDesignerComponents.so.4
libQtDesigner.so.4

##browser 

libQtWebKit.so.4

#some qt example applications 

[+raw perms=+x] qt_v7_demo
[+raw perms=+x] browser
[+raw perms=+x] qtdemo
[+raw perms=+x] designer





libQtGui.so.4 , libQtCore.so.4 both are the main libraries  , I have included other libraries to test the qtdemo ,designer , browser  applications

Script changes, Project settings are already done in the BSP  & Example QT project  , So you dont have to make any changes.




if build is successful , you should be able to see the final image 





First QT application should be followed with the command "-qws"

example 
qt_v7_demo -qws &

This window will become desktop window .



Flashing SD Card 


"ifs-ti-beaglebone.bin  " before adding the QT files the the image size was around 15 MB only ..

After QT library additions it becomes 75MB .. if you use the 2 core QT Libraries , you can reduce the image size.

boot files are here 


https://drive.google.com/open?id=0B02sL8YIqsjCWlpRWVVTVWpkZ00





TI_SDCard_boot_utility_v1_0.exe   you can use this tool to copy MLO file  .. under windows 10 ,"run as administrator" mode  .. if you have any issues, use Windows XP ,VMware virtual machine .


If it works , you should be able to see the serial debug message . uEnv.txt usually  directs the control to SD Card automatically .  if doesn't work , while powering ON , hold the boot button( next to usb B connector )


Some of My setup photos  & QT Screen



Form Window

QML Example

QtDemo




 My Setup





So you want to buy me a beer ?  :)