新闻  |   论坛  |   博客  |   在线研讨会
迅为RK3399开发板Debian系统设置开机自启动脚本
daybydayi | 2022-05-18 09:44:15    阅读:130   发布文章

如果想要开机运行某程序,需要在开发板上编辑"/etc/rc.local"文件,在此文件添加你想开机运行的命令即可。这里给大家做一个示范,我们的需求是开机自启动 hello.sh 脚本,并且打印 hello ! nice to meet you!
1. 首先启动 iTOP-3399 开发板,开发板里面烧写 Debian 系统,启动开发板如下图所示:


2. 我们要运行一个 hello.sh 的脚本,首先要写一个脚本,脚本保存在开发板的/mnt 目录下,脚本内容如下:
echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" echo "hello ! nice to meet you!" 3. 脚本写完,我们一定要执行 chmod 777 hello.sh 命令,赋予脚本权限,否则,不能运行程序。注意!
一定要赋予开机运行的程序权限,否则不会开机启动。

3. 脚本写完,我们一定要执行 chmod 777 hello.sh 命令,赋予脚本权限,否则,不能运行程序。注意!一定要赋予开机运行的程序权限,否则不会开机启动。


4. 然后我们编辑开发板上的"/etc/init.d/rcS"文件,在里面添加你想开机运行的命令。输入命令:
vi /etc/init.d/rcS
我们想要开机自启动 hello.sh 脚本,所以我们在/etc/init.d/rcS 文件中添加如下命令:
cd /mnt && ./hello.sh
添加完保存退出,如下图所示:


5. 重新启动开发板,发现打印信息如下,开发板成功自启动运行 hello.sh,并且打印 hello ! nice to meet you!



iTOP-RK3399 核心板采用 四核 <a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" cortex"="" www.eechina.com="">Cortex" target="_blank">Cortex-53 + 双核 Cortex-A72 架构,主频 1GHz,4G DDR4,16G EMMC。核心板采用RK808 <a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" 电源管理"="">电源管理" target="_blank">电源管理芯片以提供低功耗管理。GPU 采用 Mali-T864,支持 2D、3D 加速。支持 OpenGL、ES1.1/2.0/3.0/3.1/3.2,OpenCL 1.2 和 DirectX 11.1 图形编程接口,支持 H.264/H.265/VP9 解码,像素最高达 4K@60fps,支持 H.264/H.265 编码,像素最高达 1080p@30fps。屏幕显示支持 MIPI、DP、eDP、<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" hdmi"="">HDMI" target="_blank">HDMI 接口并支持双屏同显、双屏异显,支持两路 MIPI CSI Camera 接口,可用于深度学习、机器学习、图像处理。核心板也支持 PCIE 接口,对于需要大容量存储的客户,可将其用于扩展 M2 接口固态硬盘。
iTOP-RK3399 核心板采用<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" 连接器"="">连接器" target="_blank">连接器连接方式,方便客户根据行业需求定制底板。核心板 320 PIN 角全部引出,核心板外部接口丰富,包括 2 路 SD/EMMC/SDIO 接口、1 路 PCIE、2 路 MIPI DSI、1 路 DP、1 路 eDP、1 路 HDMI、2 路 Camera MIPI、CSI 接口、1 路千兆以太网、4 路 <a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" usb"="">USB" target="_blank">USB 等。
iTOP-3399 开发板板载 4G 全网通、<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" gps"="">GPS" target="_blank">GPS 定位模块、双频 <a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" wifi"="">WIFI" target="_blank">WIFI+<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" 蓝牙"="">蓝牙" target="_blank">蓝牙 4.1、千兆以太网、双路摄像头接口、USB3.0、PCIE M.2 接口、<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" 陀螺仪"="">陀螺仪" target="_blank">陀螺仪等接口,尺寸为 19cm*12cm,3399 开发板全新升级支持 5G 方案,支持 <a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" android"="">Android" target="_blank">Android7.1 系统;Android8.1系统;<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" ubuntu"="">Ubuntu" target="_blank">Ubuntu16.04 系统;Debian9 系统;<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" linux"="">Linux" target="_blank">Linux+Qt5.9 等系统。
iTOP-RK3399通过了电磁兼容性检测、电磁辐射标准检测、安规检测、高低温坏境检测。7*24 小时长期稳定运行。10 年以上供货周期长,批量无忧。广泛适用于工控、智能家居、多媒体、安防、车载、消费<a class="relatedlink" href="http://www.eechina.com/keyword/%3Ca%20href=" target="_blank" keyword="" www.eechina.com="" 电子"="">电子" target="_blank">电子、手持设备、显示控制、教学、通讯等领域。
迅为RK3399开发板Debian系统设置开机自启动脚本
核心板参数:
尺寸: 6.5*5.5cm
高度 连同连接器在内 0.26cm
CPU:Cortex-A53 四核 ,主频 1.4GHz;Cortex-A72 双核 ,主频 1.8GHz 内存 2GB 双通道 DDR3(4GB LPDDR4 内存可选)
存储: 16GB EMMC
电源管理: 官方推荐 RK808 芯片
工作电压: 3.3V 供电
最大电流:(核心板启动时) 420mA
通常电流:(核心板系统启动后) 150mA
引角扩展: 引出脚多达 320 个,满足用户各类扩展需求
系统支持: Android7.1 系统;Android8.1 系统;Ubuntu16.04 系统;Debian9 系统;Linux+Qt5.9;
工作温度: 0℃ ~ +80℃
GPU: Mali-T860MP4 支持 3D/2D
图形编程接口: 支持 OpenGL ES1.1/2.0/3.0,OpenCL1.2, DirectX11.1
VPU 编码:H.264,MVC,VP8,最大支持 1080p@30FPS
解码: H.264, H.265,VP9, VP8, MVC,MPEG-2, MPEG-4,最大支持 2160p@60fps
Camera: 2 路 MIPI-CSI
IIS: 3 路
SD/MMC/SDIO: 2 路
PCIe: 1 路 PCIe2.0 x4
Ethernet: 1 路
UART: 5 路
IIC: 9 路
SPI: 6 路
USB: 2 路,USB Host 2.0,2 路,USB OTG 3.0
PWM: 3 路
ADC: 5 路
DP: 1 路
eDP: 1 路
HDM: 1 路
MIPI-DSI: 2 路
底板参数:
尺寸: 19cm*12cm
POWER: 电直流电源输入接口,12V/2A 电源输入
SWITCH :电源开关
HDMI 接口: 1 路 HDMI2.0 输出接口
Type-C: 1 路 Type-C USB3.0 接口,兼容 OTG 功能
TF 卡槽: 1 个
USB HOST: 4 路 USB2.0 接口
USB3.0: 1 路
网口: 1 路千兆以太网(10/100/1000Mbps)
串口: 2 路 RS232 串口
SIM 卡槽: 1 个
PHONE: 支持耳机输出
MIC: 支持 MIC 输入
IRDA: 1 个 红外一体化接收头
按键: 6 个
4G 模块: 全网通(选配)
CAMERA 接口: CAMERA 1 路、MIPI CAMERA 1 路
PCB 板: 4 层
GPS 模块: 支持(选配)
WIFI/BT: 双频 2.4G/5G WIFI、Bluetooth4.1 二合一模块
EDP LCD: 1 路
MIPI_TX: 1 路
MIPI_TX/RX: 1 路
SPDIF: 光纤输出接口
BUZZER :1 个蜂鸣器
RTC: 实时时钟
GPIO 接口: 20PIN,包括 2 路 ADC、2 路 I2C、 5v、3.3v 电源和地
LED: 3 个
PCIE: PCIE M.2 接口
陀螺仪: 支持
电子罗盘: 支持
GPIO :20 路
光线传感器: 支持


*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
推荐文章
最近访客