AnsweredAssumed Answered

How can ı load a new dtb file

Question asked by dogan ugurlu on Mar 20, 2019
Latest reply on Apr 1, 2019 by Diego Adrian Cuevas

Hello everyone,

 

I want to change my dtb file on u-boot screen. Firstly ı loaded new dtb file with xmodem. 

 

loadx ${fdt_addr} ${fdt_file} 

fdt addr 0x18000000

 

This commands works. I can see the new dtb on u-boot console screen with fdt print. But ı couldn't save MMC dev 1 the new dtb file. How can ı do it? Here is my command for write MMC dev 1.

 

mmc dev ${mmcdev}; mmc rescan; setexpr blkc ${filesize} / 0x200; setexpr blkc ${blkc} + 1; if itest ${blkc} <= ${fdt_size}; then mmc write ${loadaddr} ${fdt_start} ${blkc};fi

 

Output is  "Error: card is write protected!" 

 

Here is my environment variables:

 

=> printenv
addcma=setenv bootargs ${bootargs} cma=${cma_size}
addfb=setenv bootargs ${bootargs} consoleblank=0 video=mxcfb0:dev=ldb,LDB-XGA,if=RGB24
addip=if test "${ipmode}" != static; then run addip_dynamic; else run addip_static; fi
addip_dynamic=setenv bootargs ${bootargs} ip=dhcp
addip_static=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
addmmc=setenv bootargs ${bootargs} root=/dev/mmcblk0p${mmcpart} ${rootfsmode} rootwait
addnfs=setenv bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${rootpath},v3,tcp;
addtty=setenv bootargs ${bootargs} console=${console},${baudrate} quiet vt.global_cursor_default=0
baudrate=115200
board=tqma6
board_name=TQMa6Q
boardtype=TQMa6Q-AA.0202
boot_dev=mmc
boot_type=bootz
bootcmd=run mmcboot; run netboot; run panicboot
bootdelay=3
cma_size=256M
console=ttymxc1
ethact=FEC
ethaddr=00:d0:93:37:dd:bf
ethprime=FEC
fbdepth=32
fbdrv=imxdrm
fdt_addr=0x18000000
fdt_file=imx6q-mba6x.dtb
fdt_high=0xffffffff
fdt_name=if test "${fdt_type}" != single; then setenv fdtimg ${fitfdt_file}; else setenv fdtimg ${fdt_file}; fi
fdt_size=0x800
fdt_start=0x1000
fdt_type=single
fitfdt_file=imx6q-mba6x.dtb.fit
fitfdt_part=fdt@0
get_fdt=run fdt_name; if test "${fdt_type}" != single; then echo use dtb from fit; if ${getcmd} ${loadaddr} ${fdtimg}; then imxtract ${loadaddr} ${fitfdt_part}${fdt_addr}; fi; else echo use dtb; ${getcmd} ${fdt_addr} ${fdtimg}; fi; setenv fdtimg
initrd_high=0xffffffff
ipmode=static
kernel_name=if test "${boot_type}" != bootz; then setenv kernel ${uimage}; else setenv kernel ${zimage}; fi
kernel_size=0x2000
kernel_start=0x2000
loadaddr=0x12000000
loadfdt=if test "${fdt_type}" != single; then run loadfdtfit; else run loadfdtsingle; fi
loadfdtfit=mmc dev ${mmcdev}; mmc read ${loadaddr} ${fdt_start} ${fdt_size}; imxtract ${loadaddr} ${fitfdt_part} ${fdt_addr}
loadfdtsingle=mmc dev ${mmcdev}; mmc read ${fdt_addr} ${fdt_start} ${fdt_size};
loadimage=mmc dev ${mmcdev}; mmc read ${loadaddr} ${kernel_start} ${kernel_size};
mmcargs=run addmmc addtty addfb addcma
mmcblkdev=1
mmcboot=echo Booting from mmc ...; setenv bootargs; run mmcargs; if run loadfdt; then echo boot device tree kernel ...; if run loadimage; then ${boot_type} ${loadaddr} - ${fdt_addr}; fi; else if run loadimage; then ${boot_type}; fi; fi;
mmcdev=1
mmcpart=3
netargs=run addnfs addip addtty addfb addcma
netboot=echo Booting from net ...; run kernel_name; run set_getcmd; setenv bootargs; run netargs; if run get_fdt; then if ${getcmd} ${loadaddr} ${kernel}; then ${boot_type} ${loadaddr} - ${fdt_addr}; fi; fi; echo ... failed
netdev=eth0
panicboot=echo No boot device !!! reset
rootfsmode=ro
rootpath=/srv/nfs/tqma6
serial#=23000529
set_getcmd=if test "${ipmode}" != static; then setenv getcmd dhcp; setenv autoload yes; else setenv getcmd tftp; setenv autoload no; fi
stderr=serial
stdin=serial
stdout=serial
uboot=u-boot.imx
uboot_size=0x7fe
uboot_start=0x2
uimage=uImage
update_fdt=run fdt_name; if tftp ${fdtimg}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; setexpr blkc ${filesize} / 0x200; setexpr blkc ${blkc} + 1; if itest ${blkc} <= ${fdt_size}; then mmc write ${loadaddr} ${fdt_start} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc
update_kernel=run kernel_name; if tftp ${kernel}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; setexpr blkc ${filesize} / 0x200; setexpr blkc ${blkc} + 1; if itest ${blkc} <= ${kernel_size}; then mmc write ${loadaddr} ${kernel_start} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc
update_uboot=if tftp ${uboot}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; setexpr blkc ${filesize} / 0x200; setexpr blkc ${blkc} + 1; if itest ${blkc} <= ${uboot_size}; then mmc write ${loadaddr} ${uboot_start} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc
usbethaddr=00:d0:93:35:ac:db
zimage=zImage

Environment size: 4027/8188 bytes

Outcomes