3 of 3 people found this helpful
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.
If the flash divide is automatic how does programmer (Miniprog3) decides
- where to write bootloader.hex and where to write bootloadable.hex ?
Based on my understanding and requirements I will be updating firmware from application portion only.
- Receiving data and then writing to external memory.
- Once write successful & integrity check successful, Jump to Bootloader.
- In the bootloader write to internal flash of PSOC. Check integrity, if all OK jump to application.
If you can see above, it's very important that I load both bootloader and bootloadable hex files on factory reset.
- Is that possible ?
- Also if not possible then how does developers upgrade stack of BLE if they are already communicating with BLE ?
- Do they put BLE in bootloader ? If yes then how do they update stack ?
It all seems confusing.
I would suggest you to start a forum search with "BLE OTA" keywords, there are some articles/threads to read.
Hi Bob I was busy with some other work and was unable to look into this particular issue.
Today I started using code example of bootloader and bootloadable. In the bootloadable I placed manual placement of image at address 2000. To my surprise in the hex file of bootloadable the start address is 0000.
To be more clear - All I want is Create an application project at any location (0x00002000). Decode that generated hex file in my windows application. Once It is decoded from PC I am sending that data serialy (UART) to bootloader. Bootloader writes this image from (0x00002000) to the flash.
Update - I figured out something. As we provide bootloader as dependency for bootloadable, it decodes bootloader hex file.
That also answers my another query. For first time we need not to program bootloader and application seprately. We can only program bootloadable and that will update entire flash (Bootloader and bootloadable)
I will keep posting updates here so that it helps others as well.
Another question - Now that I am sure that bootloader starts from 0000 and bootloadable (application) starts from 2000. All I want is find an API and a way to jump to bootloadable from bootloader. Is there a specific way of doing that manually.
2 of 2 people found this helpful
Update 2 - As I said, I wanted to know how to jump properly from bootloader to Bootloadable (at a specific address 0x00002000 in our case)
Here is solution :
/* Argument 1 is your manual app address and argument 2 is app ID which is 1 in our case as bootloader's app ID is 0 */
/* When you are ready to jump to application or bootloadable call this to set the run type and then do a soft reset */
I will write a detailed post for this.