查看“Debian Base 系统使用”的源代码
←
Debian Base 系统使用
跳转至:
导航
,
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
==基础信息== *用户密码 <syntaxhighlight lang="bash"> user: root passwd: root </syntaxhighlight> ==使用示例== ===视频硬件编解码=== *使用gstreamer播放视频 <syntaxhighlight lang="bash"> $ gst-play-1.0 /usr/local/test.mp4 </syntaxhighlight> [[文件:277317066.jpg|frameless|650px]]<br /> <br /> *播放4K视频 <syntaxhighlight lang="bash"> $ gst-launch-1.0 playbin uri=file:///root/4k.mp4 </syntaxhighlight> [[文件:531422585.jpg|frameless|650px]]<br /> <br /> *列出一些gstreamer命令 <syntaxhighlight lang="bash"> $ gst-launch-1.0 playbin uri=file:///usr/local/test.mp4 $ gst-launch-1.0 uridecodebin uri=file:///usr/local/test.mp4 ! kmssink $ gst-launch-1.0 filesrc location=/usr/local/test.mp4 ! queue ! qtdemux name=dmux dmux.video_0 ! queue ! h264parse ! mppvideodec ! kmssink dmux.audio_0 ! queue ! aacparse ! faad ! autoaudiosink $ gst-inspect-1.0 kmssink # 查看插件信息 $ gst-discoverer-1.0 /usr/local/test.mp4 # 查看视频信息 </syntaxhighlight> ===OpenCL=== *安装并运行<code>clinfo</code>,查看OpenCL相关信息 <syntaxhighlight lang="bash"> $ sudo apt-get install -f -y clinfo $ clinfo Number of platforms 1 Platform Name ARM Platform Platform Vendor ARM Platform Version OpenCL 1.2 v1.r14p0-01rel0-git(a79caef).8ddfd7584149d9238dced4e406610de7 Platform Profile FULL_PROFILE Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addy Platform Extensions function suffix ARM Platform Name ARM Platform Number of devices 1 Device Name Mali-T860 Device Vendor ARM Device Vendor ID 0x8602000 Device Version OpenCL 1.2 v1.r14p0-01rel0-git(a79caef).8ddfd7584149d9238dced4e406610de7 Driver Version 1.2 Device OpenCL C Version OpenCL C 1.2 v1.r14p0-01rel0-git(a79caef).8ddfd7584149d9238dced4e406610de7 Device Type GPU Device Profile FULL_PROFILE Max compute units 4 Max clock frequency 800MHz Device Partition (core) Max number of sub-devices 0 Supported partition types None Max work item dimensions 3 Max work item sizes 256x256x256 Max work group size 256 ... </syntaxhighlight> {{模板:RKDebianNetworkConfiguration}} {{模板:RKExportPackFirmware}} ==QT开发== ===qt程序测试脚本=== 系统中添加了qt_test.sh和qt_test_touchscreen.sh测试脚本,在系统终端下直接运行: <syntaxhighlight lang="bash"> qt_test.sh </syntaxhighlight> [[文件:1365219484.jpg|frameless|650px]] 基于libinput、tslib或evdev适配触摸屏运行qt程序: <syntaxhighlight lang="bash"> qt_test_touchscreen.sh libinput qt_test_touchscreen.sh tslib qt_test_touchscreen.sh evdev </syntaxhighlight> [[文件:285324002.jpg|frameless|650px]] ===搭建qt开发环境=== 主机PC端环境为Ubuntu20.04,目标板系统为debian base系统,默认使用root用户自动登录,并支持root用户ssh远程登录,系统中移植了qt,支持linuxfb显示插件。 SDK与系统镜像一同发布,从相应的烧录包中获取SDK。SDK中包含交叉编译工具链、qmake、与目标板系统qt环境。解压SDK到任意目录$TOP_DIR(示例中以路径~/trash为例),并运行开发环境配置脚本 <syntaxhighlight lang="bash"> export TOP_DIR=~/trash mkdir -p ~/trash tar xpf host.tar.gz -C $TOP_DIR cd $TOP_DIR/host ./relocate-sdk.sh </syntaxhighlight> ===使用终端命令行编译运行qt程序=== qt程序使用SDK中的qt5 examples例程,通过qmake、make命令进行编译: <syntaxhighlight lang="bash"> export PATH=$TOP_DIR/host/bin:$PATH cd $TOP_DIR/host/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/widgets/widgets/calculator qmake make </syntaxhighlight> 生成calculator程序,可通过scp拷贝到目标板中,并配置qt运行环境变量后运行: <syntaxhighlight lang="bash"> scp calculator root@10.168.1.157: ssh root@10.168.1.157 export LD_LIBRARY_PATH=/opt/data/target/usr/lib export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/data/target/usr/lib/qt/plugins </syntaxhighlight> 指定linuxfb显示插件运行程序: <syntaxhighlight lang="bash"> ./calculator -platform linuxfb </syntaxhighlight> [[文件:481762326.jpg|frameless|650px]] ===使用qtcreator开发调试qt程序=== qtcreator集成编辑、编译、运行、调试环境于一体,提升开发效率。 '''安装qtcreator''' <syntaxhighlight lang="bash"> sudo apt install qtcreator qtbase5-dev qt5-default qtbase5-examples </syntaxhighlight> '''添加Qt Versions'''<br /> Tools --> Options --> Kits --> Qt Versions --> Add --> 选中qmake路径 --> Apply<br /> [[文件:Screenshot_from_2023-02-09_19-26-12.png|frameless|650px]] '''添加Compilers'''<br /> Tools --> Options --> Kits --> Compilers --> Add --> GCC --> C++ --> 选中g++路径 --> Apply<br /> [[文件:Screenshot_from_2023-02-09_19-35-47.png|frameless|650px]] '''添加Debuggers'''<br /> Tools --> Options --> Kits --> Debuggers --> Add --> 选中gdb路径 --> Apply<br /> [[文件:Screenshot_from_2023-02-09_19-41-35.png|frameless|650px]] '''添加Devices'''<br /> Tools --> Options --> Devices --> Add --> General Linux Device --> start Wizard --> 输入设备IP和用户名 --> Next --> Next --> Finish --> 输入root用户密码进行测试 --> Close [[文件:Screenshot_from_2023-02-09_20-21-38.png|frameless|650px]]<br /> <br /> [[文件:Screenshot_from_2023-02-09_20-23-35.png|frameless|650px]]<br /> <br /> [[文件:Screenshot_from_2023-02-09_20-23-39.png|frameless|650px]] '''添加Kits'''<br /> Tools --> Options --> Kits --> Add --> 如图示添加各项配置 --> Apply<br /> [[文件:Screenshot_from_2023-02-09_20-29-36.png|frameless|650px]] '''打开calculator工程并选择Kits'''<br /> Welcome --> Projects --> Open --> 选择工程路径 /home/lin/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/qt/examples/widgets/widgets/calculator/calculator.pro --> Configure Project<br /> [[文件:Screenshot_from_2023-02-09_19-58-43.png|frameless|650px]] '''配置设备运行环境变量'''<br /> Projects --> Active Project --> calculator --> Build & Run --> Unnamed --> Run --> Run Environment --> Details --> Batch Edit --> 添加QT程序运行环境变量 --> OK <syntaxhighlight lang="bash"> export LD_LIBRARY_PATH=/opt/data/target/usr/lib export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/data/target/usr/lib/qt/plugins export QT_QPA_PLATFORM=linuxfb </syntaxhighlight> [[文件:Screenshot_from_2023-02-09_20-50-10.png|1560px|frameless|650px]] '''编译运行calculator'''<br /> Projects --> Run --> 输入root用户密码 --> 程序构建后会部署到设备上并运行<br /> [[文件:Screenshot_from_2023-02-09_20-57-10.png|1560px|frameless|650px]]<br /> <br /> [[文件:Screenshot_from_2023-02-09_20-57-15.png|1560px|frameless|650px]] '''配置debug模式'''<br /> Projects --> debian-kit --> Build<br /> 注意:找到 Build Steps --> qmake --> Details --> Additional arguments --> 添加 QMAKE_CXXFLAGS+=-g<br /> [[文件:Screenshot from 2020-08-11 17-36-06.png|1560px|frameless|650px]] '''重新编译并调试运行'''<br /> Build --> Clean Project "calculator"<br /> Debug --> Start Debugging --> Start Debugging<br /> [[文件:Screenshot from 2020-08-11 17-33-48.png|1560px|frameless|650px]]<br /> <br /> [[文件:378111369.jpg|1560px|frameless|650px]] GDB Server executable路径为: /opt/data/target/usr/bin/gdbserver<br />
该页面使用的模板:
模板:RKExportPackFirmware
(
查看源代码
)
模板:Ubuntu主机开发环境搭建
(
查看源代码
)
模板:使用nmcli命令配置网络
(
查看源代码
)
返回至
Debian Base 系统使用
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息