
NUC126
Aug. 08, 2018
Page
224
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
Vector Table
Vector Map Space
APROM
SRAM
Multi-Word Programming
Code
0x2000_0000
0x0000_0000
0x0000_01FF
Programming Space
Program
APROM
Remap vector map to avoid
flash access by exceptions
when doing ISP
Figure 6.4-13 Firmware in SRAM for Multi-word Programming
The multi-word programming flow is shown as bellow. The starting ISP address (FMC_ISPADDR) has
to be 8-byte align. FMC_MPDAT0 is the data word of the offset 0x0, FMC_MPDAT1 is the second
word (offset 0x4), FMC_MPDAT2 is the third word (offset 0x8), and FMC_MPDAT3 is forth word (offset
0xC). If the starting ISP address FMC_ISPADDR [3] is 0, the 1
st
data word should put on
FMC_MPDAT0, and 2
nd
word is FMC_MPDAT1, 3
rd
word is FMC_MPDAT2, and 4
th
word is
FMC_MPDAT3. If the starting ISP address FMC_ISPADDR [3] is 1, the 1
st
data word should put on
FMC_MPDAT2, and 2
nd
word is FMC_MPDAT3, 3
rd
word is FMC_MPDAT0, and 4
th
word is
FMC_MPDAT1. The maximum programming size is 256 bytes. While FMC controller performs multi-
word programming operation, CPU needs to monitor the buffer status D3~D0(FMC_MPSTS[7:4]) and
MPBUSY (FMC_MPSTS[0]) to wait the buffer empty ((D1,D0)=00, or (D3,D2)=00), and then CPU
needs to update the next programming data (FMC_MPDAT0, FMC_MPDAT1, FMC_MPDAT2 and
FMC_MPDAT3) in time. Otherwise, FMC controller will exit multi-word programming operation (
MPBUSY (FMC_MPSTS[0]) = 0). If CPU cannot update the data in time ( MPBUSY (FMC_MPSTS[0])
=0), CPU needs restart a new multi-word programming procedure to continue, FMC_MPADDR
provides the last program address information. At the end of operation, CPU has to check ISPFF
(FMC_MPSTS[2]) to confirm the multi-word operation successful complete.