如何为IMX6配置U-Boot?

发布于 2025-01-26 10:52:18 字数 1173 浏览 2 评论 0 原文

当我试图为apalis-aimx6-Quad板制作U-Boot时,列表下方显示了我的配置的详细信息:

  1. cross_compiler = aarch64-Ingnux-gnu 1.1它已经导出到路径 1.2交叉编译器的Menuconfig仍然像以前一样保留。
  2. 主机linux版本= 5.4.0-109生成#123〜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.MX6 QUAD CPU型:4X ARM Cortex™-A9 CPU-CLOCK:800MHz 浮点单位:VFPV3

When I am trying to make u-boot for apalis-aimx6-quad board, and below list is shows the details of my configuration:

  1. CROSS_COMPILER = aarch64-unknown-linux-gnu
    1.1 it already exported to path
    1.2 menuconfig of the cross compiler remains as before.
  2. Host Linux version = 5.4.0-109-generic #123~18.04.1-Ubuntu
  3. version of the cross compiler : crosstool-ng-1.25-rc2

according to the mentioned software and hardware properties, I faced with the following error when i try to make the boot-loader for my board using 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

what can be the error solution?

and the Second question is:
in the ./ct-ng list-samples what type of samples are suitable for my board?

CPU-NAME = NXP® i.MX 6Quad
CPU-TYPE : 4x Arm Cortex™-A9
CPU-CLOCK : 800MHz
FLOATING-POINT-UNIT : VFPv3

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

因为看清所以看轻 2025-02-02 10:52:18
  1. 您使用的是错误的编译器,即来自Linux PC的GCC,这就是为什么错误消息建议使用 corei7 诸如 -mtune 之类的值。选项。

  2. 这样说,因为您的apalis-aimx6-Quad Soc是 Cortex-A9 ,因此其体系结构是 armv7-a ,因此您无法使用针对目标的编译器 ARMV8-A 体系结构,例如您正在使用的 aarch64-inch64-Innux-gnu-gcc 。您应该宁愿使用 ARM-INKNOWN-LINUX-GNU-GCC ARM-NONE-NONE-AEBI-GCC 。我强烈建议使用官方的ARM工具链,例如,用于构建U-Boot,并避免使用最新的11.2版本:由于内部编译器错误,我在使用U-Boot时无法构建U-Boot。


  3. 您应该使用 cross_compile = ,而不是 cross_compiler = 在构建命令中,这就是为什么您使用系统GCC而不是Aarch64-Ingnown--用于构建U-Boot的Linux-GNU-GCC。

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

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

完成构建命令后,您应该看到U-Boot trafacts:

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
  1. You are using the wrong compiler, i.e. the gcc from your Linux PC, this is why the error message is suggesting to use values such as corei7 for the -mtune option.

  2. This being said, because your apalis-aimx6-quad SoC is a Cortex-A9,its architecture is Armv7-a and you therefore cannot use a compiler targeting the Armv8-a architecture, such as the aarch64-unknown-linux-gnu-gcc you are using. You should rather use, say, arm-unknown-linux-gnu-gcc or arm-none-eabi-gcc.I would strongly suggest to use an official Arm toolchain, such as this one (available here), for building u-boot, and to avoid using the latest 11.2 version: I have been unable to build u-boot when using it because of an internal compiler error.

  3. You should use CROSS_COMPILE=, and not CROSS_COMPILER= in your build command,and this is the reason why you were using your system gcc instead of aarch64-unknown-linux-gnu-gcc for building u-boot.

Bottom line, your build command should be something like:

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

After completion of the build command, you should see the u-boot artefacts:

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
过度放纵 2025-02-02 10:52:18

我也为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.

I also do the same thing for RPI 4 which the following command lines do:

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文