2009-08-18 11:27:05     U-Boot environment variables, SPI flash

Document created by Aaronwu Employee on Sep 24, 2013
Version 1Show Document
  • View in full screen mode

2009-08-18 11:27:05     U-Boot environment variables, SPI flash

Ben Matthews (UNITED STATES)

Message: 79001   

 

Somewhere between version 2008R1.5 and the latest git version, u-boot has lost the ability to save it's environment variables on the BlackStamp family. I'm trying to get one of the newer RevH boards with a M25P128 flash working and having some problems. It looks like the U-boot object code has outgrown the space originally allocated for it when we wrote the board configuration file. I've tried changing the offset where the environment data starts but I'm seeing some different (incorrect) behavior depending on where I put it. Using the values in the latest code checked out from git running the "save" command causes the board to stop booting (I assume because it overwrites the last few hundred bytes of u-boot). If I Increase the offset enough so that it should no longer overlap with the u-boot object code, "save" no longer breaks booting, but it doesn't seem do do anything either. If I further increase the value to the next sector boundary (0x80000) save again prevents the board from booting after a power cycle. If I increase the value by one more byte, save goes back to doing (apparently) nothing. Changing the environment size doesn't seem to have an effect.

 

 

 

Long story short, both the values in the latest official version and these values prevent the board from booting after a restart:

 

#define CONFIG_ENV_IS_IN_SPI_FLASH

#define CONFIG_ENV_OFFSET       0x80000

#define CONFIG_ENV_SIZE         0x40000

#define CONFIG_ENV_SECT_SIZE    0x40000

 

 

These values don't break break booting, but don't cause the settings to be retained:

 

#define CONFIG_ENV_IS_IN_SPI_FLASH

#define CONFIG_ENV_OFFSET       0x80001

#define CONFIG_ENV_SIZE         0x2000

#define CONFIG_ENV_SECT_SIZE    0x40000

 

 

I must be missing something obvious here, what is it?

 

 

 

Thanks

QuoteReplyEditDelete

 

 

2009-08-18 13:30:54     Re: U-Boot environment variables, SPI flash

Ben Matthews (UNITED STATES)

Message: 79008   

 

Also, I want to add that the documentation is out of date in a couple places (at least for u-boot-2009.06)

 

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:serial-flash

 

mentions CONFIG_SF_DEFAULT_HZ, but the symbol that seems to be in use is CONFIG_SF_DEFAULT_SPEED

 

And If i want to load u-boot over jtag/gdb with the GnICE then I also have to do a add-symbol-file u-boot (starting address) before I can do the call to memset as specified here: http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:debugging#jtag_loading (granted, my toolchain is a month or two old, but I don't think anything relevant has changed)

 

I also find that I can't get u-boot to overwrite its self using sf, but that could very well be user error:

 

tftp 0x1000000 u-boot.bin

 

sf probe 2

 

sf erase 0 0x40000

 

sf write 0x1000000 0 0x40000

 

(board doesn't reboot)

QuoteReplyEditDelete

 

 

2009-08-18 19:24:07     Re: U-Boot environment variables, SPI flash

Mike Frysinger (UNITED STATES)

Message: 79013   

 

the documentation is kept to reflect current release on purpose (2008R1.5)

 

i'll update it for 2009R1 soon

QuoteReplyEditDelete

 

 

2009-08-19 10:51:40     Re: U-Boot environment variables, SPI flash

Ben Matthews (UNITED STATES)

Message: 79059   

 

That makes sense, I guess I had thought that 2009R1 was out already since the newest development versions claim to be from 2009-R2-pre. Any thoughts on why the flash isn't working in newer versions? Some of the newer features in the 2009.* versions (dhcp in particular) would make deployment easier.

QuoteReplyEditDelete

 

 

2009-10-13 08:48:55     Re: U-Boot environment variables, SPI flash

Mike Frysinger (UNITED STATES)

Message: 81141   

 

you were probably hitting this bug:

http://blackfin.uclinux.org/gf/project/u-boot/forum/?_forum_action=ForumMessageBrowse&thread_id=35355&action=ForumBrowse

 

which is fixed in svn trunk now

Attachments

    Outcomes