UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
2,871 Views
Registered: ‎04-23-2013

u-boot saveenv problem

I followed the instructions as per http://www.wiki.xilinx.com/Build+U-Boot to build u-boot for our ML605 board with an FPGA configured for a Little Endian Microblaze 8.40.b and everything seems to work fine.  I've managed to boot linux from a tftp server using the command line interface. 

Currently I have the bitstream with the SREC bootloader being loaded from platform flash which is loading the u-boot stored at the beginning of the linear flash.

The next step is to store the environment but when I issue a 'saveenv' I end up having to reflash the bitstream and the linear flash.  I connected up the debugger and stepped through the saveenv function and can see that it is trying to erase 0xa2000000 - 0xa201ffff which seems rather large for an environment and will erase the u-boot stored there.  I'm assuming there is a problem with my u-boot configuration, CONFIG_ENV_OFFSET or CONFIG_ENV_SIZE??

 

(gdb) n
286        if (flash_sect_erase((long)flash_addr, end_addr))
2: /x end_addr = 0xa201ffff
3: flash_addr = (env_t * const) 0xa2000000

 

The version of u-boot is at the latest version of your git reposistory.  I'm also using v14.6 of the Xilinx tools.

 

Any help is greatly appreciated, Many Thanks,

Martin.

0 Kudos
1 Reply
2,857 Views
Registered: ‎04-23-2013

Re: u-boot saveenv problem

After reading through the code some more I can see that it expects the U-Boot environment to be located in the first 128KB sector of the linear flash so I changed my first stage bootloader to load U-Boot from 0xA2020000 and then reflash U-Boot into this new location. I then booted up U-Boot and changed the environment a bit and saved it and although the platform flash still fails to load the FPGA/FSBL when I restore it, it loads U-Boot with the saved environment. So I just need to know why it's corrupted the platform flash now.
0 Kudos