You are here

PSoC3/PSoC5 bootloader | Cypress Semiconductor

PSoC3/PSoC5 bootloader

Summary: 3 Replies, Latest post by kmmankad on 10 Nov 2011 08:20 PM PST
Verified Answers: 0
Last post
Log in to post new comments.
dasg's picture
Cypress Employee
730 posts
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:
  1. Bootloader host: It can be a PC or an embedded host capable of communicating with the target device.
  2. 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.
  3. 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.
user_460349's picture
1362 posts

We have a project that may use this bootloader method. But I have a few questions

1. During bootloader running, What are the states of the IOs?

2. I am thinking of storing 2 application, One is a production testing and calibration of the printed circuit board assembly. One is the actually running code. Would it be possible to use SPI as SPI flash is cheap and easy to get.

3. If I have the two application in SPI flash, any suggestion of how to load the apllications. ie it should load the test progrmam first and after completing the testing, load the actual code.



user_66945721's picture
256 posts

As far as I understand it,the bootloader too is a regular project,in terms of GPIO levels,or User modules that can be used.So,

1.During the bootloader,like any other psoc project,you can control the GPIOs.

2.Out of the production testing and calibration of the printed circuit board assembly,I guess you can have one as the bootloader,and the other as you said to be the running code.Yes,you can use SPI in the bootloader,to access SPI Flash memory.

3.If you want to use SPI Flash to load programs from,you'll need to implement 5 functions,






You may refer to the I2C Bootloader example,to see how its done.Heres the link:


PS : Hit verify answer if my reply helped you.

user_66945721's picture
256 posts

So,you can probably have it this way,

Let the bootloader be one that can load programs from SPI flash.Since you already know where on the flash device the 2 programs are located,let the bootloader load one,and in that program code,you can have the last line as "CyBtldr_Start()" and then the bootloader is reloaded,where the bootloader now knows it has to load the second program.(use the on-chip EEPROM to store a flag of indicating which program,1 or 2 is to be loaded)



PS:Hit 'Verify Answer' if my reply helped you.

Log in to post new comments.