2010-05-20 14:22:25     problem in setting env variables

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

2010-05-20 14:22:25     problem in setting env variables

anoob CS (INDIA)

Message: 89599   

 

I am using bf561 coustomboard having flash of 64MB (S29GL512P), It has 512 sectors.One sector is  20000000-2001FFFF.

 

I am using jtag,vdsp for loading ubootimage to flash (file uboot.ldr.hex    intel hex format). This is taking nearly 99.2% of 1st sector. when i powerofff and on the board u boot is working fine. if i "setenv" no problem, but if i saveenv, the uboot will never work at next boot.

 

 

 

I think env varibles are written to 1st sector. ie erasing 1st sector, then loading enesettings remove uboot from flash.

 

 

 

What i have to do to save enevaribles without loosing uboot?

 

Thanks

 

Anoob C S

QuoteReplyEditDelete

 

 

2010-05-20 15:07:58     Re: problem in setting env variables

Robin Getz (UNITED STATES)

Message: 89601   

 

Anoob:

 

As soon as you say VDSP - everyone here stops reading.

 

Buy a gnICE, Use gdbproxy.

 

-Robin

QuoteReplyEditDelete

 

 

2010-05-20 16:18:02     Re: problem in setting env variables

Mike Frysinger (UNITED STATES)

Message: 89603   

 

post your actual env board settings and the output of `bfin-elf-ldr -qs u-boot.ldr`

 

QuoteReplyEditDelete

 

 

2010-05-22 14:17:45     Re: problem in setting env variables

anoob CS (INDIA)

Message: 89687   

 

This is my board.h -> env settings

/*

* Flash Settings

*/

 

#define CONFIG_SYS_FLASH_CFI        1

#define CONFIG_FLASH_CFI_DRIVER        1

#define CONFIG_SYS_FLASH_CFI_AMD_RESET

#define CONFIG_SYS_FLASH_BASE        0x20000000

#define CONFIG_SYS_MAX_FLASH_BANKS    1

#define CONFIG_SYS_MAX_FLASH_SECT    512

/* The BF561-NPLTSBF201561 uses a top boot flash */

#define CONFIG_ENV_IS_IN_FLASH    1

#define CONFIG_ENV_ADDR        0x20004000

#define CONFIG_ENV_OFFSET    (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)

#define CONFIG_ENV_SIZE        0x4000

#define CONFIG_ENV_SECT_SIZE    0x20000

/**************************************************/

 

In this case env varibles was written to sector 1(that is sector where uboot is there) (uboot will not work on restart)

 

I changed the code as follow

#define CONFIG_ENV_ADDR        0x20020000

 

Now over wrighting problem is not there (u boot is working at next restart)

 

/*****************************/

 

but i am not able to save env settings

output of hyperterminal is shown below

 

 

Environment size: 1062/16380 bytes

bfin> setenv ipaddr 192.192.192.192

bfin> setenv serverip 192.192.192.200

bfin> setenv netmask 255.255.255.0

bfin> saveenv

Saving Environment to Flash...

Un-Protected 1 sectors

Erasing Flash...

. done

Erased 1 sectors

 

 

but at next bootint env varibles are not changed

 

then i tried as below

 

 

 

bfin> setenv ipaddr 192.192.192.192

bfin> setenv serverip 192.192.192.200

bfin> setenv netmask 255.255.255.0

 

bfin> protect off all

Un-Protect Flash Bank # 1

bfin> erase 20020000 2003ffff

 

. done

Erased 1 sectors

bfin> saveenv

Saving Environment to Flash...

Un-Protected 1 sectors

Erasing Flash...

. done

Erased 1 sectors

Writing to Flash... Flash not Erased

Protected 1 sectors

bfin>

 

/*at next booting the env varibles are not changing*/

QuoteReplyEditDelete

 

 

2010-05-22 14:20:35     Re: problem in setting env variables

anoob CS (INDIA)

Message: 89688   

 

The u-boot.ldr file attached with it

 

 

 

thanks

 

u-boot.ldr

QuoteReplyEditDelete

 

 

2010-05-22 22:51:34     Re: problem in setting env variables

Mike Frysinger (UNITED STATES)

Message: 89691   

 

you need to read the existing board examples.  if you attempt to use a LDR and embedded env and dont define CONFIG_ENV_IS_EMBEDDED_IN_LDR, then things are going to break.

 

although, i dont know why you're using LDR bootmode in the first place on a BF561 when bypass works fine.

QuoteReplyEditDelete

 

 

2010-05-24 15:36:00     Re: problem in setting env variables

anoob CS (INDIA)

Message: 89806   

 

I defined it (CONFIG_ENV_IS_EMBEDDED) in board.h.

 

After that i compared the board.h file with similar files

 

and the same problem is comming .(Writing to Flash... Flash not Erased)

 

/******************************************/

 

bfin> protect off all

Un-Protect Flash Bank # 1

bfin> erase 20020000 2003ffff

 

. done

Erased 1 sectors

bfin> saveenv

Saving Environment to Flash...

Un-Protected 1 sectors

Erasing Flash...

. done

Erased 1 sectors

Writing to Flash... Flash not Erased

Protected 1 sectors

 

/******************************************/

 

 

 

What to do to solve this problem ?

QuoteReplyEditDelete

 

 

2010-05-24 15:39:08     Re: problem in setting env variables

Mike Frysinger (UNITED STATES)

Message: 89808   

 

read my message again.  the define i quoted is not what you quoted.

 

your env settings also need to match your flash (sector size / embedded / sector offset / env size / etc...).  read the toplevel README for details on those.

Attachments

Outcomes