Have you ever tried upgrading the firmware on your mobile phone, MP3 player, camera or tablet? The seamless process by which you can do this is facilitated by a bootloader, eliminating the need for an external programmer or disassembling the product. A bootloader is an absolute necessity in consumer technology today, to keep pace with rapidly evolving competition and keep customers excited about your product everyday! For embedded system designers, it also opens up a door to fix bugs in a shipped product.
Figure below shows a typical bootloader system in PSoC3/PSoC5. A PSoC3/PSoC5 bootloader allows you to reconfigure the on-chip hardware as well as to upgrade the application firmware. The devices support I2C and USB as standard communication protocols for bootloading.
A typical PSoC 3/PSoC 5 bootloader system has the following elements:
- Bootloader host: It can be a PC or an embedded host capable of communicating with the target device.
- Bootloader: This is a piece of code that resides in the target device and capable of communicating with the host, re-flashing the device and handing control to the application. The bootloader is usually factory programmed onto the device.
- Bootloadable project: This is the actual application in the target device. It can be changed using the bootloader.
To modify or upgrade the bootloadable project in the device, the host sends the new project and data over a communication interface. The bootloader receives this new project code and data, and writes it to the bootloadable flash. It passes control to the bootloadable project once the new project/application is successfully bootloaded.
Here are some facts that you may want to know about PSoC3/PSoC5 bootloaders:
- PSoC3/PSoC5 bootloader allows you to reconfigure both hardware resources as well as firmware.
- The bootloader is created as a separate project. The bootloadable project is linked to the bootloader project using the dependency option in PSoC Creator IDE.
- You can build your own custom communication interface for bootloading.
- A typical PSoC3 I2C bootloader project only consumes 7 kB of flash.
- It is possible to protect the security settings of the bootloader flash to prevent any accidental rewrites to the bootloader itself.
- PSoC3/PSoC5 bootloaders are fail-safe. The bootloadable project checksum is validated during power-up. When the checksum is invalid, the bootloader will wait for a valid image to be bootloaded. This is useful in situations where power fails during bootloading.
Are you looking for a fast and easy way to add an I2C bootloader to your PSoC 3 or PSoC 5 project? Please refer application note AN60317 ! Please let us know your feedback in the comments section below.