Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ansh_2022771
Level 2
Level 2
First like received First like given

Hello Everyone,

I have been writing Over the air firmware upgrade for STM, PICS and Atmel controllers. It was  a simple process in those controllers.

Divide flash into Bootloader and application or maybe network (if you want to separate network or not).

Go to Boot loader. and then Check for an update and then reset IVC, SP & PC and then jump to application. Now that I have been working with PSOC4 BLE. I have couple of doubts and assumptions which I want to verify.

My plan to implement it:

  1. Boot loader is always empty, It checks whether an application is there If yes then jump to application otherwise look in external memory (SD card / data flash) for application image and then copy that image from external memory to PSOC's flash. Check integrity and jump to application.
  2. I am planning to update external memory (data flash or SD card) in application portion itself. If image is uploaded to external memory successfully then update the application area (flash) from bootloader.

All this seems OKAY to me based on the data gathered by me so far.

  • I will be using SPI for external memory. Also I am using same SPI for couple of other things and want to access it in application as well. SPI will be used in boot loader for reading external memory, checking integrity  & then writing the read data from external memory  to PSOC's flash. My doubts here are :
    1. Do I have to take single SPI component on both application and bootloader project ?
    2. If answer to Point 1 is true that means I have to use bootloader's SPI functions in application as well.
    3. If answer to point 1 is false that means I have to take SPI component in both bootloader and Application.
  • What does bootloader and bootloadable components do ?
  • How to devide flash for bootloader and application ?
  • Any other guidance on doing that good old stuff like "reset IVC, SP & PC" before jump to application from bootloader or is that taken care by components automatically.

Thanks for reading and I await your valuable responses.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You will need to write your own bootloader which is a bit of work, but has been done by some users before. Reason is that the current implementation expects the data coming via a fixed protocol in a hex data format. You may use as a starting point the current Bootloader component source.

You can use the same SPI for bootloader and application. When the bootloading is finished (and this includes the configuration data for the bootloadable) a reset is issued and the configuration gets set.

Bootloader component manages the interface (SPI in your case) and reads the data for the bootloadable application.

The bootloadable component simply manages the entry-point for the application so it can be called at reset.

Dividing the flash areas is mostly done automatically.

Bob    

View solution in original post

6 Replies