Saturday, May 14, 2011

Programming application for mini2440 by Qt creator

   Applications for mini2440 can easily be programmed by using Qt creator installed on Ubuntu. The harsh problem you should overcome is reading some books about programming Qt to be able to make some more complicated applications.
   Right now, I will show you build a "hello world" program by Qt creator. Firstly, you should install Qt creator. Then, opening Qt creator to make a simple program "hello world". And lastly, copying it from host computer (Ubuntu) to mini2440.
.....................................................................................................................


Sorry readers, I will not continue this blog. All content is transfer to new blog.

Please visit here engineeryou.blogspot.com

Thank you














71 comments:

  1. Your work does not go unappreciated, you have helped me so much!

    ReplyDelete
  2. I am having a problem, when I try to execute my hello world program, it gives me "Segmentation fault". I have followed your guide exactly, and the fluidlauncher works fine. I think it is a problem when compiling, but I am not sure what. Do you have any ideas?

    ReplyDelete
  3. Hi Trevor. In fact, I am not professional in those kind of errors. However, after searching this issue, I find that you should cross-compile Qt4.6.2 again. Please look back my pages "Upgrade Qt4.6.2 in mini2440" and change "-qt-freetype" with "-no-freetype".
    (To find where "-qt-freetype" is, just come to "Upgrade Qt.." page and press Ctrl+F to find it, there's only one result)
    Please tell me the result you get. Good luck.

    ReplyDelete
  4. i want to make a camera application that have more features than the one that exits in mini2440. can i make it use this Qt creator??

    ReplyDelete
  5. Until now I haven't tried Qt with camera. I think you need "image processing" for camera application, then you could search on google with key "Qt and OpenCV". However, it seems a long way to intergate OpenCV library to Qt creator and write an image processing program for camera application.

    ReplyDelete
  6. Hi
    Thanx for all the information.It is really very helpful. I am using a mini2440 on winxp. I am trying to understand the "my led" program which came with the cd. But I am not able to understand all the instructions and the register configuration. Is there any site where I can get any info on this

    ReplyDelete
  7. Oh dear, i'm on vacation so i can't help you these days. Maybe, one or two weeks later I will review "led" program and answer you then. I'm sorry about the delay.
    Good luck.

    ReplyDelete
  8. Hi phucxu,

    Very very good article.. Helpful for me.

    Do you know how to make Qt creator program to load before Qtopia??
    Please explain just like this article.
    I am new here, and want to be smarter :D
    I will follow this blog from now on..

    thanks and regards,
    -paul-

    ReplyDelete
  9. Hi Paul, at the end of this article, i have added the instructions how to load our own program automatically instead of qtopia. Check it, if you have any problem with that, please tell me.

    ReplyDelete
  10. Thanks a lot Phucxu,
    I still on progress Upgrading QT4.6.2 on my mini2440 just like your instructions in another good article :). Hopefully i made it..

    Best regards,
    -Paul-
    saint.develop@yahoo.com

    ReplyDelete
  11. hello Great guy Phucxu,

    great blog!!

    I am facing an issue while trying to cross compile my application on QT creater , I have compiled and installed qt-4.7.3. After going through the steps you have mentioned i get an error " No Toolchain selected"

    Even when i tried to add one under build setting tab of projects button. Its not getting linked with mini2440 version also ABI always comes unkown in my case.

    ReplyDelete
  12. I must say Phucxu, your blog has helped me enormously.
    Thanks for sharing all this with the whole world.I got everything working and now concetrating on Coding :)

    Thanks!!!

    ReplyDelete
    Replies
    1. What is the toolchain what you selected?

      Delete
  13. Thx, this was very useful. u save a lot of time

    ReplyDelete
  14. God bless you mate!

    ReplyDelete
  15. Hi,
    Thanks for this tutorial. I need help with Touchscreen.
    I compiled Qt and tslib successfully.
    Typing "cat /dev/input/ts" works as mentioned (weird chars when touched).
    ts_calibrate and ts_test work fine too (touch screen is working fine).

    If I use "export QWS_MOUSE_PROTO=tslib:/dev/input/ts" it shows "Segmentation fault". When I replace this line by just "export QWS_MOUSE_PROTO=" (without "driver:options") my "Hello World" shows perfectly, but no touch screen.

    Compiling Qt with "-no-freetype" generates the same result: "Segmentation fault".

    I can't find a way to work touch with my app.

    Any suggestion?
    Thank you.
    Afonso.

    ReplyDelete
  16. Hi Phucxu....
    I followed your steps and everything fantastically looks ok. But when I start to make a simple project using qtcreator this error message appears several times, at least twice:
    Could not save session to file /home/didit/.config/Nokia/qtcreator/default.qws

    I have reinstalled the qtcreator via Ubuntu software center, but the error still exists.
    Please help me I just can't wait to see my EM2440-III shows me a beautiful thing.
    thanks..

    ReplyDelete
  17. Sorry I forgot to write my name. My name is Didit (Who sent the above message).

    ReplyDelete
  18. Problem above is solved with:

    $sudo chown -R user /home/user/.config/Nokia

    Regards
    Didit

    ReplyDelete
  19. But.... what is this error (appears after rebuilding the project using cross compiler) btw?

    :: error: skipping incompatible /home/tslib/lib//libts.so when searching for -lts

    Please give me another help.
    Didit

    ReplyDelete
  20. Hi everyone...
    My above problem was solved by using Qtcreator 1.3.1.

    Regards
    Didit

    ReplyDelete
  21. Thanks didit

    It helps me so much :D

    ReplyDelete
  22. Thanks all for your consideration on my blog. I'm sorry about long delayed time without replying you. From now, I will take care of your comments. Best regards :)

    ReplyDelete
  23. Hi phucxu.. glad you are back.
    My latest problem is Segmentation fault message when I'm running the fluidlauncher. Please help me out of that...My Tslib works fine (tested with ts_calibrate and ts_test).

    Regards
    Didit

    ReplyDelete
  24. Hello Didit. I regret to inform you that I couldn't help you more since it's out of my scope. Before I've also got some "Segmentation fault" when programming for this board, and I had to give up some.
    Ok, forget the Fluid, let's try your own program in this board to see if it's still "Segmentation fault" there.

    ReplyDelete
  25. Hi phucxu..
    I got the same segmentation fault with my own program. Then I used your precompiled tslib and qt and the Fluid works nicely eventhough looks a bit slow. When I ran my own program again segmentation fault came out. Which tslib and gcc versions did you use? Also when compiled my Qt4.6.2 the result as you said is to be located in /usr/local/Qt dir however in my compilation the result is located in /usr/local/qt-everywhere-opensource-src-4.6.2/, nothing was found in /usr/local/Qt/.
    Phucxu which QTcreator did you use? At the moment I use Qtcreator V1.3.1 based on Qt4.6.2. Can you run your own program on your board?
    Please give me ideas....
    Best regards
    Didit

    ReplyDelete
  26. Sorry it's me again. I recompiled qt4.6.2 again and I noticed this message:....../ld: skipping incompatible /home/tslib/lib//libts.so when searching for -lts.at least four times, I think that is part of my problems. what should I do then?

    Regards
    Didit

    ReplyDelete
  27. Hi
    can you help me?
    I would like to develop an application on mini2440 Display 7 ". I do not want to use the touch screen, but to select the function I would like to use an encoder and a button. Then move the focus from a button of my application to another by rotating the encoder and make the selection by pressing the button. Do you think it possible?
    I would also like to connect a target board to read 2 temperature sensors and drive relays to turn on lamps. QT is able to handle the usb in this way? can show me some documentation to take information on the management of USB with QT.
    thanks

    ReplyDelete
  28. @Panic2440, it is possible to use encoder rotating (from motor) for a kind of pin that is used for buttons. However, the rotating of encoder must be not too fast (sorry, i can't estimate how fast the mini2440 board could manage).
    To your project with 2 temp sensors and relays, you can connect sensor direct to GPIO pins on the board; and with relays, you should use the thing called OPTO, do not connect directly relays to your board, it may be damage the pin there.
    Sorry that, i didn't do with USB along with QT before, so i cant give you any direction. However, if you want to develop USB application, i think you should use microcontroller as a USB client whereas the mini2440 board will be a USB host.

    ReplyDelete
  29. @Didit, hello, let's try again and do not give up even it seems a hard job :)
    I cant help you in a specific error, it's because i'm not MASTER in linux as well as in ARM. This blog is just what i've done and i want to share to everyone loved in this board. I will help you in my best
    Ok. when i compile qt4.6.2, i use "gcc version 4.4.3", and the QtCreator i use to make "hello" program has a version 1.3.1(based on Qt 4.6.2). The example program in this blog (as a name "ex1" which is written in QtCreator1.3.1) run perfectly in mini2440 board.
    Let's try again and good luck :)

    ReplyDelete
  30. hi phucxu
    thanks a lot for the answer.
    Let me explain better, I want to make an application with different button. To manage the selection of the button I would not use the touch screen or mouse but I would like to shift the focus from one key to another by rotating an encoder (RS-components 729-5684). Once the focus moved on by pressing the desired button then start the relative function.
    I can not use the GPIOs directly because the 2440 sensors and lamaps are far from the mini2440 then I would use the USB or RS485.

    ReplyDelete
  31. @Panic2440, got it. However, RS232 (the board support RS232, not RS485) or USB wire is not really long (about 3-4m in practical, i guess). if 3-4m is long enough to your sensor and lamps, then you should use RS232 which is supported in the board and it's also easier to work with. And whether you choose USB or RS232, you have to make a client board (it means client USB or client RS232) - the mini2440 will become a host then

    ReplyDelete
  32. The client board is not a problem, I made several cards PIC microcontroller-based systems, SAMSUNG, ST6. My problem is the mini2440:) I know little, so I asked you that you seem very knowledgeable in mini2440 where I could find documentation to the development of the application on the 2440. I would like use linux OS and QT to build the application. Do you think it a good choice or believe that it would be better to use other tools. If i decide to use QT where I can find documentation on its use on mini2440.
    Thank you for the attention. Panic

    ReplyDelete
  33. Hi Phucxu..thanks for your response..
    I followed your last guidance using gcc4.4.3 there was no error in compiling tslib at all. But when I have a look at the ts_calibrate resulted from the compilation (using readelf command) it is shown that the tslib is not cross compiled to ARM but i80386. it happened too when I used gcc 4.3.2. While your ts_calibrate is correctly cross compiled to ARM processor. Also I have anothe question: Why do you put "-qt-mouse-tslib" twice in configuring QT4.6.2 ? btw I use UBUNTU 10.10.
    Please give some more helps...otherwise I'm going to start to cry........I have spent more than three weeks doing this.

    Best regards
    Didit

    ReplyDelete
  34. Hi Didit, be more patient, don't cry :) i did more than three weeks to do that :(
    it seems that you have problem with installing gcc, after install this tool, please type this command and cross-compile tslib again (and check whether it is built for arm or i80386)
    $export PATH=$PATH:/usr/local/arm/4.3.2/bin
    The path "/usr/local/arm/4.3.2/bin" is where you installed the tool

    I did use "-qt-mouse-tslib" twice time? sorry, maybe it's a mistake, it's because I also copy from some articles without reviewing it carefully.
    The version of Ubuntu is not important in this case, btw, i'm using Ubuntu 10.04
    Good luck :)

    ReplyDelete
  35. Hi Panic, it's nice when you know using some MCUs. Let's see your project, if you don't use touch screen of mini2440board, why don't you use 2-lines LCD screen? It will be much easier than using the board.
    Anyway, if you still want to use this board, why don't you use touch screen instead of scroller (using encoder), touch screen seems to be more professtional and high interactive with user than scoller.
    And if you want to develop the project with this board and scroller, you should read some "QT programming book" which will guide you making the program and communicate with RS232 port.

    ReplyDelete
  36. Hi phucxu...
    I did what you suggest. I was able to configure tslib. It was built already for ARM :) (however I used bash login all the way otherwise I could not get through it ). But when configuring the Qt4.6.2 (bash login too) there was "The tslib functionality test failed!"... Oh my Board.!!.
    It seems that you did not use bash login from start to finish did you? Is that possible?
    Thanks for your patience...

    Regards
    Didit

    ReplyDelete
  37. Thank you for this tutorial!! I'm working my master thesis on mini2440 in Qt, and this tutorial helped me to prepare ARM for my application. If I knew you, I would buy you chocolate :D
    Thanx!!

    ReplyDelete
  38. Hi!!!
    I followed your tutorial to compile my Qt application for mini 2440, but I find an error at the end of step two (Making a simple program).
    All is ok until I compile my application on host PC. I try to run it and my application exits with code 255. All is ok until now!

    Then, I copy my application (only the .exe file) on mini 2440 and I try to run it.

    The the following error occour:

    error while loading shared libraries: libts-1.0.so.0: cannot open shared object file: No such file or directory.

    So that I can't to run my application on mini 2440.

    Can you help me.
    Thanks in advance!

    Regard,
    Gio.

    ReplyDelete
  39. Hello. You should upgrade Qt library on mini2440 board first, reference here: http://mini2440vietnam.blogspot.com/2011/04/upgrade-qt462-in-mini2440.html

    ReplyDelete
  40. Hello phucxu,
    I'll do that.
    Thanks a lot.

    Gio

    ReplyDelete
  41. That is a great job. Thank you.
    Everything works well. I have only one small problem. My cursor moves in a smaller are then the whole screen. My screen is 7”. I didn’t manage to configure pointer neither.
    Programs work well and the cursor works well too, I mean it is sensible everywhere. If I touch the other end of the screen (I mean insensible part), the cursor will be sensible in its smaller area. So the problem is not that one part of screen is insensible.
    Any kind of advices would be a great help to me. I have been working on it for almost a week.
    As I see well others also had problem cursor, but these were a bit differ.
    Thank you

    ReplyDelete
  42. Hey friends,
    i want to develop a simple application for billing system on MicroARM 2440 so if anyone designed such system please guide me. I want basically how to write a coding part like signals and slots.
    U can also reply me-> ani.coder@gmail.com

    ReplyDelete
  43. Hi,

    I did everything as you written. That worked. I have only one problem. The GUI is a bit slow. A simple resize takes 1-3 second.
    I suppose the problem with Qt or tslib. May I right?
    On the board there is a qtopia with many games and so on... Those programs work well without any delay.
    Does anybody have the same problem?
    Please, let me know the solution,
    Thanks

    ReplyDelete
  44. Hello, sorry about that i don't know what the problem makes that slow performance. In my board, a simple resize of application window is run quickly. could you re-install whole system? clear all memory and make every again, hope it run quicker :)

    ReplyDelete
  45. Hi,

    My idea is that the problem is with the shared libraries. A static linking would be able to improve the speed. May it be the problem?
    I tested mini2440 with qtopia images from friendlyarm. It contains games and so on. Those programs worked well. But those didn’t used shared libraries.
    I haven’t seen any differences among those programs and mine.
    Do you think a static linking could solve my problem?
    I cleared the whole memory and after it I used images from friendlyarm to avoid any mistakes.

    ReplyDelete
  46. Hi,
    My Qt Application is very slow in several case.
    1) On start-up of my touchscreen device.
    2) While working with the application the events means button click events are very slow.
    an also booting -
    3) Boot time also almost 30 seconds to load.

    ReplyDelete
  47. Hello,

    I have a question about the precompiled libraries (tslib and QT), if I download them what should I do next ? install,compile..?

    Excuse me but I am a total newbie about this.

    Thank you, it would be very nice

    ReplyDelete
  48. Hello,
    I installed ptxdist development tool to work with my mini2440.
    Linux works well and I would like to install Qt
    I am a beginner and I'm looking for help to develop an example with Qt + ptxdist.
    My question is:
    Is that your tutorial is compatible with my system?
    Thank you for your help.
    John.

    ReplyDelete
  49. Hi, Nice post.

    I would like to know how can i make an application using a database for example SQlite?

    Thanks.

    ReplyDelete
  50. Hi, I'm kinda new to Linux & stuff, I just want to know how can i get the qtopia desktop to load again? Thank you!

    ReplyDelete
  51. Hi Phucxu, I have a question.
    I want to run the app compiled by qcreator like a GUI app so what I have to do? And I want my apps appear like a logo on home screen of Qtopia on Mini2440 what I have to do? Thank you so much!
    Hope your answer soon

    ReplyDelete
  52. Hi Everyone,

    I am new to the Qt Programming.
    Can anyone help me to Create Qt Application for Mini2440?

    Thank you
    Sunil

    ReplyDelete
  53. Dear phucxu,

    Thank you Very Much for your Information..
    This Blog Really Helped me a lot...
    Now i am able to cross-compile Qt and tslib.
    and create Qt Application using Qt creator and i am able to run Qt Application on mini2440(Loading automatically my own program before qtopia ).
    but i need one more help that how to Run Qt Application on mini2440 After qtopia .
    please help me...

    ReplyDelete
  54. Dear Sunil, sorry, i can not get your mean of "run QtCreator App. After qtopia"

    Dear Minh, sorry about late answer, I had one time to make icon on Qtopia to load my program. But now i forgot it, let's try yourself, you can do it :)

    ReplyDelete
  55. Dear phucxu,

    "run QtCreator App. After qtopia"
    it means
    when i Comment last three lines:
    #bin/qtopia&
    #echo" "> /dev/tty1
    #echo"Starting Qtopia, please waiting..." > /dev/tty1

    and run the program then program will run Successfully.
    but when i remove comment and run the Program in mini2440 terminal (after os is booted in mini2440 )
    i got following error
    ./ex2 -qws
    ./ex2: error while loading shared libraries: libts-1.0.so.0: cannot open shared object file: No such file or directory.
    i mean i want to create a Qt Application which can be run by Double Clicking an Icon in the mini2440.

    please help me

    Thank you
    Sunil

    ReplyDelete
  56. Dear Sunil, those errors happen because of not suitable configuration for QtCreator lib in mini2440 board.
    For un-comment those:
    #bin/qtopia&
    #echo" "> /dev/tty1
    #echo"Starting Qtopia, please waiting..." > /dev/tty1

    you should follow configure:
    export LD_LIBRARY_PATH=/usr/local/tslib/lib
    export QTDIR=/usr/local/Qt
    export QWS_MOUSE_PROTO=tslib:/dev/input/event0
    export TSLIB_CALIBFILE=/etc/pointercal
    export TSLIB_CONFFILE=/usr/local/etc/ts.conf
    export TSLIB_CONSOLEDEVICE=none
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
    export TSLIB_TSDEVICE=/usr/local/tslib/lib/ts
    export TSLIB_TSEVENTTYPE=INPUT
    export QWS_DISPLAY=LinuxFB:mmWidth=105:mmHeight=140

    as in this link
    http://mini2440vietnam.blogspot.com/2011/04/upgrade-qt462-in-mini2440.html

    ReplyDelete
    Replies
    1. Dear phucxu,

      Thanks for your support...
      Now i am able to run the Program in mini2440 terminal (after os is booted in mini2440 ).
      next thing what i want to do is ,
      i want to install the Qt Application on mini2440 so that icon must me created on Applications list in mini2440.

      please help me

      Thank you
      Sunil

      Delete
  57. Dear all!

    i have just bought tiny210, and compiling Qt,tslib following these instructions (http://mini2440vietnam.blogspot.com/2011/04/upgrade-qt462-in-mini2440.html)--> OK! not any errors!
    After that, i use Qt wrote a my app : hello word (following this instrution).
    run :
    cd /myapp
    ./hello -qws
    The program displays on tiny210. But the THE TOUCH NOT SENSE. I could'n touch any button in Hello program.
    I tried with files in DEMOS of Qt. But it's same!: THE TOUCH NOT SENSE
    Pls help me! Thanks a lot!

    ReplyDelete
  58. Dear Vu Thap, I did not experiment with your case yet. As i guess, tslib configuration (in step 4 of "upgrade Qt4.6.2..." article) has a problem, maybe Tiny210 board has another path for touch lib. Please try more and search more.

    ReplyDelete
    Replies
    1. Dear phucxu
      Firs! Thanks for your care!

      The touchscreen not respond, and one error be displayed on hyperterminal :

      Couldnt open tslib config file: No such file or directory
      QWSTslibMouseHandlerPrivate: ts_config() failed with error: 'Invalid argument'
      Please check your tslib installation!

      i am looking for the infomations for solve this problem. if it solved , i will post it in your you!! ('..')

      Delete
  59. Hey Phucxu,

    I am working on mini2440 on linux platform. I am able to use camera via terminal using mjpg streamer. Now i want to design a application/GUI for the camera so that it is directly launched from its icon and we do not have to use commands....Is there any way to do it?
    Also, i tried to make a desktop application usin Qt Creator. I made the .desktop file too. But when the icon is clicked, it shows a timer in the lower right corner of the screen but then nothing happens. Can you please help in that too..

    ReplyDelete
  60. Hi All,

    I followed as suggested in step 3 (commenting the last three lines)
    #bin/qtopia&
    #echo" "> /dev/tty1
    #echo"Starting Qtopia, please waiting..." > /dev/tty1

    Niw when i reboot, i get a blank screen with the friendlyarm logo but nothing else...

    I can proceed further. What's wrong ????

    Thanks.

    Giri

    ReplyDelete
  61. Couldnt open tslib config file: No such file or directory
    QWSTslibMouseHandlerPrivate: ts_config() failed with error: 'Invalid argument'
    Please check your tslib installation!


    ANd external mouse & touch screen is not working

    ReplyDelete
  62. Hi. I realize that this post is 3 years old but I hope you would answer !
    I have installed ubuntu 14.04 and when I have installed Qt creator using Software Center but it seems that Qt creator 5 does not have QT4 in "Options" window anymore. So what am I supposed to do so I can proceed according to your tutorial?

    ReplyDelete
  63. Hello,
    I have followed all the step provided by the site. I am Using EM2440 Boardcon board.I got stuck from one week, please suggest me what to do.

    Error:
    [root@Boardcon udisk]#.Proj_GUI -qws
    QWSTslibMouseHandlerPrivate: ts_open() failed with error: 'No such file or directory'
    Please check your tslib installation!

    RFK

    ReplyDelete
  64. transformed : driver not found
    anyone can help me

    ReplyDelete
  65. Hi,
    Thank you for very nice post.
    I followed it step-by-step, but got the error " No Toolchain selected" while cross-compiling on Qt creator.
    The user "legends never die" mentioned the same problem, and later said that he solved it. But he did not mention how he solved it.
    Any help ??

    ReplyDelete
  66. Hi
    I have tried to change the rcS file in mini2440 many times but not successful. It shows modified, but not saved.
    can any one help?

    ReplyDelete