Boot ROM General description

Boot loader

The boot loader controls initial operation after reset and also provides the means to accomplish programming of the flash memory via USART. This could be initial programming of a blank device, erasure and re-programming of a previously programmed device, or programming of the flash memory by the application program in a running system.

The boot loader code is executed every time the part is powered on or reset. The boot loader can execute the ISP command handler or the user application code. A LOW level after reset at the ISP entry pin is considered as an external hardware request to start the ISP command handler via USART.

For details on the boot process, see Boot ROM Boot process.

Note: SRAM location 0x1000 0000 to 0x1000 0050 is not used by the bootloader and the memory content in this area is retained during reset. SRAM memory is not retained when the part powers down or enters Deep power-down mode.

Assuming that power supply pins are at their nominal levels when the rising edge on RESET pin is generated, it may take up to 3 ms before the ISP entry pin is sampled and the decision whether to continue with user code or ISP handler is made. The boot loader performs the following steps (see c-Bootprocessflowchart.html#d21e426__CACHJEHC):

  1. If the watchdog overflow flag is set, the boot loader checks whether a valid user code is present. If the watchdog overflow flag is not set, the ISP entry pin is checked.
  2. If there is no request for the ISP command handler execution (ISP entry pin is sampled HIGH after reset), a search is made for a valid user program.
  3. If a valid user program is found then the execution control is transferred to it. If a valid user program is not found, the boot loader attempts to load a valid user program via the USART interface.
Note: The sampling of pin the ISP entry pin can be disabled through programming flash location 0x0000 02FC (see ISP-IAP API General description).

ROM-based APIs

Once the part has booted, the user can access several APIs located in the boot ROM to access the flash memory, optimize power consumption, and operate the USART and I2C peripherals.

The structure of the boot ROM APIs is shown in c-Generaldescription.html#d21e285__CACGEFIB.

Boot ROM structure

The boot rom structure should be included as follows:

typedef	 struct _ROM_API {-->
	const uint32_t unused[3];-->
	const PWRD_API_T *pPWRD;-->
	const uint32_t p_dev1;-->
	const I2CD_API_T *pI2CD;-->
	const uint32_t p_dev3;-->
	const uint32_t p_dev4;-->
	const uint32_t p_dev5;-->
	const UARTD_API_T *pUARTD;-->
}  ROM_API_T;-->
-->
#define ROM_DRIVER_BASE (0x1FFF1FF8UL)-->
Table 1. Boot ROM API calls
API Description Reference
Flash IAP Flash In-Application programming ISP-IAP API IAP Command Summary
Power profiles API Configure system clock and power consumption Power profiles API Power profile API calls
I2C driver I2C ROM Driver I2C API I2C API calls
UART driver USART ROM Driver UART API UART API calls

-->