REPROG210x.CTL is the control file for the serial loader which reprograms the on-chip Flash memory. Because the on-chip Flash cannot be accessed during programming, and because the initial loader code may itself be replaced, the Flash programming code is copied into RAM for execution. The only exit from the code is a reset of the CPU to execute the newly Flashed program. All interrupts are disabled during reprogramming, and so polled serial drivers are used.
Access to the reprogramming software is defined in REFLASH.FTH for the main system code and in this control file and the two must match.
Return is by rebooting the system. The contents of the internal RAM and Flash are destroyed, therefore any data that must be preserved should be saved externally to the chip.
#2138 constant LPCtype \ -- u
Define default LPC type if none defined on command line
LPCtype equ LPCtype \ -- n
Define the LPC type being used. This is used to
select CPU specific data and routines.
#10000000 equ xtal-speed \ -- Hz
Crystal clock rate in HZ. For greatest baud rate flexibility
use 14.7456 MHz
#60000000 equ system-speed \ -- Hz
System operating speed in HZ. Must be the same as, or an
even multiple of XTAL-SPEED. If not the same, the
initialisation code will set up the PLL as required.
0 equ FullIAP? \ -- n
Set this equate non-zero to compile additional IAP routines.
See IAP210x.FTH for more details.
l: CLD1 \ -- addr
Filled in later with the xt of ReprogFlash
l: CLD_CopyFlash \ -- addr
Filled in later with the xt of CopyFlash
l: CLD_UART \ -- addr
Filled in later with 0 or UART base address to use.
If set to 0, the default is UART0. This allows an
application to select which UART to use.
synonym ser-emit emit
A synonym required by the Xmodem code.
synonym ser-key? key?
A synonym required by the Xmodem code.
synonym ser-key key
A synonym required by the Xmodem code.
make-turnkey ReprogFlash \ start up action
Define the action of the reprogramming code.
' CopyFlash CLD_CopyFlash !
Define the action of the Flash copy code.