ISD91200 Series Technical Reference Manual
Release Date: Sep 16, 2019
- 362 -
Revision 2.4
6.8
In-System Programming (ISP)
The program and data flash memory support both in hardware In-Circuit Programming (ICP) and
firmware based In-System programming (ISP). Hardware ICP programming mode uses the Serial-Wire
Debug (SWD) port to program chip. Dedicated ICE Debug hardware or ICP gang-writers are available
to reduce programming and manufacturing costs. For firmware updates in the field, the I91200 provides
an ISP mode allowing a device to be reprogrammed under software control.
ISP is performed without removing the device from the system. Various interfaces enable LDROM
firmware to fetch new program code from an external source. A common method to perform ISP would
be via a UART controlled by firmware in LDROM. In this scenario, a PC could transfer new APROM
code through a serial port. The LDROM firmware receives it and re-programs APROM through ISP
commands. An alternative might be to fetch new firmware from an attached SD-Card via the SPI
interface.
6.8.1
ISP Procedure
The I91200 will boot from APROM or LDROM from a power-on reset as defined by user configuration
bit CBS. If user desires to update application program in APROM, the FMC_ISPCTL.BS can be set
to ’1’ and a software reset issued. This will cause the chip to boot from LDROM. An example flow
diagram of the ISP sequence is shown in Figure 6-5.
The FMC_ISPCTL register is a protected register, user must first follow the unlock sequence
to gain
access. This procedure is to protect the flash memory from
unintentional access.
To enable ISP functionality software must first ensure the ISP clock (CLK_AHBCLK.ISPCKEN) is
present then set the FMC_ISPCTL.ISPEN bit.
Several error conditions are checked after software writes the ISPTRIG register. If an error condition
occurs, ISP operation is not started and the ISP fail flag (FMC_ISPCTL.ISPFF) will be set instead. The
ISPFF flag will remain set until it is cleared by software. Subsequent ISP procedure can be started even
if ISPFF is set. It is recommended that software check ISPFF bit and clear it after each ISP operation if
set.
When ISPTRIG register is set, the CoretxM0 CPU will wait for ISP operation to finish, during this period;
peripherals operate as usual. If any interrupt requests occur, CPU will not service them until ISP
operation finishes. As the ISP functions affect the operation of the flash memory M0 instruction pipeline
should be flushed with an ISB (Instruction Synchronization Barrier) instruction after the ISP is triggered.
CPU writes ISPTRIG
ISP operation
HCLK
HREADY
CPU is halted but other peripherials keep working
ss
ss
Figure 6-4 ISP Operation Timing