T3评估板操作记录

目录

vmware ubuntu和host windows 共享目录

应用层代码编译

SDK解压

依赖工具安装

配置

编译SDK

应用层代码编译

应用层代码编译--连接动态库

应用代码实战

alsa编程

连接访问

网口

参考资料:


vmware ubuntu和host windows 共享目录

1. ubuntu vmware共享目录,再ubuntu下查看为空

解决:

1) root用户 vmhgfs-fuse .host:/ubuntu /mnt/hgfs
2) /etc/fstab中增加

.host:/        /mnt/hgfs      fuse.vmhgfs-fuse   allow_other      0      0

应用层代码编译

SDK解压

将  t3\2\LinuxSDK\LinuxSDK_14_23_15_14.tar.gz  拷贝到 1中共享目录中,然后到ubuntu中进行解压,耗时大概5分钟

解压步骤:

1) mkdir -p /home/tronlong/T3

2) 解压:


root@ubuntu:/mnt/hgfs/ubuntu/t3# tar -zxf LinuxSDK_14_23_15_14.tar.gz -C /home/tronlong/T3/
root@ubuntu:/mnt/hgfs/ubuntu/t3# cd /home/tronlong/T3/
root@ubuntu:/home/tronlong/T3# ls
lichee
root@ubuntu:/home/tronlong/T3# cd lichee/
root@ubuntu:/home/tronlong/T3/lichee# ls
brandy  buildroot-201611  build.sh  comp_qtLib-590_only.sh  install-tools.sh  linux-3.10  tools

如果直接在共享目录解压,最后会报错误: tar: Exiting with failure status due to previous errors

依赖工具安装

./install-tools.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.17.1-1ubuntu0.12).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
gnupg is already the newest version (2.2.4-1ubuntu1.6).
gnupg set to manually installed.
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
flex is already the newest version (2.6.4-6).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
bison is already the newest version (2:3.0.4.dfsg-1build1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
gperf is already the newest version (3.1-1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
zip is already the newest version (3.0-11build1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version (7.58.0-2ubuntu3.19).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version (2.27-3ubuntu1.6).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libc6-dev:i386 libgpm2:i386 libncurses5:i386 linux-libc-dev:i386
Suggested packages:
  glibc-doc:i386 gpm:i386 ncurses-doc:i386
The following NEW packages will be installed:
  libc6-dev:i386 libgpm2:i386 libncurses5:i386 libncurses5-dev:i386 linux-libc-dev:i386
0 upgraded, 5 newly installed, 0 to remove and 85 not upgraded.
Need to get 3,545 kB of archives.
After this operation, 21.2 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 libncurses5 i386 6.1-1ubuntu1.18.04 [101 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 linux-libc-dev i386 4.15.0-191.202 [985 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 libc6-dev i386 2.27-3ubuntu1.6 [2,258 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main i386 libgpm2 i386 1.20.7-5 [15.8 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 libncurses5-dev i386 6.1-1ubuntu1.18.04 [186 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 libncurses5-dev i386 6.1-1ubuntu1.18.04 [186 kB]
Fetched 3,361 kB in 2min 38s (21.2 kB/s)
Selecting previously unselected package libncurses5:i386.
(Reading database ... 285337 files and directories currently installed.)
Preparing to unpack .../libncurses5_6.1-1ubuntu1.18.04_i386.deb ...
Unpacking libncurses5:i386 (6.1-1ubuntu1.18.04) ...
Selecting previously unselected package linux-libc-dev:i386.
Preparing to unpack .../linux-libc-dev_4.15.0-191.202_i386.deb ...
Unpacking linux-libc-dev:i386 (4.15.0-191.202) ...
Selecting previously unselected package libc6-dev:i386.
Preparing to unpack .../libc6-dev_2.27-3ubuntu1.6_i386.deb ...
Unpacking libc6-dev:i386 (2.27-3ubuntu1.6) ...
Selecting previously unselected package libgpm2:i386.
Preparing to unpack .../libgpm2_1.20.7-5_i386.deb ...
Unpacking libgpm2:i386 (1.20.7-5) ...
Selecting previously unselected package libncurses5-dev:i386.
Preparing to unpack .../libncurses5-dev_6.1-1ubuntu1.18.04_i386.deb ...
Unpacking libncurses5-dev:i386 (6.1-1ubuntu1.18.04) ...
Setting up libncurses5:i386 (6.1-1ubuntu1.18.04) ...
Setting up libgpm2:i386 (1.20.7-5) ...
Setting up linux-libc-dev:i386 (4.15.0-191.202) ...
Setting up libc6-dev:i386 (2.27-3ubuntu1.6) ...
Setting up libncurses5-dev:i386 (6.1-1ubuntu1.18.04) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
x11proto-core-dev is already the newest version (2018.4-4).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libx11-dev:i386 is already the newest version (2:1.6.4-3ubuntu0.4).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libreadline-dev:i386' instead of 'libreadline6-dev:i386'
libreadline-dev:i386 is already the newest version (7.0-3).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgl1-mesa-glx:i386 is already the newest version (20.0.8-0ubuntu1~18.04.1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgl1-mesa-dev is already the newest version (20.0.8-0ubuntu1~18.04.1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++-multilib is already the newest version (4:7.4.0-1ubuntu2.3).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mingw32
Reading package lists... Done
Building dependency tree
Reading state information... Done
tofrodos is already the newest version (1.7.13+ds-3).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-markdown is already the newest version (2.6.9-1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2-utils is already the newest version (2.9.4+dfsg1-6.1ubuntu1.7).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
xsltproc is already the newest version (1.1.29-5ubuntu0.2).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  zlib1g-dev:i386
0 upgraded, 1 newly installed, 0 to remove and 85 not upgraded.
Need to get 178 kB of archives.
After this operation, 449 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main i386 zlib1g-dev i386 1:1.2.11.dfsg-0ubuntu2.1 [178 kB]
Fetched 178 kB in 6s (30.5 kB/s)
Selecting previously unselected package zlib1g-dev:i386.
(Reading database ... 285763 files and directories currently installed.)
Preparing to unpack .../zlib1g-dev_1%3a1.2.11.dfsg-0ubuntu2.1_i386.deb ...
Unpacking zlib1g-dev:i386 (1:1.2.11.dfsg-0ubuntu2.1) ...
Setting up zlib1g-dev:i386 (1:1.2.11.dfsg-0ubuntu2.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
gawk is already the newest version (1:4.1.4+dfsg-1build1).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
texinfo is already the newest version (6.5.0.dfsg.1-2).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
u-boot-tools is already the newest version (2020.10+dfsg-1ubuntu0~18.04.2).
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-121-generic linux-hwe-5.4-headers-5.4.0-110 linux-hwe-5.4-headers-5.4.0-113 linux-hwe-5.4-headers-5.4.0-120
  linux-hwe-5.4-headers-5.4.0-121 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-121-generic linux-modules-5.4.0-121-generic
  linux-modules-extra-5.4.0-121-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
ln: failed to create symbolic link '/usr/lib/i386-linux-gnu/libGL.so': File exists
ln: failed to create symbolic link '/usr/include/xlocale.h': File exists
 

配置

./build.sh config

Welcome to mkscript setup progress
All available chips:
   0. sun8iw11p1
Choice: 0
All available platforms:
   0. linux
Choice: 0
All available kernel:
   0. linux-3.10
Choice: 0
All available boards:
   0. t3-mp1
   1. t3-p1
   2. t3-p2
   3. t3-p3
   4. tlt3_a40i-evm
Choice: 4
All available rootfs:
  0. buildroot
  1. buildroot-201611
  2. debian_fs
Choice: 1
select buildroot-201611
All available float:
  0. gnueabi
  1. gnueabihf
Choice: 1
select gnueabihf
All available qt version:
  0. 5.9.0
  1. 5.9.7
Choice: 0
select 5.9.0
All available output configs:
   0. hdmi
   1. vga
   2. lvds_lcd
   3. mipi_lcd
   4. tft_lcd
Choice: 1
All available output configs:
   0. t3
   1. a40i
Choice: 0
create misc_config gnueabihf
 

编译SDK

1)make distclean

2) 配置文件
root@ubuntu:/home/tronlong/T3/lichee/linux-3.10# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun8iw11p1smp_defconfig
make: arm-linux-gnueabihf-gcc: Command not found
 

正确的命令

 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-(带空格) sun8iw11p1smp_defconfig
drivers/net/wireless/bcmdhd/Kconfig:53:warning: defaults for choice values not supported
#
# configuration written to .config
#

arm-linux-gnueabihf-  是工具链的名称

3) 编译

root@ubuntu:/home/tronlong/T3/lichee# ./build.sh
build buidroot-201611...
xgnueabihf
sun8iw11p1_hf_defconfig
INFO: ----------------------------------------
INFO: build lichee ...
INFO: chip: sun8iw11p1
INFO: platform: linux
INFO: kernel: linux-3.10
INFO: board: tlt3_a40i-evm
INFO: output: out/sun8iw11p1/linux/tlt3_a40i-evm
INFO: ----------------------------------------
INFO: build buildroot ...
 

总共耗时 4个小时,编译了内核 及一堆应用,应用都是从网络上直接download的。


rootdir=/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/target
table='/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/build/_device_table.txt'
tune2fs 1.43.3 (04-Sep-2016)
tune2fs 1.43.3 (04-Sep-2016)

Please run e2fsck -f on the filesystem.

Creating journal inode: done
This filesystem will be automatically checked every 20 mounts or
0 days, whichever comes first.  Use tune2fs -c or -i to override.

mke2img: e2fsck was successfully run on '/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/images/rootfs.ext2' (ext4)

tune2fs 1.43.3 (04-Sep-2016)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
/usr/bin/install -m 0644 support/misc/target-dir-warning.txt /home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
ln -sf rootfs.ext2 /home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/images/rootfs.ext4
make: Leaving directory '/home/tronlong/T3/lichee/buildroot-201611'
INFO: build rootfs OK.
INFO: ----------------------------------------
INFO: build lichee OK.
INFO: ----------------------------------------
no SATA

应用层代码编译


SDK编译完成后,其中一个编译成功即工具链,位于目录:

/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/host/usr/bin$ ls

此时我们编译应用

CC=/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/host/usr/bin/arm-linux-gnueabihf-gcc make

应用层代码编译--连接动态库

  /home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/host/usr/bin/arm-linux-gnueabihf-gcc play.c  -L/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/target/usr/lib -lasound -o play

动态库的路径如上。只是头文件引用的哪里的?无需要指定。

 /home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/host/usr/bin/arm-linux-gnueabihf-gcc play_record.c  -L/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/target/usr/lib -lasound -o play_record_arm



  /home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/host/usr/bin/arm-linux-gnueabihf-gcc info.c  -L/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/target/usr/lib -lasound -o info_arm



/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/host/usr/bin/arm-linux-gnueabihf-gcc play.c  -L/home/tronlong/T3/lichee/out/sun8iw11p1/linux/common/buildroot/target/usr/lib -lasound -o play_arm

应用代码实战

alsa编程

单板上的录放设备信息:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sun8iw11codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sndhdmi [sndhdmi], device 0: SUNXI-HDMIAUDIO sndhdmi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

==================录音设备=====================
root@T3/A40i-Tronlong:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: audiocodec [audiocodec], device 0: SUNXI-CODEC sun8iw11codec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 如下代码,打开设备,设置为播放流,这里当第二个参数设置为“default时”,会报如下错误:

./play
ALSA lib pcm_hw.c:1788:(_snd_pcm_hw_open) Unknown field slave
unable to open pcm device: Invalid argument

 将设备名称改成plughw:0,0后 则功能正常。

  /* Open PCM device for playback.  "default" */
  rc = snd_pcm_open(&handle, "plughw:0,0" ,
                    SND_PCM_STREAM_PLAYBACK, 0);
  if (rc < 0) {
    fprintf(stderr,
            "unable to open pcm device: %s\n",
            snd_strerror(rc));
    exit(1);
  }
./play < /dev/urandom

The random data should produce white noise for five seconds.

Next, try redirecting the input to /dev/null or /dev/zero 

连接访问

网口

笔记本直接连接RGMII网口,然后ifconfig eth0 配置IP,就可以通。

SSH

提示login as:  填写root即可

参考资料:

linux系统使用手册---主要介绍SDK等的编译

linux应用开发手册---主要介绍应用的编译,依赖SDK的编译结果

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

proware

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值