cancel
Showing results for 
Search instead for 
Did you mean: 

Using CUI-commands

Posted on May 26, 2009 at 12:40

Using CUI-commands

1 REPLY 1
Posted on May 17, 2011 at 09:58

I've got a problem in using the CUI-commands.

I want to write a half-word into flash-bank0 (@00400000) from the firmware running in flash-bank1 (@00000000).

Therefore I use the following function:

void EEPROM_Write( u32 DestAddress, u16 Value )

{

define TIMEOUT2 0xFFFFFF

u32 Time_Out = 0;

*(vu16 *)( DestAddress & 0xFFFFFFFE ) = 0x40; // Write a program command

*(vu16 *)DestAddress = Value; // Write the halfword

*(vu16 *)( 0x00400000L ) = 0x70; // read status register

while( ( !( ( *(vu16 *)0x00400000L ) & 0x80 ) ) && ( Time_Out < TIMEOUT2 ) ) // Wait until operation compeletion

{

Time_Out++;

}

printf( ''\r\n%X'', Time_Out );

*(vu16 *)0x00400000L = 0xFF; // Write a read array command

}

But nothing happens!

Nothing is written in flashbank0 and the timeout-check runs to the end (FFFFFFh).

I checked the status register but the value is the value written

into flashbank0 @0x00400000L.

So, what's wrong. It seemed to be so easy, but I'm desperate.

Can anybody help me?

Thanks a lot.

PETER

mailto:null

null

http://null

mailto:peter.huettenberger@wipotec.com