English
Language : 

AN1528 Datasheet, PDF (12/18 Pages) STMicroelectronics – The testflash is a ST reserved flash area that contains device information
ST92F120/F124/150/F250 TESTFLASH
Table 4. Wrong Pages Output Meaning
Reg
Bit
R22
0
R22
X
R22
7
R23
0
R23
X
R23
7
0 Meaning
Page 30h OK
Pg 30h+X OK
Page 37h OK
Page 38h OK
Pg 38h+X OK
Page 3Fh OK
1 Meaning
Page 30h Wrong
Pg 30h+X Wrong
Page 37h Wrong
Page 38h Wrong
Pg 38h+X Wrong
Page 3Fh Wrong
3.5.2 Find Wrong Bytes (23002Ch)
Inputs: R2-R3.
Outputs: R0-R1.
Variables: R192-R223 (for Stack).
Goal: to find in the specified page the bytes different from the old ones after a Swap fail.
This routine has to be called by the User application if bits FEERR of FESR0 (224002h) reg-
ister and SWER of FESR1 (224003h) register are set after an E3TM write operation. After
having executed the “Find Wrong Pages routine”, this routine can be called through a far call,
providing as input in RR2 the address of the first byte of the Page to check:
LDW RR2, #01C0h;If Page 1Ch is wrong
CALLS 23h, 002Ch ;Find Wrong Bytes
This routine performs the following operations:
■ initialize a Byte counter (from 0h to Fh);
■ read the current Byte in the new block (new data after Swap);
■ read the current Byte in the old block (old data before Swap);
■ if the new and old data differs, set the output flag corresponding to the current Byte;
■ increment the Byte counter and repeat the 3 preceding steps, untill the last Byte is reached;
The User Application should check the 2 Output variables, which are explained in the following
table:
Table 5. Wrong Bytes Output Meaning
Reg
Bit
R1
0
R1
X
R1
7
R0
0
0 Meaning
Byte 0h OK
Byte 0h+X OK
Byte 7h OK
Byte 8h OK
1 Meaning
Byte 0h Wrong
Byte 0h+X Wrong
Byte 7h Wrong
Byte 8h Wrong
12/18