I think that the offset of the environment in the image did not match. The ‘Warning’ message appears only on first µSD boot. After ‘saveenv’ command and ‘reset’/second boot with µSD these message did not appear. So it seams that the environment is now written in right place on µSD. After that i boot with eMMC only which may be also did not have the environment in right place?
I try to diff the µSD with the original image and look for the environments…
concerning the date in the ‘U-Boot 2014.04-rc1’ line, is that not the last build date? and if you don’t make a ‘make clean’ and/or there are no changes in the branch so the date did not change or i’m wrong?
I did the diff now. As you can see in the build images (mkt…) is no environment. Only on the µSD dump. Here i boot from µSD and save the environment via saveenv to µSD.
I comper the files from my build (from your git repo) and Frank’s build with the µSD dump
the environment is saved to emmc defaultly,maybe we need to modify some uboot configurations,to
make the environment to save to sd card,I will have a try.
I came to u-boot-mt,choose to SD,here is the menu
after choose to SD,the autoconf.h changed like this:
then I build the uboot,but I met some compile errors,still trying to solve this,or I don’t know is there any other way to save enviroments to SD?
I was thinking the same thing, it would be interesting to be able to load the image onto the emmc, and then When it boots it could run an overlay file system on the SD card.
I want to achieve saving environments to where them boot from,like booting from sd,then save environments to sd,booting from emmc,then save environments to emmc;
R2 Bsp judges where it boot from by macro CONFIG_SYS_MMC_ENV_DEV,but this macro is configured by menuconfig,I wondered whether I could get the state of boot switch to achieve this.
OK, I got it,the SD card priority is higher than emmc,So if the device get two mem devs,it means SD card plug in,then we save envs to sd card,I will have a try.
No, If u-boot behave like that, users may be in trouble when they change a sd-card.
There is no Fundamental change between saveing emmc or sd card “Defaultly”. In this case, Why don’t just compile two version of u-boot with different configuration, one flash to emmc, the other one flash to sd card, both hard-code the location to u-boot environment.
Is there more elegant way to do that? Is there a register(or memory) of MTK that contain value tell you where u-boot boot from. For example, when u-boot boot from emmc, the value is true, else it’s false.
Hello weiqi_chen:
thanks for your advice,I had tried to compile sd version that could save envs to sd,but I met many errors,and I think make one BIOS that can judge where it boot from will be more convenient.
Actually I have posted this , bsp judge where it boot from by macro CONFIG_SYS_MMC_ENV_DEV,but this macro is configured by menuconfig.
I really would like to know the value of where it boot from. I will check more infos.