TinaV2.1 Development Introduction

TinaV2.1 开发说明

1.Use and installation of Adb tool

Adb工具的使用和安装

1.1 adb introduce

adb工具介绍

​ adb stands for Android Debug Bridge, which acts as a debugging bridge between PC and mobile phone, tablet, and development board. With the help of adb tool, we can manage the device and perform many operations, such as running shell commands and sending files to the development board.

adb全称Android Debug Bridge,对于PC和手机.平板.开发板之间,起到调试桥的作用。借助adb工具, 我们可以对设备进行管理,还可以进行很多操作,比如运行shell命令,向开发板发送文件等。

1.2 adb installation and configuration

adb工具的安装和配置

  • adb installation

    adb 安装

    sudo apt-get install android-tool-adb
    
  • adb configuration

    adb 的配置

    1. Connect the development board and the computer correctly, start minicom or putty, and see the system in the development board start normally and enter the shell in the minicom terminal. If you have not programmed the Tina system to the development board, please first program the system

    将开发板和电脑正确链接,启动minicom或putty,要在minicom终端里看见开发板里系统正常启动并进入shell,如果没有烧写Tina系统到开发板,请先烧写系统

    ​ 2.Open the terminal on the computer, run the command lsusb, check the device, and find the serial port connected between the computer and the development board, as follows:

    打开电脑上的终端,运行命令lsusb,查看设备,找到电脑和开发板相连接的串口,如下:

    ​ 3.Use the command sudo vim /etc/udev/rules.d/50-android.rules to open the 50-android.rules file on the computer (create one if not) for configuration, so that the computer can recognize this serial port. The specific configuration is as follows (that is, write in this file):

    使用命令 sudo vim /etc/udev/rules.d/50-android.rules 打开电脑上的50-android.rules文件(如果没有就创建一个)进行配置,这样电脑就能识别到此串口。具体配置如下(即在此文件里写入):

    ​ The SUBSYSTEM option remains unchanged, the ATTR{idVendor} option fills in the device ID (the device ID is shown in the figure above, fill in according to your own device), the ATTR{idProduct} fills in the device product ID (the device product ID is in the figure above), and the MODE option remains unchanged. Save and exit. Then run the following command:

    SUBSYSTEM选项不变,ATTR{idVendor}选项中填写设备ID(设备ID见上图,根据自己设备填写),ATTR{idProduct}填写设备产品ID(设备产品ID见上图),MODE选项不变。保存退出。然后运行以下命令:

    sudo chmod a+rx /etc/udev/rules.d/50-android.rules
    sudo /etc/init.d/udev restart
    

    ​ 4.$sudo vim ~/.android/adb_usb.ini, open the adb_usb.ini file, and write 0x067b (device ID) to it

    $sudo vim ~/.android/adb_usb.ini,打开adb_usb.ini文件,向里面写入0x067b(设备ID)

    ​ 5.Open minicom and enter the adbd command in the shell to ensure that the adb service in the development board is normal (if there is an error, it cannot be used). Then run the following command on the computer:

    打开minicom,在shell里输入adbd命令,确保开发板里的adb服务正常(若出现错误,则不能使用)。然后在电脑端的运行e以下命令:

    sudo adb kill-server
    sudo adb start-server
    adb devices
    

    ​ After running, you can see the equipment list, as follows

    运行完成之后即可看见设备清单,如下

1.3 The use of adb basic commands

adb基本命令的使用

adb shell

This command will log in to the shell of the device, followed by the command to run the device directly, which is equivalent to executing a remote command

这个命令将登录设备的shell, 后面加直接运行设备命令, 相当于执行远程命令

adb push

This command can copy files on the computer to the development board

此命令可以把电脑上的文件复制到开发板上

adb push hello.c /tmp/

adb push hello.c /tmp/ This copies the hello.c file on the computer to the /tmp directory on the development board

adb push hello.c /tmp/ 这样就把电脑上的hello.c文件复制到了开发板上的/tmp目录下

adb pull /tmp/hello.c ./

adb pull /tmp/hello.c ./ Copy the file hello.c in the /tmp directory on the development board to the current directory

adb pull /tmp/hello.c ./ 将开发板上/tmp目录下的文件hello.c复制到当前目录

2.Write an application to run on the development board

编写应用程序在开发板上运行

2.1Environment variable configuration

环境变量配置

  • First add the directory where the tool chain of the development software is located into the environment variable. For Tina system, the arm tool chain is in the tina/prebuilt/gcc/linux-x86/arm/toolchain-sunxi/toolchain/bin directory. Then open the .bashrc file in your user directory, and add a sentence at the end of this file, as follows:

    首先将开发软件的工具链的所在目录添 加进环境变量里。对于Tina系统来说,其arm工具链在tina/prebuilt/gcc/linux-x86/arm/toolchain-sunxi/toolchain/bin目录下。然后在自己的用户目录下打开.bashrc文件,在这个文件的最后面添加一句话,如下:

export PATH=$PATH:/home/book/R16/tinaV2.1/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin
```

  • Save and exit, then log out of the system and log in again. After logging in, enter the command env in the terminal to check whether this directory is included in the PATH variable. If it does, the addition is successful.

    保存后退出,然后注销系统,重新登录。登录之后在终端里输入命令env查看一下PATH变量里是否包含此目录,若包含则添加成功。

2.2 The first development method

第一种开发方式

  1. Write a hello.c file

写一个hello.c文件

#include<stdio.h>int main(int argc,char** argv)
{printf("hello world\n");
}
  1. Compile using cross-compilation tool chain

使用交叉编译工具链编译

 arm-openwrt-linux-muslgnueabi-gcc -o hello hello.c
  1. Use adb tool to upload to the development board to view the running effect

使用adb工具链上传到板子上运行,并看看效果

adb push hello /tmp/

2.3 The second development method

第二种开发方式

  1. First create a hello folder under /home/book/R16/tinaV2.1/package/allwinner/hello

首先在/home/book/R16/tinaV2.1/package/allwinner/hello下创建一个hello文件夹

  1. Create a makefile and src folder under the hello folder, add my hello.c file to the src folder, and add a makefile file to the src folder.

在hello文件夹下创建一个makefile和src文件夹,将我的hello.c文件添加到src文件夹中,并在src文件夹中添加makefile文件。

  1. Write makefile

写makefile

##############################################
# OpenWrt Makefile for helloworld program
#
#
# Most of the variables used here are defined in
# the include directives below. We just need to
# specify a basic description of the package,
# where to build our program, where to find
# the source files, and where to install the
# compiled program on the router.
#
# Be very careful of spacing in this file.
# Indents should be tabs, not spaces, and
# there should be no trailing whitespace in
# lines that are not commented.
#
##############################################
include $(TOPDIR)/rules.mk# Name and release number of this package
PKG_NAME:=hello
PKG_VERSION:=1.0
PKG_RELEASE:=1# This specifies the directory where we're going to build the program.
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME)include $(BUILD_DIR)/package.mk# Specify package information for this program.
# The variables defined here should be self explanatory.
# If you are running Kamikaze, delete the DESCRIPTION
# variable below and uncomment the Kamikaze define
# directive for the description below
define Package/helloSECTION:=utilsCATEGORY:=AllwinnerTITLE:=hello app test endef# Specify what needs to be done to prepare for building the package.
# In our case, we need to copy the source files to the build directory.
# This is NOT the default.  The default uses the PKG_SOURCE_URL and the
# PKG_SOURCE which is not defined here to download the source from the web.
# In order to just build a simple program that we have just written, it is
# much easier to do it this way.
define Build/Preparemkdir -p $(PKG_BUILD_DIR)$(CP) -r ./src/* $(PKG_BUILD_DIR)/
endefdefine Build/Compile$(MAKE) -C $(PKG_BUILD_DIR)/ \ARCH="$(TARGET_ARCH)" \AR="$(TARGET_AR)" \CC="$(TARGET_CC)" \CXX="$(TARGET_CXX)" \CFLAGS="$(TARGET_CFLAGS)" \LDFLAGS="$(TARGET_LDFLAGS)" \all
endef# We do not need to define Build/Configure or Build/Compile directives
# The defaults are appropriate for compiling a simple program such as this one# Specify where and how to install the program. Since we only have one file,
# the helloworld executable, install it by copying it to the /bin directory on
# the router. The $(1) variable represents the root directory on the router running
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
# directory if it does not already exist.  Likewise $(INSTALL_BIN) contains the
# command to copy the binary file from its current location (in our case the build
# directory) to the install directory.
define Package/hello/install$(INSTALL_DIR) $(1)/usr/bin/$(INSTALL_BIN) $(PKG_BUILD_DIR)/hello $(1)/usr/bin/
endef# This line executes the necessary commands to compile our program.
# The above define directives specify all the information needed, but this
# line calls BuildPackage which in turn actually uses this information to
# build a package.$(eval $(call BuildPackage,hello))
all:$(CC) $(CFLAGS) hello.c -o helloclean:rm *.o hello
  1. make menuconfig to see if the addition is successful

在make menuconfig中看看是否添加成功

  1. Compile the .ipk package

编译ipk包

make package/allwinner/hello/{clean,install} V=s

  1. Download the ipk package to the development board

将ipk包下载到开发板上

cd  /home/book/R16/tinaV2.1/out/astar-parrot/packages/base/
adb push hello_1.0-1_sunxi.ipk /tmp/

  1. Install and check the effect

安装然后查看效果

opkg install hello_1.0-1_sunxi.ipk
hello

ipk package to the development board

将ipk包下载到开发板上

cd  /home/book/R16/tinaV2.1/out/astar-parrot/packages/base/
adb push hello_1.0-1_sunxi.ipk /tmp/

[外链图片转存中…(img-K824YqY8-1598404424159)]

  1. Install and check the effect

安装然后查看效果

opkg install hello_1.0-1_sunxi.ipk
hello

Tina R16开发说明相关推荐

  1. 全志r11_全志R328 Demo开发板;全志R333开发板/核心板;全志R11开发板/核心板;全志R16开发板/方案设计...

    1.全志R328 Demo开发板 参数: 扫码可见详情信息: 2.全志R333开发板/核心板 硬件特征: 扫码可见详情信息: 3.全志R11开发板/核心板 硬件特征: 具体详情扫码可见: 4.全志R1 ...

  2. R16开发板tina系统LCD调试

    http://blog.csdn.net/u013686019/article/details/78934023 一.环境准备 1.开发板简介 一款名为PARROT的板子,长相如下: LCD的基本参数 ...

  3. 全志R16_SPI总线驱动的使用文档,全志R16开发资料

    介绍Linux 内核中SPI 子系统的接口及使用方法,为SPI设备驱动的开发提供参考.适用于基于Linux 3.4内核的全志R16硬件平台. 2. 2. 模块介绍 2.1.  模块功能介绍 Linux ...

  4. Tina R16烧录说明

    R16 burning instructions R16烧录说明 1.Installation PhoenixSuit 安装PhoenixSuit Download the PhoenixSuit_C ...

  5. Tina R16编译说明

    Tina Compilation Introduction Tina编译介绍 1.Environment setup 环境搭建 I am using the release version of ub ...

  6. 461在全志r16平台tinav3.0系统下使用地磁计QMC5883L

    461在全志r16平台tinav3.0系统下使用地磁计QMC5883L 2018/9/7 14:08 版本:V1.0 开发板:SC3817R SDK:tina v3.0 (基本确认全志tina v3. ...

  7. 【全志T113-S3_100ask】7-编译Tina系统初体验

    [全志T113-S3_100ask]7-编译Tina系统初体验 背景 (一)SDK准备 (二)环境准备 (三)编译系统 1.初次编译系统 2.进阶编译操作 (四)烧录系统 背景 7月28日,百问网官方 ...

  8. 前端趋势榜:上周最热门的 10 大前端项目 - 210327

    大家好,我是你们的 猫哥,那个不喜欢吃鱼.又不喜欢喵 的超级猫 ~ 关于猫哥,大家可以看看我的年终总结 前端工程师的 2020 年终总结 - 乾坤未定,你我皆黑马. 猫哥从 2016 年加入 GitH ...

  9. 【教程】制作能在ARM板上直接运行的gcc本地编译器

    编译好的程序的下载链接:百度网盘 请输入提取码(提取码:ocmm) 概述 通常情况下,我们是在电脑里面开一个Linux虚拟机, 在虚拟机里面用交叉编译工具链编译好可执行文件后,将可执行文件拷贝到板子里 ...

最新文章

  1. Unreal Engine4 可视化虚拟现实全流程学习教程
  2. 如何在Windows 2000的域环境中自动分发软件
  3. dxf转nc代码软件_eCAM高速激光加工软件
  4. 图像检索:几类基于内容的图像分类技术
  5. Stanford UFLDL教程 线性解码器
  6. APK加壳【3】通用内存加载dex方案分析
  7. c++ 动态分配数组_C/C++编程笔记:「C语言指针」民间解读版本
  8. java中exception_Java中的异常 Exceptions
  9. 力扣401.二进制手表
  10. Java中proc是什么意思,Java PatientProcedureVo.setSignifProc方法代码示例
  11. 关于对QQ 输入法的评价
  12. 虚幻引擎源码分析(3)
  13. 关于苹果手机页面中字体大小显示不正确的问题
  14. PB设置表格背景颜色
  15. 彻底关闭Win10自动更新(Win10企业版或专业版)
  16. 《MFQPPDCS》学习心得--TE---测试广度和深度
  17. php file_put_contents 根目录权限,关于php:file_put_contents权限被拒绝
  18. 测绘程序设计——基础篇(1)C#编写方位角计算程序篇1——用户界面的构造
  19. 电脑装双系统有什么坏处?可不只是速度变慢!
  20. 数电课设数字钟设计(基于quartus)

热门文章

  1. 2023年南京理工大学外国语学院英语笔译上岸经验
  2. 阿里云轻量服务器 外网卡_学生专属云 阿里云服务器仅需¥9.5/月
  3. Ubuntu/Kali 更新源
  4. 牛客专访ChatGPT:2023校园招聘如何做?附校招趋势
  5. 人脸识别SDK调用与分析
  6. 【python 字母索引】找到英文句子里面每个单词最后一个字母的索引
  7. 携程笔试题:订单查询
  8. python sched_python中的crontab ————sched标准库 | 学步园
  9. OpenJudge 1.3-1 A+B问题
  10. dialog弹出时,点击dialog之外的地方时,dialog不消失。