Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
314 views
in Technique[技术] by (71.8m points)

linux - Error in UBoot "Saving Environment to MMC... Writing to MMC(0)... failed Failed (1)"

I am booting with Uboot a Open Industrial Linux in a TQMLS1028A. When I do some changes in linux and I reboot, all the configurations and files are delete.

I use the command saveenv in Uboot and this error appears

Saving Environment to MMC... Writing to MMC(0)... failed
Failed (1)

This is the output of printenv


U-Boot SPL 2018.03 (Dec 23 2020 - 02:20:50 +0100)
Initialzing DDR using fixed setting
Configuring DDR for 1600 MT/s data rate
Trying to boot from MMC1


U-Boot 2018.03 (Dec 23 2020 - 02:20:50 +0100)

SoC:  LS1028AE Rev1.0 (0x870b0010)
Clock Configuration:
       CPU0(A72):1300 MHz  CPU1(A72):1300 MHz  
       Bus:      400  MHz  DDR:      1600 MT/s
Reset Configuration Word (RCW):
       00000000: 34004010 00000030 00000000 00000000
       00000010: 00000000 008e0000 0030c000 00000000
       00000020: 00a03150 00002580 00000000 00008096
       00000030: 00000000 00000010 00000000 00000000
       00000040: 00000000 00000000 00000000 00000000
       00000050: 00000000 00000000 00000000 00000000
       00000060: 00000000 00000000 000e7000 00000000
       00000070: eb580000 03000000
Model: TQMLS1028A on MBLS1028A
Board: MBLS1028A Booting from: SD
I2C:   ready
DRAM:  958 MiB (DDR4, 32-bit, CL=11, ECC on)
FSL_SDHC: 0, FSL_SDHC: 1
PPA Firmware: Version ebbd1ea
Using SERDES1 Protocol: 60248 (0xeb58)
PCIe0: pcie@3400000 disabled
PCIe1: pcie@3500000 Root Complex: no link
MMC:   Loading Environment from MMC... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   serial
Err:   serial
TQMLS1028A EEPROM:
  ID: TQMLS1028A-P1.103
  SN: 72927904
  MAC: 00:d0:93:4a:77:f6
Net:   phy path: /pcie@1f0000000/netc_mdio/phy@3
phy path: /pcie@1f0000000/netc_mdio/phy@0
eth0: enetc#0, eth1: enetc#1 [PRIME], eth2: enetc#2, eth3: netc_mdio
Warning: enetc#3 (eth4) using random MAC address - 9a:4c:cd:b3:63:4e
, eth4: enetc#3
trying to set up RGMII
trying to set up QSGMII for SERDES x5xx!!!!
Hit any key to stop autoboot:  3  0 
=> printenv
addemmc=setenv bootargs ${bootargs} root=/dev/mmcblk1p2 rootfstype=ext4
addsd=setenv bootargs ${bootargs} root=/dev/mmcblk0p2 rootfstype=ext4
addspi=setenv bootargs ${bootargs} root=ubi0_0 rw rootfstype=ubifs ubi.mtd=7
addtty=setenv bootargs ${bootargs} console=ttyS0,115200
addvideo=setenv bootargs ${bootargs} cma=256M video=1920x1080-32@60
arch=arm
baudrate=115200
board=tqmls1028a_mbls1028a
board_name=tqmls1028a
boardinit=run resetusb; run resetphy;
boot=SD
bootargs=console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x2000000 default_hugepagesz=2m hugepagesz=2m hugepages=256
bootcmd=run sdboot; run emmcboot; run spiboot; run panicboot
bootdelay=3
cpu=armv8
emmcargs=run addemmc addtty addvideo
emmcboot=echo Booting from emmc ...; setenv bootargs; run emmcargs; run emmchdpload; run emmcimageload; run emmcfdtload;run setmacaddr;run boardinit;booti ${loadaddr} - ${fdtaddr}
emmcfdtload=fatload mmc 1:1 ${fdtaddr} ${fdt_file};
emmchdpload=fatload mmc 1:1 ${loadaddr} ls1028a-dp-fw.bin; hdp load ${loadaddr};
emmcimageload=fatload mmc 1:1 ${fdtaddr} Image.gz; unzip $fdtaddr $loadaddr
eth1addr=00:d0:93:4a:77:f7
eth2addr=00:d0:93:4a:77:f8
eth3addr=00:d0:93:4a:77:f9
ethact=enetc#1
ethaddr=00:d0:93:4a:77:f6
ethprime=enetc#1
fdt_file=fsl-ls1028a-mbls1028a.dtb
fdtaddr=0x88000000
fdtcontroladdr=bba199d0
firmwarepart=1
gpio_expander_1_addr=0x25
gpio_expander_2_addr=0x70
gpio_expander_i2c_bus=5
hwconfig=fsl_ddr:bank_intlv=auto
kernel_file=Image.gz
loadaddr=0x82000000
mmcdev=1
mmcsddev=0
panicboot=echo No boot device !!! reset
rcw_emmc_file=rcw_1300_emmc.bin
rcw_max_size=1024
rcw_qspi_file=rcw_1300_spi_nor.bin
rcw_sd_file=rcw_1300_sd.bin
rcw_sd_offset=0x8
resetphy=i2c dev ${gpio_expander_i2c_bus}; i2c mw ${gpio_expander_2_addr} 0x3 0xd5; i2c mw ${gpio_expander_2_addr} 0x1 0xd5; sleep 0.1; i2c mw ${gpio_expander_2_addr} 0x1 0xff;
resetusb=i2c dev ${gpio_expander_i2c_bus}; i2c mw ${gpio_expander_1_addr} 0x6.1 0xfd; i2c mw ${gpio_expander_1_addr} 0x2.1 0xfd; sleep 0.1; i2c mw ${gpio_expander_1_addr} 0x2.1 0xff;
rootfs_mtddev=RootFS
sdargs=run addsd addtty addvideo
sdboot=echo Booting from sd card ...; setenv bootargs; run sdargs; run sdhdpload; run sdimageload; run sdfdtload;run setmacaddr;run boardinit;booti ${loadaddr} - ${fdtaddr}
sdfdtload=fatload mmc 0:1 ${fdtaddr} ${fdt_file};
sdhdpload=fatload mmc 0:1 ${loadaddr} ls1028a-dp-fw.bin; hdp load ${loadaddr};
sdimageload=fatload mmc 0:1 ${fdtaddr} Image.gz; unzip $fdtaddr $loadaddr
set_getcmd=if test "${ipmode}" != static; then setenv getcmd dhcp; setenv autoload yes; else setenv getcmd tftp; setenv autoload no; fi
setmacaddr=fdt addr ${fdtaddr}; fdt resize 4;fdt set /soc/pcie@1f0000000/pci@0,5/port@0/ mac-address ${switch_mac_addr};
soc=fsl-layerscape
spiargs=run addspi addtty addvideo
spiboot=echo Booting from SPI NOR flash...; setenv bootargs; run spiargs; run spihdpload spikernelload spifdtload ; run setmacaddr;run boardinit;booti ${loadaddr} - ${fdtaddr};
spifdtload=sf probe 0; sf read ${fdtaddr} DTB
spihdpload=sf probe; sf read ${loadaddr} HDP; hdp load ${loadaddr};
spikernelload=sf probe 0; sf read ${fdtaddr} Linux; unzip ${fdtaddr} ${loadaddr}
stderr=serial
stdin=serial
stdout=serial
switch_mac_addr=[00 d0 93 4a 77 fb]
uboot_emmc_file=u-boot-with-spl_emmc.bin
uboot_max_size=0x300000
uboot_qspi_file=u-boot-with-spl_qspi.bin
uboot_sd_file=u-boot-with-spl_sdcard.bin
uboot_sd_offset=0x800
update_fdt_emmc=run set_getcmd; if ${getcmd} ${fdt_file}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; echo Write fdt image to mmc ${mmcdev}:${firmwarepart}...; save mmc ${mmcdev}:${firmwarepart} ${loadaddr} ${fdt_file} ${filesize}; fi; fi; setenv filesize; setenv getcmd 
update_fdt_qspi=run set_getcmd; if ${getcmd} ${fdt_file}; then if itest ${filesize} > 0; then sf probe; sf update ${loadaddr} DTB ${filesize};fi; fi; setenv filesize; setenv blkc; setenv getcmd 
update_fdt_sd=run set_getcmd; if ${getcmd} ${fdt_file}; then if itest ${filesize} > 0; then mmc dev ${mmcsddev}; mmc rescan; echo Write fdt image to mmc ${mmcsddev}:${firmwarepart}...; save mmc ${mmcsddev}:${firmwarepart} ${loadaddr} ${fdt_file} ${filesize}; fi; fi; setenv filesize; setenv getcmd 
update_kernel_emmc=run set_getcmd; if ${getcmd} ${kernel_file}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; echo Write kernel image to mmc ${mmcdev}:${firmwarepart}...; save mmc ${mmcdev}:${firmwarepart} ${loadaddr} ${kernel_file} ${filesize}; fi; fi; setenv filesize; setenv getcmd 
update_kernel_qspi=run set_getcmd; if ${getcmd} ${kernel_file}; then if itest ${filesize} > 0; then sf probe; sf update ${loadaddr} Linux ${filesize};fi; fi; setenv filesize; setenv blkc; setenv getcmd 
update_kernel_sd=run set_getcmd; if ${getcmd} ${kernel_file}; then if itest ${filesize} > 0; then mmc dev ${mmcsddev}; mmc rescan; echo Write kernel image to mmc ${mmcsddev}:${firmwarepart}...; save mmc ${mmcsddev}:${firmwarepart} ${loadaddr} ${kernel_file} ${filesize}; fi; fi; setenv filesize; setenv getcmd 
update_rcw_emmc=run set_getcmd; if ${getcmd} ${rcw_emmc_file}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; setexpr blkc ${filesize} + 0x1ff; setexpr blkc ${blkc} / 0x200; if itest ${filesize} <= ${rcw_max_size}; then mmc write ${loadaddr} ${rcw_sd_offset} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc; setenv getcmd 
update_rcw_qspi=run set_getcmd; if ${getcmd} ${rcw_qspi_file}; then if itest ${filesize} > 0; then if itest ${filesize} <= ${uboot_max_size}; then sf probe; sf update ${loadaddr} RCW ${filesize};fi; fi; fi; setenv filesize; setenv blkc; setenv getcmd 
update_rcw_sd=run set_getcmd; if ${getcmd} ${rcw_sd_file}; then if itest ${filesize} > 0; then mmc dev 0; mmc rescan; setexpr blkc ${filesize} + 0x1ff; setexpr blkc ${blkc} / 0x200; if itest ${filesize} <= ${rcw_max_size}; then mmc write ${loadaddr} ${rcw_sd_offset} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc; setenv getcmd 
update_uboot_emmc=run set_getcmd; if ${getcmd} ${uboot_emmc_file}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; setexpr blkc ${filesize} + 0x1ff; setexpr blkc ${blkc} / 0x200; if itest ${filesize} <= ${uboot_max_size}; then mmc write ${loadaddr} ${uboot_sd_offset} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc; setenv getcmd 
update_uboot_qspi=run set_getcmd; if ${getcmd} ${uboot_qspi_file}; then if itest ${filesize} > 0; then if itest ${filesize} <= ${uboot_max_size}; then sf probe; sf update ${loadaddr} U-Boot-PBL ${filesize};fi; fi; fi; setenv filesize; setenv blkc; setenv getcmd 
update_uboot_sd=run set_getcmd; if ${getcmd} ${uboot_sd_file}; then if itest ${filesize} > 0; then mmc dev ${mmcsddev}; mmc rescan; setexpr blkc ${filesize} + 0x1ff; setexpr blkc ${blkc} / 0x200; if itest ${filesize} <= ${uboot_max_size}; then mmc write ${loadaddr} ${uboot_sd_offset} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc; setenv getcmd 
vendor=tqc

Environment size: 7098/524284 bytes
=> 

To create the sdcard.img of the Open Industrial Linux Distribution (https://github.com/tq-systems/OpenIL)

I do the following First execute

make tqmls1028a_mbls1028a_defconfig

This creates a .config file. I edit this file to build tcpdump and iperf3 with the image, I do this by

deleting this lines of code

# BR2_PACKAGE_IPERF3 is not set
# BR2_PACKAGE_TCPDUMP is not set

and adding this two

BR2_PACKAGE_IPERF3=y
BR2_PACKAGE_TCPDUMP=y

Then after that I run the command

make all

Then inside of the output/image folder I can find the sdcard.img. Then with this image I make the boot device with the program Rufus (https://rufus.ie/). Then the boot SDcard I put it inside of the board

question from:https://stackoverflow.com/questions/65598319/error-in-uboot-saving-environment-to-mmc-writing-to-mmc0-failed-failed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

At the end what I did is to change the Operating System of the board by a recommendation of the Technical Customer Support of TQ-Group

I use a Yocto Poky distribution that is specifically for this board

Here is the link where you can find the steps how to download it and how to buid the image

https://support.tq-group.com/en/layerscape/tqmls1028a/mbls1028a-ind/linux/yocto /quickstart_yocto


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...