Re: MTD UBI undefined reference failed to build OE gatesgarth branch
Hello, The mtd build was fine, what could be missing not to link mtd? $ ls 2020.04-r0/build/mx6ull_14x14_evk_nand_config/drivers/mtd built-in.o mtdcore.su mtdpart.o mtd_uboot.o mtd-uclass.o nand spi mtdcore.o mtd.o mtdpart.su mtd_uboot.su mtd-uclass.su onenand ubi On 1/15/21, Jupiter wrote: > Hello, > > I was able to build MTD, UBI and u-boot on OE version Zeus branch, but > failed in gatesgarth branch. Here are errors, what could I be missing? > > u-boot-imx/2020.04-r0/git/cmd/ubi.c:478: undefined reference to > `mtd_probe_devices' > u-boot-imx/2020.04-r0/git/cmd/ubi.c:484: undefined reference to > `put_mtd_device' > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/build.c:1161: undefined > reference to `put_mtd_device' > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/build.c:1229: undefined > reference to `get_mtd_device_nm' > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/io.c:1407: undefined > reference to `mtd_read' > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/io.c:279: undefined > reference to `mtd_write' > > u-boot-imx/2020.04-r0/git/drivers/video/cfb_console.c:2025: undefined > reference to `video_hw_init' > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:51: undefined > reference to `dm_spi_claim_bus' > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:55: undefined > reference to `dm_spi_xfer' > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:58: undefined > reference to `dm_spi_release_bus' > u-boot-imx/2020.04-r0/git/Makefile:1701: recipe for target 'u-boot' failed > make[1]: *** [u-boot] Error 1 > WARNING: exit code 1 from a shell command. > > There are a couple of warning messages I am not sure if they are > important or just nonsense, like CONFIG_DEFAULT_DEVICE_TREE has > already been defined but it complained: > > Device Tree Source is not correctly specified. > Please define 'CONFIG_DEFAULT_DEVICE_TREE' > or build with 'DEVICE_TREE=' argument > > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:51:8: warning: > implicit declaration of function 'dm_spi_claim_bus'; did you mean > 'spi_claim_bus'? [-Wimplicit-function-declaration] >51 | ret = dm_spi_claim_bus(dev); > |^~~~ > |spi_claim_bus > @ > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:55:8: warning: > implicit declaration of function 'dm_spi_xfer'; did you mean > 'spi_xfer'? [-Wimplicit-function-declaration] >55 | ret = dm_spi_xfer(dev, priv->nregs * 8, priv->buffer, NULL, > |^~~ > |spi_xfer > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:58:2: warning: > implicit declaration of function 'dm_spi_release_bus'; did you mean > 'spi_release_bus'? [-Wimplicit-function-declaration] >58 | dm_spi_release_bus(dev); > | ^~ > | spi_release_bus > > Appreciate your advice. > > Thank you very much. > > Kind regards, > > - jupiter > -- "A man can fail many times, but he isn't a failure until he begins to blame somebody else." -- John Burroughs
Re: [meta-freescale] MTD UBI undefined reference failed to build OE gatesgarth branch
Thanks for your response. I am sorry, I thought that is what meta-freescale for, right? NXP might involve the coding, but is it integrated and released by Yocto / OE https://git.yoctoproject.org/cgit/cgit.cgi/meta-freescale/, right? I cloned meta-freescale from Yocto project: git://git.yoctoproject.org/meta-freescale, I am sorry, I really lost.
MTD UBI undefined reference failed to build OE gatesgarth branch
Hi Tom and Lauren, I failed to build mx6ull with MTD and UBI in OE and meta-freescahe gatesgarth branch, please be aware that I was able to build it in zeus branch, it seems something broken in gatesgarth branch. My apology I am not clear if it is the issue for MTD or u-boot or meta-freescale or OE so that I posted messages to several mailing lists for help. Andrey Zhizhikin was very unhappy about it, he believes it is your responsibility. Could you please kindly respond if it is your jurisdiction and if you tested and passed mx6ull with MTD UBI in gatesgarth branch or not? My apology again for crossing mailing lists. Kind regards, - jupiter On 1/16/21, Andrey Zhizhikin wrote: > Hello Jupiter, > > On Fri, Jan 15, 2021 at 8:32 PM JH wrote: >> >> Hello, >> >> The mtd build was fine, what could be missing not to link mtd? >> >> $ ls 2020.04-r0/build/mx6ull_14x14_evk_nand_config/drivers/mtd > > From all the build logs you have, it look to me that you're trying to > build the U-Boot delivered by NXP as a part of their BSP release. > > In this case, I suggest you'd rather contact NXP support in order to > address this failure, since it is a vendor BSP you're trying to > upgrade. > > In addition, I do not think that all mailing lists you've cross-posted > your question to would be able to help you here: > - linux-mtd list is not really appropriate to solve U-Boot build issues; > - u-boot list is for upstream U-Boot patches and discussions, which is > way past over 2020.04 version (not even considering that you're > building U-Boot from NXP fork); > - oe-core is not a proper list to post questions specific to one SOC > vendor; > - meta-freescale 'gatesgarth' branch does not have any U-Boot build > configuration for mx6ull_14x14_evk_nand_config, the only available > build config provided is for sd card; > > Having all those points above, I'd suggest you contact NXP support at > first to see if they can solve those build errors for you. > > If you would find a solution, you can send a PR to meta-freescale to > address it - this would be much appreciated. > >> >> built-in.o mtdcore.su mtdpart.o mtd_uboot.o mtd-uclass.o nand >> spi >> mtdcore.o mtd.o mtdpart.su mtd_uboot.su mtd-uclass.su onenand >> ubi >> >> >> >> On 1/15/21, Jupiter wrote: >> > Hello, >> > >> > I was able to build MTD, UBI and u-boot on OE version Zeus branch, but >> > failed in gatesgarth branch. Here are errors, what could I be missing? >> > >> > u-boot-imx/2020.04-r0/git/cmd/ubi.c:478: undefined reference to >> > `mtd_probe_devices' >> > u-boot-imx/2020.04-r0/git/cmd/ubi.c:484: undefined reference to >> > `put_mtd_device' >> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/build.c:1161: undefined >> > reference to `put_mtd_device' >> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/build.c:1229: undefined >> > reference to `get_mtd_device_nm' >> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/io.c:1407: undefined >> > reference to `mtd_read' >> > u-boot-imx/2020.04-r0/git/drivers/mtd/ubi/io.c:279: undefined >> > reference to `mtd_write' >> > >> > u-boot-imx/2020.04-r0/git/drivers/video/cfb_console.c:2025: undefined >> > reference to `video_hw_init' >> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:51: undefined >> > reference to `dm_spi_claim_bus' >> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:55: undefined >> > reference to `dm_spi_xfer' >> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:58: undefined >> > reference to `dm_spi_release_bus' >> > u-boot-imx/2020.04-r0/git/Makefile:1701: recipe for target 'u-boot' >> > failed >> > make[1]: *** [u-boot] Error 1 >> > WARNING: exit code 1 from a shell command. >> > >> > There are a couple of warning messages I am not sure if they are >> > important or just nonsense, like CONFIG_DEFAULT_DEVICE_TREE has >> > already been defined but it complained: >> > >> > Device Tree Source is not correctly specified. >> > Please define 'CONFIG_DEFAULT_DEVICE_TREE' >> > or build with 'DEVICE_TREE=' argument >> > >> > u-boot-imx/2020.04-r0/git/drivers/gpio/74x164_gpio.c:51:8: warning: >> > implicit declaration of function 'dm_spi_claim_bus'; did you mean >> > 'spi_claim_bus'? [-Wimplicit-function-declaration] >> >51 | ret = dm_spi_claim_bus(dev); >> > |^
Re: [yocto] Which recipe for Linux tools to run u-boot command inside Linux?
OK, finally built the u-boot-fw-utils and run it on iMX6ULL: # fw_printenv -v Compiled with U-Boot 2019.07-dirty But it could not run: # fw_printenv Cannot read bad block mark: Invalid argument Here is the configure file: # cat /etc/fw_env.config # NAND /dev/mtd1 0x400x100x28 I think values in configure file are correct: # cat /proc/mtd dev:size erasesize name mtd0: 0040 0002 "boot" mtd1: 0010 0002 "ubootenv" mtd2: 0fb0 0002 "storage" => nand info Device 0: nand0, sector size 128 KiB Page size 2048 b OOB size 64 b Erase size131072 b subpagesize 2048 b options 0x40004200 bbt options 0x Any advice what I could be missing? Thank you. Kind regards, - jh On 5/1/20, JH via lists.yoctoproject.org wrote: > On 4/30/20, Nicolas Jeker wrote: > >> on Zeus it's very likely _not_ libubootenv that you need, you should >> try to install u-boot-fw-utils. As Yann wrote, the tools are in >> libubootenv since Dunfell, which is newer than Zeus. > > Thanks Nicolas, I have following error, what I could be missing here? > > ERROR: Task > (/build/oe-core/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.07.bb:do_compile) > failed with exit code '137' > > > > -- > "A man can fail many times, but he isn't a failure until he begins to > blame somebody else." > -- John Burroughs > -- "A man can fail many times, but he isn't a failure until he begins to blame somebody else." -- John Burroughs
What is the right way to run fw_setenv for selecting different ECC or dtb files?
Hi, To flash u-boot to iMX6ULL NAND, it requires using higher bits ECC (my imx6ulz_kobs.dtb) to run kobs-ng in ramdisk, but to flash rootfs image to NAND in ramdisk, I have to change to use lower ECC (my imx6ulz.dtb). I followed the advice at link https://developer.toradex.com/knowledge-base/u-boot-fw-utils to run "fw_setenv fdt_file imx6ulz_kobs.dtb" before flashing u-boot to NAND, although the fw_setenv command worked, the u-boot wasn't installed properly in NAND, I could not boot from NAND. What is the right way to run fw_setenv for changing different ECC or different dtb files? Thank you. Kind regards, - jh -- "A man can fail many times, but he isn't a failure until he begins to blame somebody else." -- John Burroughs
Re: What is the right way to run fw_setenv for selecting different ECC or dtb files?
Could anyone please advise how to set up dtb? In running uuu, I can set up "SDP: write -f imx6ulz-kobs.dtb -addr 0x9000", but how can I change to different dtb calling fw_setenv? Thank you and appreciate it. Kind regards, - jh On 5/3/20, Jupiter wrote: > Hi, > > To flash u-boot to iMX6ULL NAND, it requires using higher bits ECC (my > imx6ulz_kobs.dtb) to run kobs-ng in ramdisk, but to flash rootfs image > to NAND in ramdisk, I have to change to use lower ECC (my > imx6ulz.dtb). > > I followed the advice at link > https://developer.toradex.com/knowledge-base/u-boot-fw-utils to run > "fw_setenv fdt_file imx6ulz_kobs.dtb" before flashing u-boot to NAND, > although the fw_setenv command worked, the u-boot wasn't installed > properly in NAND, I could not boot from NAND. > > What is the right way to run fw_setenv for changing different ECC or > different dtb files? > > Thank you. > > Kind regards, > > - jh > > -- > "A man can fail many times, but he isn't a failure until he begins to > blame somebody else." > -- John Burroughs > -- "A man can fail many times, but he isn't a failure until he begins to blame somebody else." -- John Burroughs
Issue with 'ubi part' ubi_io_read: error -74 (ECC error)
Sorry for a bit recalcitrant with the issue of calling 'ubi part" error -74 -EBADMSG, is it MTD issue or u-boot issue? I used Linux kernel 4.19 to flash UBIFS volume images ubi.img to imx6ull NAND using following command in Linux: flash_erase /dev/mtd2 0 0 ubiformat /dev/mtd2 -f ubi.img The flashing image process went well, not errors, but in NAND booting (u-boot version 2018), running "ubi part" stuck following errors: ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2 35:0, read 64 bytes ubi0 error: ubi_io_read: error -74 (ECC error) while reading 2048 bytes from PEB 235:2048, read 2048 bytes The document says "The -74 error code is -EBADMSG and means an ECC error. In other words, UBI tried to read some data from the flash, but the flash driver found that there is an uncorrectable ECC error, and returned -EBADMSG." My question for ubiformat, how does it write ECC to UBIFS volume partition when it flashed UBIFS image to NAND? In NAND booting, how does the "ubi part" read ECC (DTB) from? Thank you very much, appreciate your kind advice. - j -- "A man can fail many times, but he isn't a failure until he begins to blame somebody else." -- John Burroughs
Re: Issue with 'ubi part' ubi_io_read: error -74 (ECC error)
Thanks Richard for the response. On 5/19/20, Richard Weinberger wrote: > Neither UBI nor UBIFS care about ECC. The MTD stack does. > If you write something in Linux you cannot read back in u-boot a common > problem is that u-boot and Linux use different MTD settings (layout, > ECC, etc...). That is exactly the problem I have, the MTD layout in both Linux and u-boot is the same: # mtdinfo Count of MTD devices: 3 Present MTD devices:mtd0, mtd1, mtd2 Sysfs interface supported: yes Are there any ways or tools in Linux to change MTD settings (most likely the ECC or DTB) to the same setting in u-boot? I do have mtd and fw_setenv in Linux. Thank you so much. Kind regards, - jh -- "A man can fail many times, but he isn't a failure until he begins to blame somebody else." -- John Burroughs
Re: Issue with 'ubi part' ubi_io_read: error -74 (ECC error)
Hi Heiko, Thanks for your response. On 5/22/20, Heiko Schocher wrote: >> Are there any ways or tools in Linux to change MTD settings (most >> likely the ECC or DTB) to the same setting in u-boot? I do have mtd >> and fw_setenv in Linux. > > No for U-Boot (as I am aware of). You need to fix the DTS or may if > older U-Boot your code. > > May you need to add in your U-Boot DTS gpmi node the property: > > fsl,legacy-bch-geometry; I tried but that did not work, it is equivalent to remove fsl,use-minimum-ecc in gpmi node I used to run ubiformat to flash UBIFS image to NAND: # flash_erase /dev/mtd2 0 0 # ubiformat /dev/mtd2 -f /tmp/ubi.img That caused the NAND boot error to run "ubi part" ubi_io_read: error -74 (ECC error). Richard shed light on the problem that u-boot and Linux use different MTD settings, I figured out it is the ECC problem, while adding fsl,use-minimum-ecc in gpmi node cannot even start NAND boot. Why fsl,use-minimum-ecc in gpmi node causing such predicament? Thank you. Kind regards, - jh