2009-11-25 13:43:04     BF527 with M25P128 SPI FLASH Environment saving problem

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

2009-11-25 13:43:04     BF527 with M25P128 SPI FLASH Environment saving problem


Message: 82754   


Hi we have a custom BF527 board that has been running u-boot 1.1.6 2008 R1.5 with an M25P128 (16MB with 64 x 256KB sectors) Serial Flash on the SPI interface. We had it configured to have the environment embedded at off-set 0x4000 (so right in the middle of u-boot) which was working fine.


I have just started porting to the latest release of 2009-R1 and I am having some problems with the new SPI interface with an embedded environment.


Because we are using a Flash with 256K sectors we want to put both u-boot and environment in one sector together as before. We can't afford the space to waste a whole 256K sector for the environment.

Clearly we can't put the environment at the start of the sector because this is where the blackfin bootloader boots from.


Looking at the code in env_sf.c it would appear to assume that the environment is aligned with the start of a sector, and in fact in another thread on this forum the advice was to align it at the start.


Am I correct, that the environment has to be aligned with a sector start, or is there some way to make the code and environment share a sector, when the whole lot is smaller than just 1 sector.


It looks like it might not be too hard to re-work env_sf.c to cope with the environment being in the middle of the code again, so I was wondering if anyone was already planning to do this work.








2009-11-25 15:20:33     Re: BF527 with M25P128 SPI FLASH Environment saving problem

Mike Frysinger (UNITED STATES)

Message: 82758   


i believe your findings are accurate.  the original env_sf didnt support embeddeding at all, so i added initial support for it, but currently it requires the env to be at the start of the sector.  obviously that wont fly when dealing with LDRs as you cant stick the env at the start of the flash.