ÍNDICE DE CONTEÚDO
- Raspberry Pi + Qt5 + Yocto – parte 1
- Raspberry Pi + 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 Raspberry pi 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 Raspberry Pi. 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 para Qt5
É 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-armv6-vfp-toolchain-1.6.2.sh # Para Host Linux 32bits ~/yocto/build-daisy/tmp/deploy/sdk/poky-eglibc-i686-meta-toolchain-qt5-armv6-vfp-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-armv6-vfp-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-armv6-vfp-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 (Raspberry pi) 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: Rpi Device Type: Generic Linux Device Sysroot: /opt/poky/1.6.2/sysroots/armv6-vfp-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 Rpi 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-Rpi-Debug/hello
para a raíz de um pendrive.
Insira o pendrive na Raspberry Pi, plugue um cabo conversor USB Serial e abra uma conexão serial.
Insira o microSD card gerado na primeira parte dessa série, conecte a Rpi 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 |
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 Qt5 com aceleração gráfica por hardware para a Raspberry pi 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 .
Hello,
Thank you for this tutorial,
Is there anyway to make ssh connection instead of serial connection , internet led is off, and i can not made ssh or ftp connection do you have any idea?
Ola Diego,
Voce pode me passar o conteúdo de environment-setup-armv6-vfp-poky-linux-gnueabi, pois fiz um cross compile do QT5(sem Yocto), mas o QTCreator não compila.
Tive um problema de falta de espaço na hora de gerar o toolchain(Yocto+QT), você sabe quando de espaço total precisa?
Vinicius,
Agora estou sem acesso ao meu HD externo com o ambiente de build.
O arquivo de environment faz um source de uma cadeia de arquivos configurando uma pancada de variáveis.
Acho que seria até difícil de se fazer uma “engenharia reversa” disso.
Não sei quanto de espaço precisa não, mas sei que é bastante coisa.
Desculpe não conseguir te ajudar nisso agora.
On the **Poky** branch when trying to build my toolchain [email protected] Vinícius Martins Meneses:~/yocto/build$ bitbake meta-toolchain-qt5 I am now getting a new Error. I will pursue this one in the morning, but looks like I may need to add the Wayland module to my image(?): ... | Project ERROR: No module claims plugin type 'waylandcompositors' | make[4]: *** [sub-brcm-egl-make_first] Error 3 | make[4]: Leaving directory /home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwayland/5.4.1-r0/build/src/plugins/hardwareintegration/compositor' | make[3]: *** [sub-compositor-make_first] Error 2 | make[3]: *** Waiting for unfinished jobs.... | make[4]: Entering directory /home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwayland/5.4.1-r0/build/src/plugins/platforms/qwayland-brcm-egl' | make[4]: Nothing to be done for first'. | make[4]: Leaving directory /home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwayland/5.4.1-r0/build/src/plugins/platforms/qwayland-brcm-egl' | make[3]: Leaving… Leia mais »
Did added the line below on your local.conf?
DISTRO_FEATURES_remove = “x11 wayland”
If so, there is no reason to get qtwayland compiled.
Sorry I have been working too many late hours, I had completely missed to do it this time.
What about the GPU_MEM, shall I set it 1024 for Raspberry Pi 2?
Since I forgot to set these params in my
local.conf
, I’d better start over from the scratch (?) … 🙁 Do I need to clear mytmp
or will Yocto take this new config into account and build again from scratch?Quando lanço bitbake meta-toolchain-qt5 tenho o erro seguinte ... Configuring libsegfault. Configuring libgcov-dev. Configuring glibc-gconv-iso8859-15. Configuring glibc-gconv-iso8859-1. Configuring packagegroup-core-standalone-sdk-target. Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for packagegroup-qt5-toolchain-target: * qtwebkit (= 5.3.2-r0) * qtwebkit-mkspecs * qtwebkit-qmlplugins * * opkg_install_cmd: Cannot install package packagegroup-qt5-toolchain-target. ERROR: Function failed: do_populate_sdk ERROR: Logfile of failure stored in: /home/otto/yocto/build-dizzy/tmp/work/cortexa7t2hf-vfp-vfpv4-neon-poky-linux-gnueabi/meta-toolchain-qt5/1.0-r0/temp/log.do_populate_sdk.27897 ERROR: Task 7 (/home/otto/yocto/build-dizzy/../poky-dizzy/meta-qt5/recipes-qt/meta/meta-toolchain-qt5.bb, do_populate_sdk) failed with exit code '1' NOTE: Tasks Summary: Attempted 3231 tasks of which 2654 didn't need to be rerun and 1 failed. No currently running tasks (3231 of 3232) Summary: 1 task failed: /home/otto/yocto/build-dizzy/../poky-dizzy/meta-qt5/recipes-qt/meta/meta-toolchain-qt5.bb, do_populate_sdk Summary: There were 2… Leia mais »
Joel,
We can “talk” in English here too. 😉
Could you please take a look at “/home/otto/yocto/build-dizzy/tmp/work/cortexa7t2hf-vfp-vfpv4-neon-poky-linux-gnueabi/meta-toolchain-qt5/1.0-r0/temp/log.do_populate_sdk.27897” file and see if it has a more detailed message about the error?
Please check if there are files on both “qtwebkit-mkspecs” and “qtwebkit-qmlplugins” packages.
On the next Tue and Wed we are going to publish a tutorial for Qt5.4 for Rpi2 using fido branch.
I will harass you with questions in English from now on 🙂 Looking forward to Qt5.4 for RPi2 tutorial!!! here is what I find in the log… unfortunately that doesn’t tell us more ... Configuring glibc-gconv. Configuring qemuwrapper-cross. Configuring glibc-gconv-ibm850. Configuring glibc-gconv-cp1252. Configuring libsegfault. Configuring libgcov-dev. Configuring glibc-gconv-iso8859-15. Configuring glibc-gconv-iso8859-1. Configuring packagegroup-core-standalone-sdk-target. Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for packagegroup-qt5-toolchain-target: * qtwebkit (= 5.3.2-r0) * qtwebkit-mkspecs * qtwebkit-qmlplugins * * opkg_install_cmd: Cannot install package packagegroup-qt5-toolchain-target. DEBUG: Python function do_populate_sdk finished ERROR: Function failed: do_populate_sdk here what I get when I launch a find on qtwebkit-mkspecs and qtwebkit-qmlplugins… Leia mais »
Joel,
This is the problem. The packages are empty. But I don’t the reason for this.
In my build environment they have some files.
Which branch are you using?
I am on dizzy
I did this
mkdir -p ~/yocto/dl
cd ~/yocto
git clone -b dizzy git://git.yoctoproject.org/poky poky-dizzy
cd poky-dizzy
git clone git://git.yoctoproject.org/meta-raspberrypi
git clone -b dizzy https://github.com/meta-qt5/meta-qt5.git
git clone -b dizzy git://git.openembedded.org/meta-openembedded
git clone -b dizzy https://bitbucket.org/embarcados/meta-embarcados.git
Ok
You can try to track the differences between fido and dizzy branches on meta-qt5 and see what’s going on.
Or switch to fido on all layers.
I am rather attempted to do that. Cheers!
Switched everything to Fido
Getting this error:
otto@Marcus Vinícius Martins Meneses:~/yocto/build$ bitbake qt5-image-demo
Parsing recipes: 100% |############################################################################################################################################################################################| Time: 00:02:03
Parsing of 1572 .bb files complete (0 cached, 1572 parsed). 2047 targets, 96 skipped, 0 masked, 0 errors.
ERROR: No recipes available for:
/home/otto/yocto/build/../poky/meta-embarcados/meta-rpi/recipes-qt/qt5/qtbase_5.3.%.bbappend
I guess this is what you’ll be addressing in your next tutorial, but I had to try
Change all layers to fido.
hm I think I did
otto@Marcus Vinícius Martins Meneses:~/yocto/poky$ git branch
dizzy
* fido
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta-embarcados$ git branch
dizzy
* fido
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta-openembedded$ git branch
dizzy
* fido
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta-qt5$ git branch
dizzy
* fido
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta-raspberrypi$ git branch
* fido
master
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta-selftest$ git branch
dizzy
* fido
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta-yocto$ git branch
dizzy
* fido
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta-yocto-bsp$ git branch
dizzy
* fido
otto@Marcus Vinícius Martins Meneses:~/yocto/poky/meta$ git branch
dizzy
* fido
Is your copy of meta-embarcados updated?
My bad, I didn’t git pull on one repo, getting an issue with gstreamer1.0 though, something about LICENSE_FLAGS_WHITELIST
ERROR: Nothing RPROVIDES 'gstreamer1.0-libav' (but /home/otto/yocto/build/../poky/meta-embarcados/recipes-core/images/qt5-image-demo.bb RDEPENDS on or otherwise requires it)
ERROR: gstreamer1.0-libav was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST
ERROR: gstreamer1.0-libav was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST
NOTE: Runtime target 'gstreamer1.0-libav' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['gstreamer1.0-libav']
ERROR: Required build target 'qt5-image-demo' has no buildable providers.
Missing or unbuildable dependency chain was: ['qt5-image-demo', 'gstreamer1.0-libav']
resolved my last issue by adding
LICENSE_FLAGS_WHITELIST = "commercial"
inbuild/conf/local.conf
Ran a compilation last night that stopped on /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos_types.h:38:33: fatal error: vcos_platform_types.h: No such file or directory | #include "vcos_platform_types.h" I have pursued a resolution for this error this morning, I figured that it could be a dependency issue, but I wasn’t able to figure it out yet. If any pointers, let me know. The close post I found on that issue is this one https://github.com/raspberrypi/firmware/issues/34 here the full trace compare -Wno-abi -c ../../../src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.cc -o obj/src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.ozone_platform_egltest.o | In file included from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos_assert.h:149:0, | from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos.h:114, | from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vmcs_host/vc_dispmanx.h:33, | from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/EGL/eglplatform.h:110, | from /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/EGL/egl.h:36, | from ../../../src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.cc:28: | /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos_types.h:38:33: fatal… Leia mais »
I have this problem for qtwebengine too. But didn’t have enough time to investigate it.
For now I’m not including qtwebengine on the qt5-image-demo.
Joel,
I fixed it. Please update your meta-embarcados repo copy.
But I’m not able to get it finished due to an out of RAM issue, and the linker is getting killed.
Some info about this:http://www.phoronix.com/scan.php?page=news_item&px=QtWebEngine-Mess-Debian
I’m running in a machine with 8GB of RAM, but it seems that it’s not enough. 🙁
Please, give me a feedback if you were able to deploy it.
it’s running for now, I will keep you posted
Currently 4 running tasks (3633 of 4520):
0: qttools-5.4.1-r0 do_package (pid 489)
1: qtquick1-5.4.1-r0 do_package_write_rpm (pid 1933)
2: qtwebengine-5.4.1-r0 do_compile (pid 3200)
3: glib-2.0-1_2.42.1-r0 do_package_qa (pid 3954)
I am glad you figured it out, I was climbing the wrong tree
I had another issue this time, something wrong with the name of this file!! but not sure where to correct it yet genmacro.genmacro.o: file not recognized: File format not recognized but memory wasn’t a problem so far. I am running on NUC [email protected] Vinícius Martins Meneses:~/yocto/build$ free -m total used free shared buffers cached Mem: 3896 2842 1054 0 124 2196 -/+ buffers/cache: 521 3375 Swap: 4027 561 3466 [email protected] Vinícius Martins Meneses:~/yocto/build$ cat /proc/meminfo MemTotal: 3989932 kB MemFree: 1080372 kB MemAvailable: 3382992 kB ... | FAILED: /home/otto/yocto/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/home/otto/yocto/build/tmp/sysroots/raspberrypi2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,now -Wl,-z,relro… Leia mais »
I have this problem too, and it seems to be raised when you try to recompile qtwebengine.
Issue these commands:
bitbake -cclean qtwebengine; bitbake qtwebengine
yeah I am back on that earlier issue with
vcos_platform_types.h: No such file or directory
when
bitbake -cclean qtwebengine; bitbake qtwebengine
Are you sure that you have updated your local copy of meta-embarcados?
See if you have de file “meta-embarcados/meta-rpi/recipes-qt/qt5/qtwebengine_%.bbappend” with the following content:
export QMAKE_CACHE_EVAL=”CONFIG+=${EXTRA_OECONF}”
EXTRA_OECONF_append = ” CXXFLAGS=’-I${STAGING_DIR_TARGET}/usr/include/interface/vcos/pthreads
-I${STAGING_DIR_TARGET}/usr/include/interface/vmcs_host/linux’
”
do_configure_prepend() {
export QMAKE_CACHE_EVAL=”CONFIG+=${EXTRA_OECONF}”
}
yeah that’s exactly what I’ve got and a git pull says it’s up-to-date. The error looks the same to me. Also posted the question on Stackoverflow http://stackoverflow.com/questions/30736039/building-qtwebengine-for-raspberry-pi2-using-yocto-poky-vcos-platform-types-h | FAILED: arm-poky-linux-gnueabi-g++ -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/home/otto/yocto/build/tmp/sysroots/raspberrypi2 -MMD -MF obj/src/3rdparty/chromium/ui/ozone/platform/egltest/ozone_platform_egltest.ozone_platform_egltest.o.d - ... [FILTERED] ... /home/otto/yocto/build/tmp/sysroots/raspberrypi2/usr/include/interface/vcos/vcos_types.h:38:33: fatal error: vcos_platform_types.h: No such file or directory | #include "vcos_platform_types.h" | ^ | compilation terminated. | ninja: build stopped: subcommand failed. | make[3]: *** [invoke_ninja] Error 1 | make[3]: Leaving directory `/home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwebengine/5.4.1-r0/qtwebengine-opensource-src-5.4.1/src/core' | make[2]: *** [sub-gyp_run-pro-make_first] Error 2 | make[2]: Leaving directory ...[FILTERED]... /home/otto/yocto/build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/qtwebengine/5.4.1-r0/temp/log.do_compile.12781) ERROR: Task 7 (/home/otto/yocto/build/../poky/meta-qt5/recipes-qt/qt5/qtwebengine_5.4.1.bb, do_compile) failed with exit code '1'… Leia mais »
Hummm…
That’s strange. I’m not having any issues.
Are you using the same “tmp” directory from the dizzy banch you tried before? If so, I suggest you to move to a “brand new” “tmp” folder.
Here is my Build Configuration:
BB_VERSION = “1.26.0”
BUILD_SYS = “x86_64-linux”
NATIVELSBSTRING = “Ubuntu-14.04”
TARGET_SYS = “arm-poky-linux-gnueabi”
MACHINE = “raspberrypi2”
DISTRO = “poky”
DISTRO_VERSION = “1.8”
TUNE_FEATURES = “arm armv7a vfp thumb neon callconvention-hard vfpv4 cortexa7”
TARGET_FPU = “vfp-vfpv4-neon”
meta-embarcados
meta-rpi = “fido:ee3a818c17a94a5f796f1fa7e5e557631db947c1”
meta-qt5 = “fido:3ccdc239b02aca03dc1e9316b7c5c870b3b59368”
meta-raspberrypi = “fido:b896a7da70dd7a16ba7ffd664f7747cb37e1d142”
meta-oe
meta-ruby = “fido:5b0305d9efa4b5692cd942586fb7aa92dba42d59”
meta
meta-yocto = “fido:508c4cac320d78a983ce105a78c0599102e2c349”
Yeah I had just renamed my folders.
But I remember I had deleted and recreated my
build
folder with the following command. poky/oe-init-build-env build
, so I think it should have been alright.I will trash my current
tmp
and launch a compilation now. Should have something by the morning. I am sure I have done something wrong. Remember I had forgotten to pull on one repo. Hey thanks for bearing all my questions. It’s appreciated.I am wondering if
STAGING_DIR_TARGET
doesn’t get another value than the expected. Is there a way I could check that?You can check on the run.do_configure, run.do_compile and log.do_compile files if the path is correct.
I can’t find
CXXFLAGS
in the logs. Could it be that myqtwebengine_%.bbappend
is not evaluated? do I need to tell some conf file to take it into account?I may have a better question in order to troubleshoot my issue (I am falling in desperation, but I will keep on studying this until I figure it out). So… How do you actually check out that the qtwebengine_%.bbappend was appended to the config? The recipes ./poky/meta-qt5/recipes-qt/qt5/qtwebengine_git.bb ./poky/meta-qt5/recipes-qt/qt5/qtwebengine_5.4.1.bb ./poky/meta-embarcados/meta-rpi/recipes-qt/qt5/qtwebengine_%.bbappend The config I have also double checked the layer.conf and it looks alright. Yet I think that somehow the .bbappend is not taken into account. [email protected] Vinícius Martins Meneses:~/yocto/poky/meta-embarcados/conf$ more layer.conf # We have a conf and classes directory, add to BBPATH BBPATH .= ":${LAYERDIR}" # We have recipes-* directories, add… Leia mais »
Joel,
I’m really really sorry.
I had another qtwebengine_%.bbappend in which was doing the trick.
I had committed the changes in meta-embarcados and it should work for you now.
It’s quite alright 🙂 It’s a learning process for me. All these small issues force me to get deeper into Yocto’s workflow, and I have to say that despite some moments of “despair”, I am rather happy! I manage to get Chromium Web Engine running on RPi2 using EGLFS, then I will feel like a hero. Take care Diego. UPDATE – The image deployed well on the RPi2!!!! … Here is another issue though… not directly related to your post, but you may stumble upon it sooner or later. Also posted my question on stackoverflow http://stackoverflow.com/questions/30768775/invalid-elf-header-when-trying-to-use-qtwebengine-qml-plugin-on-arm The ELF header issue… Leia mais »
Joel,
Glad that it worked.
Hi I’m Matt from Italy, I made everything working fine but my qml app (simple draw of a item with a label in it) won’t display, it load correctly but it shows no logs at all, just a blank screen. Have you ever tried to write a simple qml application?
Hi Matt,
Nice to meet you.
Yes I’ve already used qml app with opengles but on another SoC platform (Allwinner A20).
As far as I remember I had to launch the app like this: “qmlscene app.qml -platform eglfs”.
Diego,
Estou querendo implementar reconhecimento de comandos de voz, estou utilizando o CMU Sphinx juntamente com o pocketsphinx, e queria saber se tem alguma layer para agilizar o processo. Porque hoje eu instalo manualmente o sphinx.
E onde eu posso encontrar essas layers para yocto.
Obrigado.
Olá Ulysses,
Existem muitos layers disponíveis para uso no Yocto em http://layers.openembedded.org/layerindex/branch/master/layers/.
Em específico para a sua aplicação, dei uma pesquisada e encontrei isso: http://layers.openembedded.org/layerindex/branch/master/recipes/?q=sphinx
Existem dois layers, meta-tos e meta-tizen, que podem lhe ajudar.
Abraços!
Olá Henrique,
Vou baixar e compilar agora, muito obrigado pela dica.
Assim que terminar posto o resultado aqui.
Vlw
Abraços
Dúvida,
Pra que eu possa utilizar esta layer basta eu adicionar a dependendia no arquivo bblayers.conf e rodar bitbake qt5-image-demo, pois no site
https://github.com/bmwcarit/meta-ros
diz que para utilizar bitbake core-image-ros-roscore.
E se for para utilizar este ultimo, eu continuo tendo o suporte ao QT5?
A imagem que está sendo construída no post é a qt5-image-demo.
Você pode adicionar as receitas que deseja compilar do layer meta-ros na variável IMAGE_INSTALL, com append, da seguinte forma:
IMAGE_INSTALL_append = ” pocketsphinx”
Adicione as receitas que lhe interessar. Assim mantém o suporte a QT5. Espero tê-lo ajudado!
Abraços
Muito obrigado Henrique Prossi,
Funcionou perfeitamente.
Adicionei:
IMAGE_INSTALL_append = ” pocketsphinx sphinxbase”
no local.conf
Obrigado
Abraços
Preciso de mais uma ajudinha,
Para poder reconhecer o microfone preciso instalar a libasound2-dev, para isso executei
apt-get install libasound2-dev
porém o resultado foi:
Reading package lists… Done
Building dependency tree… Done
E: Unable to locate package libasound2-dev
como eu posso instalar esta biblioteca?
isso também ocorreu com a instalação do bison, e outros.
Ulysses, Deixa eu ver se consigo te explicar alguns conceitos por trás do Yocto. Com ele você constrói a sua própria distro com pacotes, bibliotecas e aplicativos que deseja. Porém ele não é “compatível” com outras distribuições desktop (Ubuntu, Debian etc). Por isso que quando você tenta instalar um pacote via apt-get ele não os encontra, porque na verdade ele está tentando buscar em um repositório de pacotes “seu”. Sendo-se, você precisa criar um repositório próprio para poder instalar os pacotes que deseja, ou gerar uma imagem que já os contenha. Como você quer instalar diversos pacotes sugiro que crie… Leia mais »
Diego,
Entendi, obrigado pela dica, vou ler essa documentação e comprar o livro.
Estou mechendo com o yocto e estou gostando, porém estou tendo essas dificuldades.
Obrigado
Abraços
Depois de instalado, quais pastas posso remover para liberar algum espaço?
Obrigado!
Olá Fernando, Não é aconselhável que delete pastas afim de se ganhar espaço. O ideal é que você gere uma distribuição com apenas com os pacotes que desejar. Neste tutorial geramos uma imagem de demonstração na qual possui praticamente a instalação completa do qt5 e de vários aplicativos e exemplos. Remova os pacotes e aplicativos que não deseja desses arquivos: https://bitbucket.org/embarcados/meta-embarcados/src/434dc81fcb7fe630c107ef172afc33ce62e335db/recipes-core/images/qt5-image-demo.bb?at=daisy https://bitbucket.org/embarcados/meta-embarcados/src/434dc81fcb7fe630c107ef172afc33ce62e335db/recipes-core/packagegroups/packagegroup-qt5.bb?at=daisy E costomizar a construção do qt5 através da variável “PACKAGECONFIG_append” nesse arquivo: https://bitbucket.org/embarcados/meta-embarcados/src/434dc81fcb7fe630c107ef172afc33ce62e335db/meta-rpi/recipes-qt/qt5/qtbase_5.3.%25.bbappend?at=daisy Para saber as opções disponível da variável “PACKAGECONFIG_append” dê uma olhada nesse arquivo: https://github.com/meta-qt5/meta-qt5/blob/master/recipes-qt/qt5/qtbase.inc Depois de fazer os ajustes gere a imagem novamente com o… Leia mais »
Obrigado, Diego!
Gerei a imagem demo, gravei no sd, bootei. Tudo perfeito.
Neste momento estou gerando o toolchain do Qt.
Como estou em um Mac, estou usando uma VM Ubuntu. Pretendo fazer a estratégia de ir programando no Qt do Mac e depois só mandar o source para a VM “cross-compilar”.
Depois de configurado para fazer cross-compiling pretendia dar uma “emagrecida” nessa VM e deixar só com o básico para ir compilando.
O caminho para instalação do toolchain para x64 esta faltando o diretorio sdk, o correto é:
~/yocto/build-daisy/tmp/deploy/sdk/poky-eglibc-x86_64-meta-toolchain-qt5-armv6-vfp-toolchain-1.6.1.sh
Olá Ulysses,
Obrigado pela observação.
Já corrigi no post.
Abraços
hello i’m from mexico, i followed the tutorial but when i generate the bitbake meta-toolchain-qt command my project don´t generate the sdk folder
[…] Raspberry pi + Qt5 + Yocto – parte 2 […]