[#6499] saveenv only works one time after boot with M25P128

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

[#6499] saveenv only works one time after boot with M25P128

Submitted By: Timur Aydin

Open Date

2011-02-25 05:24:47    

Priority:

Medium     Assignee:

Mike Frysinger

Category:

Commands     Fixed In Release:

N/A

Found In Release:

2010R1     Status:

Open

Board:

Custom     Processor:

BF537

Silicon Revision:

0.3     Resolution:

N/A

Is the bug repeatable?:

yes     

Summary: saveenv only works one time after boot with M25P128

Details:

 

I am booting u-boot from a 128Mbit SPI EEPROM. The sector size on this part is 256KBytes. The first sector holds u-boot itself and the second sector holds the environment variables. I didn't embed the environment into u-boot.

 

Here are the environment related defines:

 

#define CONFIG_ENV_OFFSET    0x40000

#define CONFIG_ENV_SIZE        0x10000

#define CONFIG_ENV_SECT_SIZE    0x40000

 

Now after u-boot completes the boot, the environment sector is blank. I do a saveenv and it works. But if I do a second saveenv, that second one doesn't work. I have added debug logs into the code and have determined that the failure occurs in the the saveenv() function in env_sf.c That function tries to allocate memory for 0x40000 - 0x10000 = 0x30000 bytes. This succeeds for the first saveenv invocation, but fails for the second one. I have confirmed that the memory is free'd after the first invocation. So there seems to be an issue with either malloc/free or the heap related settings.

 

Follow-ups

No Messages Were Found

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes