2009-05-26 03:40 AM
2011-05-17 12:58 AM
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. PETERmailto:null
nullmailto:peter.huettenberger@wipotec.com