Single board computer for embedded programmer

This tutorial will be useful for programmers who have switched from avr or stm32 to single board computers running Ubuntu. It's up to you to decide which Linux distribution to use, but Ubuntu is the friendliest distribution.





Introduction

So, yesterday you programmed on a microcontroller UART, GPIO and nothing boded trouble, but the customer also wanted a 20 "display with a touchscreen ... And now you are considering options for single-board computers (SBC). There are a lot of them. I will share my bitter experience I was looking for a cheaper option and my choice was Orange Pi.





First, the PC PLUS model. For it there is an assembly of Armbian with a fresh OS, unlike the manufacturer's website, where you will be offered Ubuntu 16. But bad luck, with Armbian OrangePi PC PLUS does not turn off. OrangePi PC PLUS writes system halted at the end, because the closed source co-processor AR100 , which was not included in Armbian, is responsible for shutting down . You can get the Ubuntu image from the manufacturer's website. There are several images, I tried everything, only one actually turns off the single-board. What is the attitude of xunlong towards the user, that they post firmware, where their brainchild cannot be turned off ?! Also on PC PLUS there were insurmountable difficulties with the 4: 3 screen connection.





Next, I tried OrangePi 4G. Of course I want to have control over the system, so android is not suitable for me. However, from under Ubuntu on OrangePi 4G nothing works except the CPU. No drivers ... Everything works for Android except HDMI, xunlong managed to make HDMI, which is incompatible with most monitors (it is impossible to know in advance whether your monitor will be compatible with OrangePi 4g).





Next, I took OrangePi 4B. It is striking that in the console he calls himself Orange Pi 4. But the label on the SBC itself says 4B (v1.4 on the pcb). When installing any version of Armbian on it under load, the SBC immediately reboots. I thought it was a marriage, but Ubuntu 18 from the manufacturer's website works stably under many hours of load (the power supply was purchased from the same xunlong). But at startup, the same Ubuntu 18 from the manufacturer's website hangs for ten seconds with the message CONFIG-ERROR) dhd_conf_set_intiovar: txbf setting failed -23 and I can't even guess where to dig ...





SBC. GPU MALI, . MALI, - DRI2: failed to authenticate .





SBC STM32MP157C-DK2 , MALI, .





OrangePi 4B. Ubuntu 18 Ubuntu 20.04 . RK3399 ?





. :





  • gcc -





  • g++ - ++





  • gcc --version g++ --version





  • g++ - , g++-9 g++-10, , g++





gcc g++ , :





sudo ln -s g++-10 /usr/bin/g++







g++ 10 . gcc . Linux: , /usr/bin, . , , . ls.





, SBC - ++. , SBC. , Qt. Qt - , , , : GUI, com port, ethernet, 3D, , xml ...





Ubuntu . - , , . Ubuntu , , Ubuntu .





, Qt . SBC SBC. , , , OrangePi 4B.





Qt - . , Qt , . IDE Qt Creator Qt , x86_64 ( AArch64) Qt . , Qt , . , Qt , qmake qmake .





Qt

Qt 5.15 . . , GUI, com port, . C++20, . , ( std) .





Ubuntu out-of-source build. ! , ext4, . , QtFromGit, . build ( ) build_artifacts , qmake, . QtFromGit Qt:





git clone git://code.qt.io/qt/qt5 qt5 && cd qt5 && git checkout 5.15 && cd qt5





perl init-repository --module-subset=default,qtcharts,qtserialport,-qtactiveqt,-qtcanvas3d,-qtdocgallery,-qtfeedback,-qtserialbus,-qtconnectivity,-qtdeclarative,-qtquickcontrols2,-qtsvg,-qtquickcontrols,-qtwebengine,-qtwayland,-qtandroidextras,-qtdoc,-qtgraphicaleffects,-qtqa,-qttranslations,-qtvirtualkeyboard,-qtquicktimeline,-qtquick3d,-qtrepotools,-qttools,-qtshadertools,-qtimageformats,-qtnetworkauth,-qtwebsockets,-qt5compat,-qt3d,-qtsensors,-qtquicktimeline,-qtmultimedia,-qtdatavis3d,-qtscript,-qtgamepad,-qtlottie,-qtmacextras,-qtremoteobjects,-qtlocation,-qtspeech,-qtwebchannel,-qtwebglplugin,-qtwebview,-qtwinextras,-qtpurchasing,-testsuites,-qtxmlpatterns





. X11:





cd ../build && ../qt5/configure -release -static -opensource -make libs -nomake examples -nomake tests -confirm-license -no-pch -no-xcb -no-xcb-xlib -no-gtk -skip webengine -skip qtwayland -skip qtdoc -skip qtgraphicaleffects -skip qtqa -skip qttranslations -skip qtvirtualkeyboard -skip qtquicktimeline -skip qtquick3d -skip qt3d -skip qtrepotools -skip qttools -skip qtimageformats -skip qtnetworkauth -skip qtwebsockets -skip qtactiveqt -skip qtmacextras -skip winextras -skip qtmultimedia -skip qtgamepad -skip qtserialbus -skip qtspeech -skip qtsensors -skip qtcharts -skip qtlocation -opengl es2 -qpa eglfs -no-ssl -c++std c++2a -prefix ../build_artifacts





. :





export QT_QPA_EGLFS_INTEGRATION=eglfs_kms





export QT_DEBUG_PLUGINS=1





cd ../build && ../qt5/configure -release -static -opensource -make libs -nomake examples -nomake tests -confirm-license -no-pch -no-xcb -no-xcb-xlib -no-gtk -skip webengine -skip qtwayland -skip qtdoc -skip qtgraphicaleffects -skip qtqa -skip qttranslations -skip qtvirtualkeyboard -skip qtquicktimeline -skip qtquick3d -skip qt3d -skip qtrepotools -skip qttools -skip qtimageformats -skip qtnetworkauth -skip qtwebsockets -skip qtactiveqt -skip qtmacextras -skip winextras -skip qtmultimedia -skip qtgamepad -skip qtserialbus -skip qtspeech -skip qtsensors -skip qtcharts -skip qtlocation -kms -opengl es2 -qpa eglfs -no-ssl -c++std c++2a -prefix ../build_artifacts









make -j8





make install





! htop. !





Qt qmake , qmake.





sudo ln -s /QtFromGit/buildartifacts/bin/qmake /usr/bin//qmake





qtcharts. QtFromGit build_qtcharts. cd build_qtcharts.





qmake ../qt5/qtcharts/qtcharts.pro INCLUDEPATH+=../qt5/qtcharts/include/QtCharts CONFIG+=release





make -j8





make install





Qt Orange Pi 4B. com port dialout . , make clean, , build. (, Qt - , ), . :





git submodule foreach --recursive "git clean -dfx" && git clean -dfx





. qt5 ( Qt) 325 . ( ) build buildartifacts 293 . Qt. build_artifacts, Qt, 150 . , Qt . . 4 1,8 . Release, -developer-build ( Qt ), 12 + .





If you are interested in this topic, support in the comments! I plan to devote the second part to LED blinking.








All Articles