Under each chip architecture directory (Wiced/Platform/ARM_Cortex_xx/<specific chip type>) there is a directory called bootloader_ota which contains all the platform specific bootloader and OTA upgrade functionality. The specific file of interest is called platform_bootloader.c and it contains the functions that:
- Restore factory reset application (platform_restore_factory_app())
- Load the OTA app (platform_load_ota_app())
- Start the main application (platform_start_app())
You are free to modify those functions to implement the functionality you require however it is recommended that you make copy of the chip architecture you are changing and give it a custom name.
Some things to note when creating a new/modified chip architecture:
- You will need to rename the makefile so that it matches the name of the directory.
- In your platform makefile change the declaration of $(NAME)_COMPONENTS to the address of your new chip
e.g. $(NAME)_COMPONENTS := common/ARM_Cortex_M3/my_STM32F2xx
We recommend creating a duplicate chip architecture to ensure you always have a copy of the original reference code that will assist you in finding any bugs that might occur while you are doing your changes. Having your own chip architecture can also make it easier to migrate to new SDK revisions as it will permit you to copy and paste your directory into the new SDK and then compare the old and new revisions to see if there are any changes you may need to port to your modified chip architecture.
Thanks for your information!
we need link script how to link as one image and
As recommended by you for the platforms and target changed. and we know that we have to change
following function .
- Restore factory reset application (platform_restore_factory_app()) // will be removed
- Load the OTA app (platform_load_ota_app()) // serial flash access codes will be removed,
//we will put codes to access 0x080C 0000 0x080E FFFF OTA application.
3. Start the main application (platform_start_app()) // ok
Main Question is that.
How to link ( link script in make file ) application and OTA application waf_ota_upgrade-xxxx as one image.
and Our Application and OTA application is going to be mapped in MCU Flash as below
Our Application begins at : 0x0800 C000 0x080B FFFF // ( damo_s2w-APP1BCM94362WCD4.bin )
OTA application begins at : 0x080C 0000 0x080E FFFF // ( waf_ota_upgrade-APP1BCM94362WCD4.bin )
How to make two file as one image with above address mapping ?
- Some application will use Serial Flash but most of application will not use Serial Flash
- if flash(in MCU) is broken in case of upgrade or other issues,
if boot-loader check that flash(in MCU) is broken, then it will jump to 0x080c 0000 ( OTA ) upgrade
we are not sure that OTA App can work in flash or it needed copy to RAM to run .
( for this case, address mapping may be different )
Please start a new discussion if this is still an issue.