[U-Boot] How to convert imximage.cfg so it can be used in mkimage?
Alexander Dahl
ada at thorsis.com
Tue Nov 19 12:30:16 UTC 2019
Hello,
Am Dienstag, 19. November 2019, 13:12:20 CET schrieb Alexander Dahl:
> > Further investigation shows that the error is caused by that there is
> > c-type comments (/*...*/) in imximage.cfg file. When I remove all the
> > c-type comments in the file, it works fine.
>
> Well, -n sets a name in the image header. I guess you have those '/*...*/'
> in your file 'overlay_img'?
At least I thought from the documentation, then I saw this when building
'riotboard_defconfig' from U-Boot 2016.11:
arm-v7a-linux-gnueabihf-gcc -E -Wp,-MD,board/boundary/
nitrogen6x/.nitrogen6s1g.cfg.cfgtmp.d -nostdinc -isystem /opt/
OSELAS.Toolchain-2016.06.1/arm-v7a-linux-g
nueabihf/gcc-5.4.0-glibc-2.23-binutils-2.26-kernel-4.6-sanitized/lib/gcc/arm-
v7a-linux-gnueabihf/5.4.0/include -Iinclude -I/home/adahl/Work/bsp/tt-
generic/platf
orm-v7a/build-target/u-boot-2016.11/include -I/home/adahl/Work/bsp/tt-
generic/platform-v7a/build-target/u-boot-2016.11/arch/arm/include -include /
home/adahl/Wor
k/bsp/tt-generic/platform-v7a/build-target/u-boot-2016.11/include/linux/
kconfig.h -D__KERNEL__ -D__UBOOT__ -D__ARM__ -marm -mno-thumb-interwork -
mabi=aapcs-linux
-mword-relocations -fno-pic -mno-unaligned-access -ffunction-sections -fdata-
sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv7-a -
D__LINUX_ARM_ARCH__=7 -x c -o board/boundary/nitrogen6x/
nitrogen6s1g.cfg.cfgtmp /home/adahl/Work/bsp/tt-generic/platform-v7a/build-
target/u-boot-2016.11/board/boundary/nitrogen6x/nitrogen6s1g.cfg
./tools/mkimage -n board/boundary/nitrogen6x/nitrogen6s1g.cfg.cfgtmp -T
imximage -e 0x17800000 -d u-boot.bin u-boot.imx
Image Type: Freescale IMX Boot Image
Image Ver: 2 (i.MX53/6/7 compatible)
Mode: DCD
Data Size: 442368 Bytes = 432.00 kB = 0.42 MB
Load Address: 177ff420
Entry Point: 17800000
Looks like -n behaves differently when called with '-T imximage'? However it
is quite clear from the first call how to get the appropriate file without C
comments: use the C preprocessor on the input file, this not only removes
those comments, but also resolves includes.
To just create that imximage though, you only have to configure U-Boot
correctly and it will drop out of the usual call to make without calling
mkimage manually.
A
More information about the U-Boot
mailing list