如何为imx6配置u-boot



当我试图为apalis-aimx6-quad板进行u-boot时,下面的列表显示了我的配置细节:

  1. CROSS_COMPILER=aarch64未知linux gnu1.1已导出到路径1.2交叉编译器的菜单配置与以前一样
  2. 主机Linux版本=5.4.0-109-通用#123~18.04.1-Ubuntu
  3. 交叉编译器的版本:crosstool-ng-1.25-rc2

根据上述软件和硬件属性,当我尝试使用u-boot为我的板制作引导加载程序时,我面临以下错误:

cc1: error: bad value (‘generic-armv7-a’) for ‘-mtune=’ switch
cc1: note: valid arguments to ‘-mtune=’ switch are: nocona core2 nehalem corei7
westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell 
skylake skylake-avx512 bonnell atom silvermont slm knl intel x86-64 eden-x2
nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron 
opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3
bdver4 znver1 btver1 btver2 generic
scripts/Makefile.build:147: recipe for target 'lib/asm-offsets.s' failed
make[1]: *** [lib/asm-offsets.s] Error 1
Makefile:1965: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

什么是错误解决方案?

第二个问题是:中/ct ng列表样品什么类型的样品适合我的董事会?

CPU-NAME=NXP®i.MX 6QuadCPU-TYPE:4臂皮质™-A9CPU-CCLOCK:800MHz浮动点装置:VFPv3

  1. 您使用了错误的编译器,即Linux PC中的gcc,这就是为什么错误消息建议在-mtune选项中使用corei7等值。

  2. 也就是说,因为你的apalis-aimx6-quad SoC是Cortex-A9,它的体系结构是Armv7-a,因此你不能使用针对Armv8-a体系结构的编译器,比如你正在使用的aarch64-unknown-linux-gnu-gcc。你应该使用arm-unknown-linux-gnu-gccarm-none-eabi-gcc。我强烈建议使用官方的Arm工具链,比如这个(在这里可用)来构建u-boot,并避免使用最新的11.2版本:由于内部编译器错误,我在使用它时无法构建u-boot。

  3. 您应该在构建命令中使用CROSS_COMPILE=,而不是CROSS_COMPILER=,这就是为什么您使用系统gcc而不是aarch64未知的linux gnu gcc来构建u-boot的原因。

最重要的是,您的构建命令应该类似于:

CROSS_COMPILE=arm-none-eabi- make mrproper  apalis_imx6_defconfig all

构建命令完成后,您应该会看到u-boot工件:

ll u-boot*
-rwxrwxr-x 1 user user 4988448 May 13 07:56 u-boot*
-rw-rw-r-- 1 user user  569504 May 13 07:56 u-boot-dtb.bin
-rw-rw-r-- 1 user user  569568 May 13 07:56 u-boot-dtb.img
-rwxrwxr-x 1 user user  512920 May 13 07:56 u-boot-nodtb.bin*
-rw-rw-r-- 1 user user  639200 May 13 07:56 u-boot-with-spl.imx
-rw-rw-r-- 1 user user  569504 May 13 07:56 u-boot.bin
-rw-rw-r-- 1 user user   18081 May 13 07:55 u-boot.cfg
-rw-rw-r-- 1 user user   10858 May 13 07:55 u-boot.cfg.configs
-rw-rw-r-- 1 user user   56584 May 13 07:56 u-boot.dtb
-rw-rw-r-- 1 user user  569568 May 13 07:56 u-boot.img
-rw-rw-r-- 1 user user    1719 May 13 07:56 u-boot.lds
-rw-rw-r-- 1 user user 1100407 May 13 07:56 u-boot.map
-rwxrwxr-x 1 user user 1538914 May 13 07:56 u-boot.srec*
-rw-rw-r-- 1 user user  195657 May 13 07:56 u-boot.sym

我也对RPI 4做了与以下命令行相同的事情:

wget https://dev.iopsys.eu/fork/uboot.git
tar -xf u-boot.tar.gz
ls ./configs 
ls ./configs|grep rpi
make rpi_4_defconfig
export PATH=/home/<your user name>/x-tools/aarch64-rpi4-linux-gnu/bin/:$PATH
type aarch an hit tab if system recognize the compiler continue else 
go back and export the compiler path. 
export CROSS_COMPILE=aarch64-rpi4-linux-gnu-
make menuconfig
make
------------------------------------------------------------------------
cd ..
mkdir sdcard 
sudo cp ../u-boot/u-boot.bin .
wget    
------------------------------------------------------------------------
PREPARE MEMORY FOR BOOT
connect your memory to pc.
lsblk --> to know what is the name of the memory (assume it is sdb)
sudo umount /dev/sdb1
sudo cfdisk /dev/sdb --> erase older partitions and clear on 100M partition
-- note : type of the partition have to be fat32
once the partition is created. 
sudo mkfs.vfat /dev/sdb1
sudo mount /dev/sdb1 /mnt 
wget https://github.com/raspberrypi/firmware/raw/master/boot/start4.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-4-b.dtb
gedit config.txt
--#######################
IN THE CONFIG
enable_uart=1
kernel=u-boot.bin
arm_64bit=1
--#######################
cat config.txt
sudo cp * /mnt 
sudo umount /mnt
unconnect the memory and connect it to the target machine.

相关内容

  • 没有找到相关文章

最新更新