关于PCDuino开发板考古

Mar 15, 2022

生产自13年现以停产只能国内定制的上古板子

PCDuino3 nano 俗称 穷人版树莓派,光影助手.支持多个外置接口.且内带音视频解码.官方系统最后更新 2014 年,且Lubuntu官方源早已死绝..想要编写设备驱动只能靠github源码 编译相关系统,进行linux-header的编译..

开发环境为Ubuntu 18.04(开始使用wsl.发现无法模拟sysipc部分.这是个坑.绕过去..).

官方github下载地址:https://github.com/pcduino/a20-kernel

sudo apt-get install build-essential git u-boot-tools texinfo texlive ccache zlib1g-dev gawk bison flex gettext uuid-dev lib32z

踩坑

安装默认交叉编译工具

sudo  apt-get install g++-arm-linux-gnueabihf

下方代码是因为默认安装的 gcc版本较高.库文件名不一样.所以强制给7.                 https://s3.amazonaws.com/pcduino/Tools/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.bz2                                                       官方链接挂掉了.后边用的4.9

cp /home/roots/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc.h /home/roots/a20-kernel/u-boot-sunxi/include/linux/compiler-gcc7.h



wget https://s3.amazonaws.com/pcduino/Tools/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.bz2

tar -xvf gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.bz2

export PATH=$PATH:<your gcc-linaro-arm-linux-gnueabihf-4.7 path>/bin

sudo apt-get install libc6:i386 libstdc++6:i386 libncurses5:i386 zlib1g:i386
sudo apt-get install libncurses5-dev libncursesw5-dev device-tree-compiler u-boot-tools


wget http://ftp.gnu.org/gnu/gawk/gawk-3.1.6.tar.bz2
tar -xvf gawk-3.1.6.tar.bz2
cd gawk-3.1.6
./configure
make
sudo make install


然后 你就会发现一个让你恶心到吐的提示

arch/arm/cpu/armv7/sunxi/board.o:在函数‘__raw_writesb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80: `__raw_writesb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80:第一次在此定义
arch/arm/cpu/armv7/sunxi/board.o:在函数‘__raw_writesw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88: `__raw_writesw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88:第一次在此定义
arch/arm/cpu/armv7/sunxi/board.o:在函数‘__raw_writesl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98: `__raw_writesl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98:第一次在此定义
arch/arm/cpu/armv7/sunxi/board.o:在函数‘__raw_readsb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103: `__raw_readsb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103:第一次在此定义
arch/arm/cpu/armv7/sunxi/board.o:在函数‘__raw_readsw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110: `__raw_readsw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110:第一次在此定义
arch/arm/cpu/armv7/sunxi/board.o:在函数‘__raw_readsl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119: `__raw_readsl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock.o:在函数‘__raw_writesb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80: `__raw_writesb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock.o:在函数‘__raw_writesw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88: `__raw_writesw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock.o:在函数‘__raw_writesl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98: `__raw_writesl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock.o:在函数‘__raw_readsb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103: `__raw_readsb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock.o:在函数‘__raw_readsw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110: `__raw_readsw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock.o:在函数‘__raw_readsl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119: `__raw_readsl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119:第一次在此定义
arch/arm/cpu/armv7/sunxi/pinmux.o:在函数‘__raw_writesb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80: `__raw_writesb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80:第一次在此定义
arch/arm/cpu/armv7/sunxi/pinmux.o:在函数‘__raw_writesw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88: `__raw_writesw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88:第一次在此定义
arch/arm/cpu/armv7/sunxi/pinmux.o:在函数‘__raw_writesl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98: `__raw_writesl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98:第一次在此定义
arch/arm/cpu/armv7/sunxi/pinmux.o:在函数‘__raw_readsb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103: `__raw_readsb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103:第一次在此定义
arch/arm/cpu/armv7/sunxi/pinmux.o:在函数‘__raw_readsw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110: `__raw_readsw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110:第一次在此定义
arch/arm/cpu/armv7/sunxi/pinmux.o:在函数‘__raw_readsl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119: `__raw_readsl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119:第一次在此定义
arch/arm/cpu/armv7/sunxi/watchdog.o:在函数‘__raw_writesb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80: `__raw_writesb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80:第一次在此定义
arch/arm/cpu/armv7/sunxi/watchdog.o:在函数‘__raw_writesw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88: `__raw_writesw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88:第一次在此定义
arch/arm/cpu/armv7/sunxi/watchdog.o:在函数‘__raw_writesl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98: `__raw_writesl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98:第一次在此定义
arch/arm/cpu/armv7/sunxi/watchdog.o:在函数‘__raw_readsb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103: `__raw_readsb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103:第一次在此定义
arch/arm/cpu/armv7/sunxi/watchdog.o:在函数‘__raw_readsw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110: `__raw_readsw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110:第一次在此定义
arch/arm/cpu/armv7/sunxi/watchdog.o:在函数‘__raw_readsl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119: `__raw_readsl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock_sun4i.o:在函数‘__raw_writesb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80: `__raw_writesb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock_sun4i.o:在函数‘__raw_writesw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88: `__raw_writesw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock_sun4i.o:在函数‘__raw_writesl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98: `__raw_writesl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock_sun4i.o:在函数‘__raw_readsb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103: `__raw_readsb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock_sun4i.o:在函数‘__raw_readsw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110: `__raw_readsw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110:第一次在此定义
arch/arm/cpu/armv7/sunxi/clock_sun4i.o:在函数‘__raw_readsl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119: `__raw_readsl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119:第一次在此定义
arch/arm/cpu/armv7/sunxi/cpu_info.o:在函数‘__raw_writesb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80: `__raw_writesb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:80:第一次在此定义
arch/arm/cpu/armv7/sunxi/cpu_info.o:在函数‘__raw_writesw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88: `__raw_writesw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:88:第一次在此定义
arch/arm/cpu/armv7/sunxi/cpu_info.o:在函数‘__raw_writesl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98: `__raw_writesl'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:98:第一次在此定义
arch/arm/cpu/armv7/sunxi/cpu_info.o:在函数‘__raw_readsb’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103: `__raw_readsb'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:103:第一次在此定义
arch/arm/cpu/armv7/sunxi/cpu_info.o:在函数‘__raw_readsw’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110: `__raw_readsw'被多次定义
arch/arm/cpu/armv7/sunxi/timer.o:/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:110:第一次在此定义
arch/arm/cpu/armv7/sunxi/cpu_info.o:在函数‘__raw_readsl’中:
/home/roots/a20-kernel/u-boot-sunxi/arch/arm/include/asm/io.h:119: `__raw_readsl'被多次定义

这里就没啥好办法了,只能遇见啥修啥了..修的人都傻了.放弃了..后来发现是编译内核的编译器有要求..降低编译器版本.

进入正轨

安装低版本的编译工具

https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/arm-linux-gnueabihf/
解压文件,并创建调用链接

tar -xvf gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf.tar

vim /etc/profile

export PATH=$PATH:/root/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/lib

source /etc/profile

进去make..卧槽,怎么还是错误...不慌补个库
apt install pkg-config
apt install libusb-1.0
基本已经编译没问题了..踩坑人都麻了..告诉我们一件事,先他妈看开发文档.开发文档..环境要统一..不然修文件修的人都麻了..