D
PRE_ERR = 1?
YES
Atleast one bit in golden_data was 0
already in the flash memory.
Need to find all the such already
p r o g r a m m e d
b i t s
a n d
s e t
t h e m
t o
1
i n
g o l d e n _ d a t a .
MAX_PRG_PLS_TLV is the value
of maximum number of program
pulses needed to reliably program
a flash location. This value is stored
i n
t h e
d e v i c e
T L V
t a b l e .
.
WAIT = wait states for program verify
mode;
RD_MODE = Program Verify;
RD_MODE_
STATUS = Program
Verify?
NO
YES
foreach data to be programmed:
exist_data = Read_word from Flash;
new_data = FLCTL_PRGBRST_DATAn_x;
fail_bits = NOT(exist_data OR new_data);
updated_new_data = new_data OR fail_bits;
(OR and NOT used above are intended to
be bit wise operations.)
RD_MODE = Normal Read;
WAIT = wait states for normal read mode;
Clear all error flags in FLCTL_CLRIFG and
FLCTL_PRGBRST_CTLSTAT registers.
Rewrite the FLCTL_PRGBRST_DATAn_x
registers with updated_new_data;
Re-start burst programming by writing
START bit in FLCTL_PRGBRST_CTLSTAT
register. AUTO_PRE can be disabled since
the failing bits have been masked.
PST_ERR = 1?
End of word programming
NO
YES
F
NO
PRGB = 1 in
FLCTL_IE register?
YES
NO
Continue CPU execution of other tasks
or put device in LPM0.
YES
PRGB = 1 in
FLCTL_IFG register?
NO
PRGB interrupt?
NO
YES
E
E
RD_MODE_
STATUS = Normal
Read?
NO
YES
num_pr
g_pls >
MAX_PRG_PLS_
TLV?
NO
YES
Burst programming failure
Increment programing pulses used.
num_+;
All bits
in
updated_new_dat
a = 1?
E
YES
NO
The banks which get set into program
verify mode should depend on the
addresses to which the burst program
is ongoing. Software can use the
S Y S _ F L A S H _ S I Z E r e g i s t e r t o
identify the size of the main flash
memory of the device to determine
bank crossing between addresses.
Advanced Operations using the Flash Controller
469
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Flash Controller (FLCTL)
Figure 9-5. Handling Auto-Verify Error Before the Burst Operation