element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Avnet Boards General Microzed custom U-boot environment variables being overwritten at boot
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 365 subscribers
  • Views 266 views
  • Users 0 members are here
Related

Microzed custom U-boot environment variables being overwritten at boot

Former Member
Former Member over 11 years ago

I am trying to modify the Xilinx U-boot environment variables in order to get a Mircrozed board to boot Linaro or Arch Linux from an SD card.  The rootfs is on partition 2 of the sdcard in an ext4 FS and the default sdboot= commands will not work because of the ramdisk.  I need to be able to autoboot and not have to manually type in the commands. 

I've modifed u-boot-xlnx/include/configs/zynq_common.h with a new sdboot variable and successfully rebuilt the uboot.elf and put it into boot.bin with XSDK:
"sdboot=echo Copying Linux from SD to RAM... && mmcinfo && "
  "fatload mmc 0 0x3000000 ${kernel_image} && "
  "fatload mmc 0 0x2A00000 ${devicetree_image} && "
  "bootm 0x3000000 - 0x2A000000"


The problem is that once u-boot comes up the sdboot variable is changed to:

sdboot=echo Copying Linux from SD to RAM... && mmcinfo && run mmc_loadbit_fat && fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 0x2000000 0x2A00000

Note that the 0x2000000 is back instead of the -

I cannot find where the overwite is coming from.  I tried creating a uEnv.txt file, but it gets ignored unless I stop autoboot and type "run uenvboot" which will bring in the new sdboot variable from the text file I put in there.

If I do a "env defaults -a -" command then my custom sdboot command shows up and "run sdboot" works fine at that point.

I cannot figure out how the sdboot= variable is being replaced.

I'd be happy being able to put get the uEnv.txt file to autoboot, but it doesn't seem to get picked up either.

Anybody have an idea what is going on and how to make this work ?

Thanks,

John

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 11 years ago

    The override seemed to come from the spi flash memory.  Here's what I did to store the new environment variables.
    zynq-uboot> env default -a -
    zynq-uboot> saveenv

    on reboot the custom default variables are now back!

    So I guess saveenv is working now in the current u-boot-xlnx tree as I did a git pull before building u-boot.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube