uboot-envtools on imx.6 issues

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

uboot-envtools on imx.6 issues

3,754 Views
dennisjohansson
Contributor I

Hi!

I try to manipulate the u-boot env-var from linux and trying to use uboot-envtools but I cant get it to work.

I have been looking at the sourcecode config in u-boot (mx6_iwg15m_q7.h), and it gives me the offset and the env size.

#define CONFIG_ENV_SECT_SIZE(8 * 1024)
#define CONFIG_ENV_SIZE     CONFIG_ENV_SECT_SIZE

#if defined(CONFIG_FSL_ENV_IN_MMC)

    #define CONFIG_ENV_IS_IN_MMC1
    #define CONFIG_ENV_OFFSET   (768 * 1024)

cat /proc/mtd gives me:

dev:size   erasesize  name

mtd0: 00010000 00008000 "bootloader"

I define my fw_env.config

/dev/mtd0   0xc0000 0x2000  0x2000

When i try to read the env. variables i get a crc error.

fw_printenv

Warning: Bad CRC, using default environment

bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm

bootdelay=5

baudrate=115200

I cant understand why it does not work :smileysad:

Any tip are welcome!

Thanks :smileyhappy:

/Dennis

0 Kudos
Reply
6 Replies

2,158 Views
EricNelson
Senior Contributor II

Hi Dennis,

If the environment is in SPI-NOR, the kernel needs a structure in the board file that expresses

how things are used.

This is the bit that's used on the Boundary Devices Nitrogen6x:

linux-imx6/arch/arm/mach-mx6/board-mx6_nitrogen6x.c at boundary-imx_3.0.35_4.1.0 · boundarydevices/l...

With it, you can use /dev/mtd0ro to read the U-Boot executable, and /dev/mtd1ro contains the U-Boot environment.

I'm not sure how/if you can re-map MMC space to an MTD device if your board is storing the environment there.

0 Kudos
Reply

2,158 Views
YixingKong
Senior Contributor IV

Dennis, our support engineer is waiting for your response now. Please take your time to do it. If your question had been resolved please let us know. We will close the discssion if no response in 3 days.

Thanks,

Yixing

0 Kudos
Reply

2,158 Views
pavelkopylov
Contributor III

Have the same problem now with congatec i.mx6 board.

fw_printenv is failing to read u-boot environment variables area with Bad crc error.

0 Kudos
Reply

2,158 Views
maheshmahadeva1
NXP Employee
NXP Employee

I cannot find a file named mx6_iwg15m_q7.h in the U-Boot source that is shipped with the MX6 BSP. Can you share with us where this file is located.

Best regards,

-Mahesh

0 Kudos
Reply

2,158 Views
dennisjohansson
Contributor I

I found out that its only the nor-flash that are exposed through in the board configuration. How can i expose the nand-flash as a MTD device?


Thanks for any tip...

0 Kudos
Reply

2,158 Views
YixingKong
Senior Contributor IV

Dennis, please respond our engineer's question. We will close the DI if no response in 3 days.

Thanks,

Yixing

0 Kudos
Reply