
M0A21/M0A23 Series
May 06, 2022
Page
222
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
Enable ISPEN
Set ISPGO = 1
End of ISP
Operation
?
(Read FMC_ISPDAT)
&
Check ISPFF = 1?
YES
End of Flash
Operation
NO
Write FMC_ISPADDR
Write FMC_ISPCMD
(Write FMC_ISPDAT )
Add ISB instruction
Check ISPGO = 0
?
NO
YES
Start
Stop
Figure 6.4-9 ISP Procedure Example
Finally, set ISPGO (FMC_ISPTRG[0]) register to perform the relative ISP function. The
ISPGO(FMC_ISPTRG[0]) bit is self-cleared when ISP function has been done. To make sure ISP
function has been finished before CPU goes ahead, ISB (Instruction Synchronization Barrier) instruction
is used right after ISPGO(FMC_ISPTRG[0]) setting.
Several error conditions will be checked after ISP is completed. If an error condition occurs, ISP
operation is not started and the ISP fail flag will be set instead. ISPFF(FMC_ISPSTS[6]) flag can only
be cleared by software. The next ISP procedure can be started even ISPFF(FMC_ISPSTS[6]) bit is kept
as 1. Therefore, it is recommended to check the ISPFF(FMC_ISPSTS[6]) bit and clear it after each ISP
operation if it is set to 1.
When the ISPGO(FMC_ISPTRG[0]) bit is set, CPU will wait for ISP operation to finish during this period;
the peripheral still keeps working as usual. If any interrupt request occurs, CPU will not service it till ISP
operation is finished. When ISP operation is finished, the ISPGO bit will be cleared by hardware
automatically. User can check whether ISP operation is finished or not by the ISPGO(FMC_ISPTRG[0])
bit. User should add ISB (Instruction Synchronization Barrier) instruction next to the instruction in which
ISPGO (FMC_ISPTRG[0]) bit is set 1 to ensure correct execution of the instructions following ISP
operation.
VECMAP for Interrupt and Memory Programming
Accelerate interrupt by VECMAP
In IAP mode, VECMAP function could be used to map 512 bytes SRAM to vector map space. It means
it is possible to store all exception vectors to SRAM. Then, if any exceptions assert, CPU can read
exception handler from SRAM with zero wait state to speed up exception latency.
Because the vector map space is fixed to be 512 bytes, user must copy all 512 bytes to SRAM before
remapping SRAM to vector map space. Otherwise, CPU may get wrong data from vector map space
after remapping. Figure 6.4-10 shows an example to accelerating interrupt by VECMAP.