fw_printenv and fw_setenv from Userspace

      fw_printenv and fw_setenv from Userspace

      Hi,

      I compiled uboot for efusA9 from fsimx6-V3.1. Then I copied fw_printenv and fw_setenv to /sbin in the rootfs of my image.
      When I perform cat /proc/mtd

      Source Code

      1. ​dev: size erasesize name
      2. mtd0: 00040000 00020000 "NBoot"
      3. mtd1: 000c0000 00020000 "UserDef"
      4. mtd2: 00040000 00020000 "Refresh"
      5. mtd3: 000c0000 00020000 "UBoot"
      6. mtd4: 00040000 00020000 "UBootEnv"
      7. mtd5: 00800000 00020000 "Kernel"
      8. mtd6: 001c0000 00020000 "FDT"
      9. mtd7: 0f400000 00020000 "TargetFS"


      I wrote to /etc/fw_env.config only one line to access the uboot environment variables

      Source Code

      1. ​/dev/mtd4 0x00000 0x20000


      when I try to write a variable in uboot from user space using --> "fw_setenv test 1" and when --> "fw_printenv test" then it shows that the variable is correctly written into the NAND flash.

      However when I reboot and try to look into the variable on the uboot console, I can not find it when "printenv test" ???

      Please what is the correct values that I should write in /etc/fw_env.config, I feel that the values I have are not correct.

      Thanks
      The correct settings would be:

      Source Code

      1. /dev/mtd4 0x0000 0x4000 0x20000 0x2


      This translates to:
      The environment is at offset 0 in MTD partition mtd4, the environment size is 16 KB, the block size (smallest entity that can be erased) is 0x20000 bytes (=128KB) and the environment partition is 2 blocks in size, i.e. 256KB.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

      New

      This is one of our next tasks to go to a newer U-Boot version. Porting is not easy, we have done significant additions and modifications to U-Boot, so simply using a newer U-Boot version will not work. It requires porting all our features to the newer version.

      The reason why we stayed with 2014.07 for so long is that this was the last version that did *not* use Kconfig. Since 2014.10, the whole configuration in U-Boot is a mess. If they would have moved the whole configuration to Kconfig, then this would be OK. But there are still a lot of settings in the header file under include/configs *and* they have introduced device trees for U-Boot. So there are three places where the settings are distributed: .config, include/configs/*.h and device tree. We always hoped that this confusing mess would be solved some day, but not up to now.

      Can you tell me why you want or even need 2016.07?

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

      New

      Thanks again!
      I was actually trying to use an over the air updater called Mender on the efusA9 platform. The updater has yocto layer called meta-mender. I tried to integrate it with your new release of yocto [meta-fus (ver 0.6)], which actually took quite time but it worked at final. It would be much easier to use U-boot 2016 when integrating. Mender updater has some patches to the u-boot which adds its own environment variables to it to allow the update and roll back feature. As you mentioned Kconfig is replaced by Makefile.autoconf in newly u-boot versions, which required to remodify the patches and modify them locally in meta-mender to fit u-boot 2014 from efus.

      I think it will be easier in the integration process when u-boot 2016 is used and I thought you might have a new version from u-boot which may come out soon and we can use it. Besides the current u-boot version is getting older and a new version is preferable :)

      I may have a little sugesstion that it would be actually great to provide something like this mender updater when launching new release of yocto for all the efus boards. It is actually adds high value to the board and allows many for performing a way to update the controllers remotely.

      kind regards,