Author: RyanZ_36 Version: **
The PSoC® 4 Bootloader Component provides a Custom Interface that you can use for developing your own bootloader interface. Figure 1 shows the configuration.
Figure 1. Bootloader Custom Interface
When you use the I2C/UART interface to develop the bootloader project, functions listed in Figure 2 will be generated by PSoC Creator automatically.
However, when you use the Custom Interface of Bootloader Component, if you follow the Bootloader Component’s boot loading protocol, you should add definition and code for functions listed in Figure 2. See the Bootloader and Bootloadable Component datasheet for bootloader flow and function details.
Figure 2. Functions Required for Default Bootloader
Besides using functions generated by Bootloader Component, you can define your own boot loading protocol. In this case, a quick way is to do the following:
- Use the Bootloader Component (configured as the custom interface) to decide bootloader and application ROM sections and start pointer in the link file.
- Define dummy functions in Figure 2
A basic boot loading flow is shown in Figure 3.
Figure 3. Boot Loading Flow Overview
Note that you must define your own APIs of handshake, data read, data store in flash, and chip reset.
The API for handshake of the host and PSoC device can use CyDelay() or a Timer Component to set the timeout.
The API to read data from the host is dependent on your communication interface. Note that for most of PSoC 4 series, internal flash is organized by 128 bytes as the least significant block. That means, the atomic program and erase unit of the code flash is 128 bytes.
The API to store data in the flash can use the CySysWriteFlashRow() function generated by PSoC Creator.
The API to reset the devvice can use the CySoftwareReset() function generated by PSoC Creator.
Visit the Cypress Community or contact Cypress Sales for more details.