A
AVPRE = 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 .
These operations have to happen
on the bank register corresponding
to the bank where the address of the
f l a s h
p r o g r a m i n g
o p e r a t i o n
w a s
i n t e n d e d .
MAX_PRG_PLS_TLV is the value
of maximum number of program
pulses needed to reliably program
a flash location. This value is stored
in the device TLV table.
WAIT = wait states for program verify
mode;
RD_MODE = Program Verify;
RD_MODE_
STATUS = Program
Verify?
NO
YES
exist_data = Read_word from Flash;
new_data = temp_var;
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
register.
Initiate data write to the desired flash
address with updated_new_data. Pre-
verify can be disabled since failing bits
are already masked.
*(dest_addr) = updated_new_data;
AVPST = 1?
End of word programming
NO
YES
C
NO
PRG
= 1 in
FLCTL_IE
register?
YES
NO
PRG
= 1 in
FLCTL_IFG
register?
NO
Continue CPU execution of other tasks
or put device in LPM0.
PRG
interrupt?
YES
NO
B
B
RD_MODE_
STATUS = Normal
Read?
NO
YES
All bits
in
updated_new_dat
a = 1?
B
YES
NO
YES
Increment programing pulses used.
num_+;
num_pr
g_pls >
MAX_PRG_PLS_
TLV?
NO
YES
Word programming failure
Advanced Operations using the Flash Controller
465
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Flash Controller (FLCTL)
Figure 9-2. Pre-Verify Error Handling for Immediate and Full Word Program Flow