1. sunxi-tools
2. u-boot
3. linux
4. rootfs(buildroot)
5. package
离线
1. sunxi-tools
mkdir /opt/a33 -p
git clone https://github.com/linux-sunxi/sunxi-tools
cd sunxi-tools
make
离线
2. u-boot
git clone https://github.com/linux-sunxi/u-boot-sunxi u-boot-sunxi
#或者
git clone https://gitlab.denx.de/u-boot/u-boot.git u-boot-sunxi
cd u-boot-sunxi
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make Sinlinx_SinA33_defconfig
#或者
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make A33-OLinuXino_defconfig
#编译:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make
/opt/a33/sunxi-tools/sunxi-fel uboot u-boot-sunxi-with-spl.bin
最近编辑记录 流氓兔 (2020-02-02 21:19:27)
离线
#
# USB peripherals
#
CONFIG_USB_STORAGE=y
CONFIG_USB_KEYBOARD=y
# CONFIG_SYS_USB_EVENT_POLL is not set
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
# CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP is not set
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Allwinner Technology"
CONFIG_USB_GADGET_VENDOR_NUM=0x1f3a
CONFIG_USB_GADGET_PRODUCT_NUM=0x1010
# CONFIG_USB_GADGET_ATMEL_USBA is not set
# CONFIG_USB_GADGET_BCM_UDC_OTG_PHY is not set
# CONFIG_USB_GADGET_DWC2_OTG is not set
# CONFIG_CI_UDC is not set
CONFIG_USB_GADGET_VBUS_DRAW=2
CONFIG_USB_GADGET_DUALSPEED=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_FUNCTION_MASS_STORAGE=y
# CONFIG_USB_FUNCTION_ROCKUSB is not set
# CONFIG_USB_FUNCTION_SDP is not set
# CONFIG_USB_FUNCTION_THOR is not set
CONFIG_USB_ETHER=y
# CONFIG_USB_ETH_CDC is not set
CONFIG_USB_ETH_RNDIS=y
CONFIG_USBNET_DEVADDR="de:ad:be:ef:00:01"
CONFIG_USBNET_HOST_ADDR="de:ad:be:ef:00:00"
# CONFIG_USB_HOST_ETHER is not set
新版 u-boot 驱动越来越多了, 居然携带了这么多的usb驱动,就是还没学会怎么使用.
离线
sunxi-fel启动u-boot, 用fatls 显示 TF 卡文件正常:
=> fatls mmc 0:1
lost.dir/
android/
555152547 6a.mp4
205590075 ardurino.mp4
但是把这个 u-boot 烧录到 TF卡, 启动不正常:
U-Boot SPL 2019.01-rc3-g829407b58f-dirty (Feb 02 2020 - 21:32:54 +0800)
DRAM: 256 MiB
Trying to boot from MMC1
MMC: no card present
spl: mmc init failed with error: -123
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
看起来这个u-boot默认去找 emmc(MMC1), 而不是 TF卡(MMC0) ?
离线
真折腾, spl 识别到了 TF 卡, 但是 u-boot 却没有识别到 TF 卡.
离线
修改 arch/arm/dts/sun8i-a33-sinlinx-sina33.dts 搞定, 可能是 TF 卡检测引脚和我的板子并不匹配吧.
重新编译 u-boot:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make
直接运行:
/opt/a33/sunxi-tools/sunxi-fel uboot u-boot-sunxi-with-spl.bin
烧录到TF卡:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
离线
克隆编译Linux:
#克隆
git clone https://github.com/torvalds/linux
cd linux
#配置
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make sunxi_defconfig
#编译
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j3
下面这两个就是你需要的文件了:
arch/arm/boot/zImage
arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dtb
离线
u-boot 手动加载命令:
fatload mmc 0:1 0x46000000 zImage
fatload mmc 0:1 0x49000000 sun8i-a33-sinlinx-sina33.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=10
bootz 0x46000000 - 0x49000000
离线
建立 boot.cmd 文件:
fatload mmc 0:1 0x46000000 zImage
fatload mmc 0:1 0x49000000 sun8i-a33-sinlinx-sina33.dtb
setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=10
bootz 0x46000000 - 0x49000000
mkimage -C none -A arm -T script -d boot.cmd boot.scr
然后把 boot.scr, zImage, sun8i-a33-sinlinx-sina33.dtb 三个文件
一起拷贝到 TF 卡第一个分区, 这样就不用手动敲命令了.
离线