ÍNDICE DE CONTEÚDO
- Beaglebone Black + Qt5 + Yocto – Parte 1
- Beaglebone Black + Qt5 + Yocto – Parte 2
Na primeira parte da série vimos como configurar o ambiente e gerar uma distribuição Linux Embarcado com Qt5 para Beaglebone Black usando aceleração gráfica por hardware com o Yocto Project.
Agora vamos aprender como gerar e configurar as ferramentas necessárias para o desenvolvimento de aplicações Qt que serão executadas no nosso target, a Beaglebone Black. Basicamente precisaremos de uma toolchain contendo os utilitários e bibliotecas para podermos “cross-compilar” as aplicações desenvolvidas através da IDE Qt Creator.
Gerando a Toolchain
É importante que você tenha realizado todos passos descritos no primeiro artigo da série.
Para gerarmos a toolchain devemos carregar as variáveis de ambiente do Yocto e instruí-lo a construir a toolchain para o Qt5.
1 2 3 |
cd ~/yocto . poky-daisy/oe-init-build-env build-daisy bitbake meta-toolchain-qt5 |
O instalador da toolchain gerado está disponível em:
~/yocto/build-daisy/tmp/deploy/sdk/
e serve tanto para construção de aplicações Qt5 quanto para aplicações Linux que não utilizam o Qt.
Instalando a Toolchain
Vamos executar o script com a opção de instalação no caminho padrão sugerido.
1 2 3 4 5 |
# Para Host Linux 64bits ~/yocto/build-daisy/tmp/deploy/sdk/poky-eglibc-x86_64-meta-toolchain-qt5-cortexa8t2hf-vfp-neon-toolchain-1.6.2.sh # Para Host Linux 32bits ~/yocto/build-daisy/tmp/deploy/sdk/poky-eglibc-i686-meta-toolchain-qt5-cortexa8t2hf-vfp-neon-toolchain-1.6.2.sh |
Após a instalação nossa toolchain estará disponível em: /opt/poky/1.6.2/
.
Instalando o Qt Creator
Vamos baixar a versão 3.2.2 e instala-lá utilizando as opções padrão sugeridas:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Para Host Linux 64bits: wget http://download.qt-project.org/official_releases/qtcreator/3.2/3.2.2/qt-creator-opensource-linux-x86_64-3.2.2.run -P ~/Downloads # Para Host Linux 32bits: wget http://download.qt-project.org/official_releases/qtcreator/3.2/3.2.2/qt-creator-opensource-linux-x86-3.2.2.run -P ~/Downloads # Executando o Instalador # Host 64bits chmod +x ~/Downloads/qt-creator-opensource-linux-x86_64-3.2.2.run ~/Downloads/qt-creator-opensource-linux-x86_64-3.2.2.run # Host 32bits chmod +x ~/Downloads/qt-creator-opensource-linux-x86-3.2.2.run ~/Downloads/qt-creator-opensource-linux-x86-3.2.2.run |
Configurando o Qt Creator
Vamos realizar as configurações necessárias para que o Qt Creator utilize a toolchain que geramos. Feche o programa caso ele esteja aberto.
A primeira coisa a ser feita é adicionar as variáveis de ambiente da toolchain no script de inicialização do Qt Creator. Para isso adicione o conteúdo abaixo na primeira linha do arquivo ~/qtcreator-3.2.2/bin/qtcreator.sh.
1 |
source /opt/poky/1.6.2/environment-setup-cortexa8t2hf-vfp-neon-poky-linux-gnueabi |
O resultado final do arquivo ~/qtcreator-3.2.2/bin/qtcreator.sh.
deve ser:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
source /opt/poky/1.6.2/environment-setup-cortexa8t2hf-vfp-neon-poky-linux-gnueabi #! /bin/sh makeAbsolute() { case $1 in /*) # already absolute, return it echo "$1" ;; *) # relative, prepend $2 made absolute echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,' ;; esac } me=`which "$0"` # Search $PATH if necessary if test -L "$me"; then # Try readlink(1) readlink=`type readlink 2>/dev/null` || readlink= if test -n "$readlink"; then # We have readlink(1), so we can use it. Assuming GNU readlink (for -f). me=`readlink -nf "$me"` else # No readlink(1), so let's try ls -l me=`ls -l "$me" | sed 's/^.*-> //'` base=`dirname "$me"` me=`makeAbsolute "$me" "$base"` fi fi bindir=`dirname "$me"` libdir=`cd "$bindir/../lib" ; pwd` LD_LIBRARY_PATH=$libdir:$libdir/qtcreator${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH |
Agora vamos executar o Qt Creator. É importante dizer que SEMPRE que formos abrir o programa utilizaremos o comando abaixo, caso contrário o Qt Creator não funcionará corretamente com a toolchain gerada:
1 |
~/qtcreator-3.2.2/bin/qtcreator.sh |
A figura abaixo mostra a tela inicial do aplicativo:
Agora vamos criar um Kit contendo as informações do nosso target (Beaglebone Black) e da nossa toolchain. Siga os passos descritos abaixo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
1) Menu "Tools"-> Submenu "Options" 2) Opção "Build & Run" -> Aba "Compilers" ->Botão "Add" -> Opção "GCC" Name: Poky G++ -> Apply Compiler path: /opt/poky/1.6.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ Botão "Apply" 3) Opção "Build & Run" -> Aba "Debuggers" -> Botão "Add" Name: Poky GDB Path: /opt/poky/1.6.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb Botão "Apply" 4) Opção "Build & Run" -> Aba "Qt Versions" -> Botão "Add" Filename: /opt/poky/1.6.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake Version Name: Qt 5.3.2 (qt5) Botão "Apply" 5) Opção "Build & Run" -> Aba "Kits" -> Botão "Add" Name: BBB Device Type: Generic Linux Device Sysroot: /opt/poky/1.6.2/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi/ Compiler: Poky G++ Debugger: Poky GDB Qt Version: Qt 5.3.2 (qt5) Botão "Make Default" Botão "OK" |
Ao final desses procedimentos devemos ter a tela de configuração das opções “Build & Run” semelhante a essa:
Compilando uma aplicação
Como não poderia deixar de ser, vamos criar uma aplicação “Hello World”. Execute os seguintes comandos no shell:
1 2 3 4 |
mkdir ~/qt5-helloworld echo -e 'TEMPLATE = app\nTARGET = hello\nDEPENDPATH += .\nINCLUDEPATH += .\n\nQT += widgets\n\nSOURCES += hello.cpp' > ~/qt5-helloworld/helloworld.pro echo -e '#include <QApplication>\n#include <QLabel>\n\nint main(int argc, char *argv[])\n{\n QApplication app(argc, argv);\n QLabel *label = new QLabel("Hello Qt!");\n label->show();\n return app.exec();\n} ' > ~/qt5-helloworld/hello.cpp |
Teremos um arquivo de projeto ~/qt5-helloworld/helloworld.pro
:
1 2 3 4 5 6 7 |
TEMPLATE = app TARGET = hello DEPENDPATH += . INCLUDEPATH += . QT += widgets SOURCES += hello.cpp |
E um código fonte da aplicação ~/qt5-helloworld/hello.cpp
:
1 2 3 4 5 6 7 8 9 10 |
#include <QApplication> #include <QLabel> int main(int argc, char *argv[]) { QApplication app(argc, argv); QLabel *label = new QLabel("Hello Qt!"); label->show(); return app.exec(); } |
Vamos importar nosso projeto para dentro do Qt Creator. Para isso, vá em “File” -> “Open File or Project”, e selecione o arquivo ~/qt5-helloworld/helloworld.pro
.
Na próxima tela aparecerá qual Kit deverá ser utilizado, se você marcou o Kit BBB como default (“Make Default”) na seção anterior ele já estará selecionado. Para finalizar clique em “Configure Project”.
Agora vamos construir a aplicação em “Build” -> “Build Project helloworld”
Testando a aplicação
Copie o binário gerado pelo Qt Creator em ~/qt5-helloworld/build-qt5-helloworld-BBB-Debug/hello
para a raíz de um pendrive.
Insira o pendrive na BBB, plugue um cabo conversor USB Serial e abra uma conexão serial.
NOTA:
Se você tiver instalado algum outro sistema operacional no eMMC da BBB energize a placa pressionando a switch que fica próxima ao slot do microSD. Isso fará com que o processador busque o MLO e u-boot que estão contidos no microSD ao invés do eMMC.
Insira o microSD card gerado na primeira parte dessa série, conecte a BBB a uma TV através de uma cabo HDMI, conecte o pendrive com o binário gerado e energize a placa, logue como root e execute os seguintes comandos:
1 2 3 |
echo 0 > /sys/class/graphics/fbcon/cursor_blink #Para desabilitar o cursor piscante mount /dev/sda1 /media /media/hello -platform eglfs |
Note que rodamos a aplicação com os parâmetros “-platform eglfs”, isso indica ao Qt que ele deve rodar utilizando o plugin de plataforma EGLFS.
A TV ficará com a seguinte imagem:
Notem que está escrito no canto esquerdo da tela a frase: “Hello Qt!“
Conclusão
Com as partes 1 e 2 desse tutorial é possível gerar uma distribuição Linux embarcado customizado usando o com aceleração gráfica por hardware para a Beaglebone Black e desenvolver aplicações sem muitas complicações.
Se você é novato no mundo de programação Qt, sugiro que dê uma lida no material Qt for beginners.
Saiba mais
Cozinhando com o Yocto Project
Desvendando Yocto Project – Primeiros passos
Boa tarde. Alguém poderia me ajudar?????
Consegui evoluir na criação do Tollchain, mas quando o computador está fazendo o parse ele desliga. Suspeito que ele não tem capacidade de processamento e deve desligar por excesso de temperatura no processador. É um notebook antigo que comprei só para usar o Linux, CPU DualCoreT4400 de 2.2Ghz e 4GBytes de memória, estou usando o UBUNTU 14.04.
Obrigado!
Diego, boa noite. ESTOU tentando entrar nesse mundo Linux mas tudo parece bem complicado!!!!Fiz os passos da parte 1 e parte 2, z porem, em ambos tive problemas ao utilizar o bitbake. Na parte 2, que será mais útil para mim – não sei por que cargas d’água – não consigo gerar o toolchain de forma nenhuma. Além de conferir linha por linha fiz tudo novamente desde a parte 1, exceto a imagem demo, passo a passo. Quando executo o comando $ .poky-daisy/oe-init-build-env build-daisy bitkake meta-toolchain-qt algumas coisas aparecem na tela informando sobre documentação do yocto, openembedded, etc, mas as… Leia mais »
Olá Diego, beleza? Cara, eu segui o seu tutorial e tudo funcionou muito bem. Agora eu preciso conectar o Yocto a internet. Eu estou tentando configurar o eth0 com dhcp, e tudo funciona bem na rede interna da universidade. Porém qualquer tentativar de ping externo (Ex: http://www.google.com.br) não funciona. Eu desconfiava que o problema poderia ser o servidor DNS , porém mesmo configurando o DNS corretamente com nameserver 8.8.8.8 no “resolv.conf ” não funciona. Você teria alguma idéia do que poderia ser? Outro problema que eu estou tendo é que o meu computador não reconhece a usb da beaglebone black… Leia mais »
Renan,
Tente ver como as rotas estão configuradas através do comando “route”.
Para que a BBB seja vista como interface de rede, porta serial e usb mass storage você precisa adicionar na imagem os pacotes “gadget-init gadget-init-storage gadget-init-network gadget-init-udhcpd”. Estes pacotes adicionam algumas configurações a serem passadas ao módulo g_multi do kernel.
Para isso você pode colocar o seguinte no arquivo local.conf:
IMAGE_INSTALL += “”gadget-init gadget-init-storage gadget-init-network gadget-init-udhcpd”
Fiquei foi curioso como tu sabe de tanta coisa Sueiro, haja raca !! To levando tanta peia desse linux…… imagine se nao tivesse esse forum aqui, ja tinha era desistido da vida.
Olá Gabriel,
Obrigado pelo apoio.
Muita coisa que aprendi foi com a ajuda da comunidade também.
Olá Diego, Eu tentei alterar o IMAGE_INSTALL no arquivo local.conf , porém quando tentei cozinhei a imagem a placa não inicia, qualquer um dos init trava a placa. Na hora do boot, os LEDs da beagle começam a piscar normalmente e para em um LED ligado, como se tivesse parado o processo de boot. Tem alguma sugestão do que possa ser? A configuração da rede aparentemente está ok. Eu consigo da ifup eth0 e a beaglebone consegue ip e tudo. Porém eu não consigo pingar o servidor DNS 8.8.8.8 nem qualquer ip externo. Eu falei com um funcionário da infraestrutura… Leia mais »
Renan,
Sobre o travamento no boot tente coletar os logs do terminal serial. Mande o log via http://pastebin.com/ .
Provavelmente o repositório de pacotes não esteja configurado na placa. Monte um setup de acordo com esse artigo que escrevi:
http://embarcados.com.br/repositorio-de-pacotes-com-yocto/
Hi Diego,
I followed your tutorial part 1 and part 2.
But when I try to run my application on beaglebone.
It says “QtQuick 2.4 is not installed”
Could you help me about that?
Thank you so much.
Grangsang S.
Hi Grangsang,
It seems that QtQuick is not installed on the image. You can add the following line to your local.conf file:
IMAGE_INSTALL +=”qtquick1″
And regenerate qt5-image-demo.
Hi Diego,
I followed your instruction to add IMAGE_INSTALL +=”qtquick1″
But I got another error. It says that “qtquick1” is unbuildable
I’m sorry, but I don’t have my build setup with me now.
Try to issue the following commands on terminal and see what happens:
bitbake qtquick1
bitbake qtquick
Send me (via pastebin) the complete error message.
Diego, thank you for replying my message.
I tried “bitbake qtquick1” and it seems that it need ‘ruby-native’ but I can’t find it’s location.
Here is the complete error message:
Add the following line on bblayers.conf:
${TOPDIR}/../poky-daisy/meta-openembedded/meta-ruby
It seems that there is no any “ruby-native” inside meta-ruby.
I still get an error after adding meta-ruby layer
Dear Diego,
After several tries and errors. I am finally able to run my qt app.
Now, I am facing a new problem. Could you tell me how to activate another UART in BBB?
My qt app accessing serial port and it crashes while booting because of using same tty (in this case ttyO0). I hope the rest UART (ttyO1-O5) can be activated so the app won’t crash anymore.
I need your help for this.
Thank you so much.
Hi Grangsang,
Glad that it worked, cloud you please share with us how did you get it?
To add another serial ports on the system you will need to modify your dts file.
Basically you will have to modify the file:
http://git.ti.com/ti-linux-kernel/ti-linux-kernel/blobs/ti-linux-3.14.y/arch/arm/boot/dts/am335x-bone-common.dtsi
And create the entries for the other UART interfaces (take uart0 as a reference).
On Yocto side you will have to create a bbappend for linux-ti-staging_3.14.bb recipe and add patch to modify the am335x-bone-common.dtsi file.
Here you have a workflow for create and integrate the patch:
http://www.yoctoproject.org/docs/1.8/dev-manual/dev-manual.html#using-a-quilt-workflow
Hi Diego, Well, after trying with meta-ruby my qt app still not working. So I back to the first problem that said “QtQuick 2.4 is not installed” then I try to use earlier version of QtQuick. I tried with QtQuick 2.0 I used to use, and everthing is solved. My qt app working as I want. I think that’s all I can share. Simple thing to say, I didn’t do anything with image. Just changing QtQuick 2.4 to QtQuick 2.0. And for adding UARTs to the system, I will try with your suggestion. Hope it will be success. Thank you… Leia mais »
And here is error message from “bitbake qtquick”
Hello Diego,
These instructions have been very useful. I have been able to build the BBB image and build and install the SDK. I have configured QT creator according to your instructions above but when compiling the sample project I get the following compile errors:
make: c: Command not found
make: [hello.o] Error 127 (ignored)
make: o: Command not found
make: [hello] Error 127 (ignored)
Hi,
Did you added the following line on the of “~/qtcreator-3.2.2/bin/qtcreator.sh” file?
source /opt/poky/1.6.2/environment-setup-cortexa8t2hf-vfp-neon-poky-linux-gnueabi
If so, please add the following line just after the above line:
source /opt/poky/1.6.2/sysroots/x86_64-pokysdk-linux/environment-setup.d/qt5.sh
Please, tell me if it worked.
Thanks for the quick reply!
I did add that first line to qtcreator.sh. I just added the second line as well. I did notice that even though I have validated the file paths several times to make sure I typed everything correctly – the terminal window displays “source not found” on those two lines in the sh file.
This is working for me.
Which host are you using?
Did you installed the sdk on the default path?
If you try to source both files on the terminal do you get any errors?
I am on Ubuntu 14.04 64 bit. I did install the SDK on the default path: /opt/poky/1.6.2. For some reason the sh file doesn’t like those paths. I was able to source them directly in terminal without issue but running qtcreator.sh after that still results in the same errors.
Is your /bin/sh linked to /bin/bash or /bin/dash?
Mine is linked to /bin/bash
Mine is also linked to /bin/bash. Still no luck on my end.
Diego,
Are you running 64 bit host?
Thanks
Yep. The same Ubuntu as you.
Did you put those lines before the #! /bin/sh ?
Which Qt Creator version are you using?
I’ve got the solution of the problem ” Source not found “. Look, I was trying to run sh ./qtcreator.sh, when I remove the SH and ran just ./qtcreator.sh it found the path!
Now I have the same problem of C:Command not found. when I try to build It appears and the QT doesnt make the binary file…
Does anyone know the solution ?
p, li { white-space: pre-wrap; }
10:46:53: Running steps for project helloworld…
10:46:53: Starting: “/opt/poky/1.6.3/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake” /home/gabriel/qt5-helloworld/helloworld.pro -r -spec linux-oe-g++
10:46:53: The process “/opt/poky/1.6.3/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake” exited normally.
10:46:53: Starting: “/usr/bin/make”
c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/poky/1.6.3/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++ -I../qt5-helloworld -I../qt5-helloworld -I/opt/poky/1.6.3/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -I/opt/poky/1.6.3/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets -I/opt/poky/1.6.3/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -I/opt/poky/1.6.3/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I. -o hello.o ../qt5-helloworld/hello.cpp
make: c: Command not found
Wl,-O1 -o hello hello.o -L/opt/poky/1.6.3/sysroots/cortexa8t2hf-vfp-neon-poky-linux-gnueabi/usr/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lpthread
make: [hello.o] Error 127 (ignored)
make: Wl,-O1: Command not found
make: [hello] Error 127 (ignored)
10:46:53: The process “/usr/bin/make” exited normally.
10:46:53: Elapsed time: 00:00.
I did solve it!
Just enter as root and executed, It worked well
Gabriel,
O ideal não seria executar como root.
Na primeira linha arquivo qtcreator.sh veja se o caminho de environment da toolchain do Yocto está correto.
Quando escrevi esse artigo o correto era:
source /opt/poky/1.6.2/environment-setup-cortexa8t2hf-vfp-neon-poky-linux-gnueabi
Vi que você está usando a versão 1.6.3 do Yocto então é possível que tanto o caminho quanto o nome do environment estejam diferentes.
Hi Diego, I follow you instructions, all goes well until I need to build the SDK. Here is my configuration : Build Configuration: BB_VERSION = “1.22.0” BUILD_SYS = “x86_64-linux” NATIVELSBSTRING = “Ubuntu-14.10” TARGET_SYS = “arm-poky-linux-gnueabi” MACHINE = “beaglebone” DISTRO = “poky” DISTRO_VERSION = “1.6.2” TUNE_FEATURES = “armv7a vfp thumb neon callconvention-hard cortexa8” TARGET_FPU = “vfp-neon” meta meta-yocto = “daisy:02e603e48c6e0b0492f596890adadf6590fa692c” meta-oe = “daisy:d3d14d3fcca7fcde362cf0b31411dc4eea6d20aa” meta-ti = “daisy:3a95559c124d3ce8c076b3fae5859435977d1ac2” meta-qt5 = “master:87235825459d376bf4537c9523eb2496e15893aa” meta-embarcados meta-bbb = “daisy:9bd79b23a50e407a990a6b00724470c4cbedb71b” I use this command to build the SDK : bitbake meta-toolchain-qt5 I’m getting the following error : ———————————————————— Collected errors: * check_data_file_clashes: Package libgles-omap3 wants to install file… Leia mais »
Martin,
Please, use meta-qt5 on “dizzy” branch.
Clean the mesa and rebuild libgles-omap3 recipes with the command:
“bitbake -c cleansstate mesa libgles-omap3; bitbake libgles-omap3”
If the issue persists send me the out put of these commands:
“bitbake -e qt5-image-demo | grep ^PREFERRED_PROVIDER_virtual/libgles2”
“bitbake -e qt5-image-demo | grep virtual/libgles2”
Hi Diego, Thank you for your response. I have to use the master branch as I need QT v5.4.1 and dizzy do not provide it. Does the procedure you give me in your response should do the trick anyway ? (bitbake -e qt5-image-demo | grep ^PREFERRED_PROVIDER_virtual/libgles2) = PREFERRED_PROVIDER_virtual/libgles2=”mesa” (bitbake -e qt5-image-demo | grep virtual/libgles2) = # $PREFERRED_PROVIDER_virtual/libgles2 PREFERRED_PROVIDER_virtual/libgles2=”mesa” Also, is executing “build metatoolchain-qt5” is suppose to take care of producing an sdk with the correct beaglebone libGLES lib ? Or the one supplied by Mesa ? The Mesa one a probably a stub lib ? By your procedure you are… Leia mais »
Martin,
If you want qt 5.4 please use meta-qt5 in “fido” branch.
If look ate the file “meta-embarcados/meta-bbb/conf/machine/beaglebone.conf” it is setting:
PREFERRED_VERSION_libgles-omap3 = “5.01.01.01”
PREFERRED_PROVIDER_virtual/egl = “libgles-omap3”
PREFERRED_PROVIDER_virtual/libgles1 = “libgles-omap3”
PREFERRED_PROVIDER_virtual/libgles2 = “libgles-omap3”
And it seems that this configuration is not used.
Please, send me your bblayers.conf file.
On your local.conf you can set the following variable:
BBMASK = “recipes-graphics/mesa”
Hi Diego, I switch to fido branch. I re-include the file (packagegroup-qt5-toolchain-target.bbappend). I took a look to the (meta-embarcados/meta-bbb/conf/machine/beaglebone.conf) file and I’m still having : ——————————————————————— PREFERRED_VERSION_libgles-omap3 = “5.01.01.01” PREFERRED_PROVIDER_virtual/egl = “libgles-omap3” PREFERRED_PROVIDER_virtual/libgles1 = “libgles-omap3” PREFERRED_PROVIDER_virtual/libgles2 = “libgles-omap3” ——————————————————————— Now here is the result of the file (/poky/beaglebone/conf/bblayers.conf) ——————————————————————— # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf # changes incompatibly LCONF_VERSION = “6” BBPATH = “${TOPDIR}” BBFILES ?= “” BBLAYERS ?= ” ${TOPDIR}/../meta ${TOPDIR}/../meta-yocto ${TOPDIR}/../meta-openembedded/meta-oe ${TOPDIR}/../meta-ti ${TOPDIR}/../meta-qt5 ${TOPDIR}/../meta-embarcados ${TOPDIR}/../meta-embarcados/meta-bbb ” BBLAYERS_NON_REMOVABLE ?= ” ${TOPDIR}/../meta ${TOPDIR}/../meta-yocto ” ——————————————————————— I try to rebuild the (qt5-image-demo) but I’m still having those errors event if… Leia mais »
Martin,
Note that on your bblayers.conf that meta-ti is above of meta-bbb. So the beaglebone.conf is picked from meta-ti.
Please, set your bblayers.conf as the following:
BBLAYERS ?= ”
${TOPDIR}/../poky-daisy/meta-embarcados
${TOPDIR}/../poky-daisy/meta-embarcados/meta-bbb
${TOPDIR}/../poky-daisy/meta-ti
${TOPDIR}/../poky-daisy/meta-qt5
${TOPDIR}/../poky-daisy/meta-openembedded/meta-oe
${TOPDIR}/../poky-daisy/meta
${TOPDIR}/../poky-daisy/meta-yocto
”
This way the beaglebone.conf used is from meta-bbb.
Grrr damn it, I was not aware that order was having importance. I did reorder it for fun last month… Since I’m struggling with those error. I thought that this variable was simply gathering all available layers and according the dependency and priority of each one poky was constructing the recipe in the correct order. This is not well explicated Yocto manual 🙁 I’ve relaunch “bitbake qt5-image-demo” and now it seems to be CORRECT 🙂 Hope now the meta-toolchain-qt5 will work and also produce me an SDK that will not produce executable that crash with segmentation fault. I will come… Leia mais »
Martin,
No problem.
The layer priority just works for recipes and not for configuration files.
Hi Diego,
I was wondering too if doing : bitbake qt5-imagedemo populate_sdk”
is supposed to produce the standard SDK plus the QT SDK stuff ? If the response is NO, how we can do this ? It may be more interesting then having to build two different thing.
Also, is building “meta-toolchain-qt5” is having the same sdk stuff than the while doing “bitbake populate_sdk” ?
Best regards,
Martin,
“bitbake qt5-image-demo -c populate_sdk” is going to produce a sdk with all dev packages from the image recipe. Imagine that you have a recipe image with a bunch of other packages.
“bitbake meta-toolchain-qt5” is going to produce only the dev packages for qt5.
Ok for your information reordering the BBLAYERS entries did the trick 🙂 I’m very happy now, all is well working (images, my own QT application, LCD) WOW, thank you so much for your help Diego. Do you know if there a way to remove the blinking cursor by including the command in the yocto image ? echo 0 > / sys/class/graphics/fbcon/cursor_blink Do I will need to append a bash command to the do_rootfs recipe ? Or maybe create a bootup script that is launch with the booting of the image ? And I notice that console is flashing in the… Leia mais »
Martin,
I’m not sure if you can set a kernel command line parameter to disable the cursor blink, if not an initscript is a better choice.
About the backlight I bet that this can be implemented at touchscreen device driver level. Or you can have a process that monitors the event key from touchscreen and if a touch event occurs it turns on the backlight.
Hi Diego, Thank for you input about the touchscreen. I’m on it. I’ve tried adding psplash to my images, I got an exemple from here (https://github.com/Guacamayo/meta-guacamayo/tree/master/meta-guacamayo/recipes-core/psplash). After that I build the image and now I’m getting the following error : *********************************************************************** Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for packagegroup-qt5-machine-related: * libdrm (>= 2.4.52) * libdrm (>= 2.4.52) * libdrm (>= 2.4.52) * libdrm (>= 2.4.52) * libdrm (>= 2.4.52) * * opkg_install_cmd: Cannot install package packagegroup-qt5-machine-related. ERROR: Function failed: do_rootfs ERROR: Logfile of failure stored in: /home/xxx/Sonar/poky/beaglebone/tmp/work/beaglebone-poky-linux-gnueabi/qt5-image-demo/1.0-r0/temp/log.do_rootfs.29597 ERROR: Task 7 (/home/xxx/Sonar/poky/beaglebone/../meta-embarcados/recipes-core/images/qt5-image-demo.bb, do_rootfs) failed with exit code ‘1’… Leia mais »
Martin,
This error appeared after you added psplash package?
Checkout on your work tree which version of libdrm is compiled.
There is a libdrm on meta and another one on meta-ti.
Martin,
I used to add custom psplash images like this:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-yocto/recipes-core/psplash/psplash_git.bbappend
To generate the .h file you can use:
https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-csource.html
Thank you, I will take a look to your way if the other one don’t work as I already configure it. But it a matter of nothing to replace it.
It appears that deleting /sstate-cache and /tmp fix it. That weird… Thank you anyway 🙂
Hi Diego 🙂
So I need to find where is the touchscreen driver in the ti-kernel ? Once I found the problem I create a patch to include to yocto.
I’m a bit lost, do you have an idea where start to find in the kernel ?
Else, I search a lot on internet about the Beaglebone and this problem but I did not found anything 🙁
Martin,
Here is the driver: drivers/input/touchscreen/ti_am335x_tsc.c
Olá Diego,
Eu terminei este tutorial com sucesso, mas eu queria comunicar a BBB com Qt Creator através de ssh. No shell eu tenho:
[email protected]:~$ ssh [email protected]
ssh: connect to host 192.168.1.36 port 22: Connection refused
Com Angstrom eu posso executar remotamente a aplicação, eu tenho no arquivo .pro:
TARGET = application
target.files = application
target.path = /home/root
INSTALLS += target
É possível executar e fazer “debugger” remotamente os projetos na BBB-Yocto a partir do PC?.
Muito Obrigado.
Victor,
Sim é possível.
Basta você instalar o ssh server na BBB.
A maneira mais simples de se adicionar pacotes em uma imagem é editar o arquivo “conf/local.conf” usando a variável IMAGE_INSTALL.
Para adicionar o ssh server faça:
IMAGE_INSTALL += “openssh”
Victor,
Além do servidor ssh você precisará instalar o gdb na imagem também.
Para isso edite a variável abaixo no arquivo “conf/local.conf”:
EXTRA_IMAGE_FEATURES = “debug-tweaks tools-debug”
O tools-debug irá adicionar o gdb server na imagem.
Victor,
Como o Qtcreator usa o sftp para enviar o aplicativo para debug, você terá que instalar um sftp server na placa também.
Para isso insira a variável abaixo no arquivo “conf/local.conf”:
IMAGE_INSTALL += “openssh-sftp-server”
Olá Diego,
Entâo, eu preciso incluir as 3 linhas e depois é necessário reconstruir a imagem novamente.
Eu tenho que incluem uma variável mais para quê supporte o tslib porque eu tenho uma “touchscreen” (LCD7-CAPE)?
Obrigado.
Victor,
Você tem que configurar o qt-base para usar a tslib. Para isso no teu arquivo “conf/local.conf” adicione a linha:
PACKAGECONFIG_append_pn-qtbase = ” tslib”
Olá Diego,
Eu incluí as linhas que você disse no arquivo “conf/local”:
MACHINE = “beaglebone”
DISTRO = “poky”
DL_DIR = “${TOPDIR}/../dl”
PACKAGE_CLASSES = “package_ipk”
DISTRO_FEATURES_remove = “x11 wayland”
IMAGE_INSTALL += “openssh”
IMAGE_INSTALL += “openssh-sftp-server”
EXTRA_IMAGE_FEATURES = “debug-tweaks tools-debug”
PACKAGECONFIG_append_pn-qtbase = ” tslib”
Mas ao tentar gerar a imagem eu tenho 3 erros.
Muito obrigado.
Victor,
Veja que na mensagem ele diz que você tentou executar o bitbake como root e isso não é permitido.
Portanto rode-o com seu usuário normal.
Galera, se fosse o caso de eu utilizar um touchscreen via a USB da beagle, como seria feito esse direcionamento? O USB nao reconheceria automaticamente como um touch ?
Grato desde ja!
Gabriel,
Você tem que verificar se o kernel está com o touchscreen usb habilitado:
http://cateee.net/lkddb/web-lkddb/TOUCHSCREEN_USB_COMPOSITE.html
Depois você tem que instalar o pacote abaixo no tua imagem:
kernel-module-usbtouchscreen
Olá Diego,
Portanto, é necesario adicionar a linha IMAGE_INSTALL += “openssh” e depois reconstruir a imagen.
Por outro lado, como se pode gerar uma imagem com suporte para tslib porque eu preciso para lidar com “touchscreen” (LCD7-CAPE)?
Obrigado.
Boa Diego,
Terminei o tutorial, parte 1 e parte 2, e além dos testes experimentais que você passou, consegui fazer um mini-teste de um programa. conforme imagens anexadas. Agora preciso fusar mais e aprender a trabalhar bem com as GPIO e os arquivos que a representam.
Valeu pelo tutorial, ajudou muito eu que estou começando ainda.
Viva, desde ja muito obrigado por esta serie de tutoriais! Estou tentanto compilar o qt5 com supporte para o tslib fazendo o PACKAGECONFIG_append = “tslib” mas sem sucesso, alguma dica de como o fazer?
Obrigado
como que carrega o módulo “spidev”?