cancel
Showing results for 
Search instead for 
Did you mean: 

Community Information

New Contributor II

Hello to all,

We are using OTA FW upgradable with BLE having 256kB of flash. The combined file .cyacd is around 135kB and almost 200kB of the Flash is used. I am trying to understand how the CySmart does perform FW upgrade when using the combined FW file as I have read the document 001-97060_AN97060_-_PSoC_4_BLE_and_PRoC_BLE_-_Over-The-Air_OTA_Device_Firmware_Upgrade_DFU_Guide.pdf which describes the OTA FW flow.

My understanding is that CySmart probably first send stack part that is copied to the second part of the flash. Device is then restarted and launcher does copying, starting of the new stack. The new stack then gets second part of the FW file containing the app and stores it into the flash. Device is again restarted, but now with active application. Is my understanding correct?

Thanks for the answer, Frenk

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi Frenk,

Yes. You are correct. The following is the 3 stage process when using Stack + Application upgrade option is selected in CySmart.

When we use single profile option, bootloader host will keep on giving program row commands continuously for both stack and user application flash rows. Thus, data flow diagram is disturbed. Hence, we would recommend this option (single profile option) for External Memory OTA Bootloader configuration where BLE stack and application are part of single image. External Memory OTA Bootloader configuration is called as legacy version of OTA.)

In case of upgradable stack OTA with Stack and Application .cyacd files are chosen, the following stages will happen:

Stage 1: The firmware passes control to the Stack Application (after button press in application), which receives the new Stack Application image and writes it to a temporary location (User Application region) in the flash memory. The User Application becomes corrupted in this process (the new Stack Application image overwrites the existing User Application image).

Stage 2: After the download is complete, a software reset is initiated by the Stack Application, and the control passes to the Launcher image. It detects the image located in the temporary location (User Application region) and copies it to the Stack Application region.

Later Application Upgrade is required as we corrupted the old application image.

Stage 3: Application Upgrade: Only the User Application image is upgraded. To enter the OTA upgrade mode, the firmware passes the control to the Stack Application, which receives the new User Application image. The Stack Application then directly writes the new User Application image to the corresponding region of the flash.

Hope this explanation helps !

Thanks

Ganesh

View solution in original post

5 Replies
Moderator
Moderator

Hi Frenk,

Yes. You are correct. The following is the 3 stage process when using Stack + Application upgrade option is selected in CySmart.

When we use single profile option, bootloader host will keep on giving program row commands continuously for both stack and user application flash rows. Thus, data flow diagram is disturbed. Hence, we would recommend this option (single profile option) for External Memory OTA Bootloader configuration where BLE stack and application are part of single image. External Memory OTA Bootloader configuration is called as legacy version of OTA.)

In case of upgradable stack OTA with Stack and Application .cyacd files are chosen, the following stages will happen:

Stage 1: The firmware passes control to the Stack Application (after button press in application), which receives the new Stack Application image and writes it to a temporary location (User Application region) in the flash memory. The User Application becomes corrupted in this process (the new Stack Application image overwrites the existing User Application image).

Stage 2: After the download is complete, a software reset is initiated by the Stack Application, and the control passes to the Launcher image. It detects the image located in the temporary location (User Application region) and copies it to the Stack Application region.

Later Application Upgrade is required as we corrupted the old application image.

Stage 3: Application Upgrade: Only the User Application image is upgraded. To enter the OTA upgrade mode, the firmware passes the control to the Stack Application, which receives the new User Application image. The Stack Application then directly writes the new User Application image to the corresponding region of the flash.

Hope this explanation helps !

Thanks

Ganesh

View solution in original post

New Contributor II

Hello Ganesh,

As usually thank you for your effort in explaining this.

Could you also explain the flow as its seen by the CySmart when using the combined files? Does this mean CySmart sends complete file and everything is then happening in the device? So can device store complete combined .cyacd file and do all this 3 steps inside?

Thanks again, Frenk

0 Likes
Reply
Moderator
Moderator

Hi Frenk,

The combined files (single .cyacd) option is supported by CySmart only for External Memory OTA. In case of Upgradable stack OTA method you need to use two separate .cyacd files (one for stack and other for application). This is because the psoc 4 ble device will not have enough memory to accommodate the new stack's and application's image together. In case of external memory OTA entire image is stored in the external memory.

Since the CySmart has an option to select both stack and applications cyacd, it will automatically wait and perform the complete OTA process. The user will not have to do any intermediate steps unless the pairing method selected as Authenticated pairing.

Kindly let us know if you have any particular requirement for combined .cyacd update.

Thanks

Ganesh

0 Likes
Reply
New Contributor II

Hello Ganesh,

Hm, make sense.

But when I have used the combined files I saw it had working on my side. Well I saw the new application was running. The question here is, was the BLE stack also updated? Will check this also, but CySmart did not complain or report any error. Also on the device I did not see any error.

Maybe this is also the reason OTA FW upgrade is failing when I am using old BLE v3.30 and a new image with BLE v3.66.

Thanks, Frenk

0 Likes
Reply
New Contributor II

Hello Ganesh,

Ok its clear now how CySmart does handle FW OTA. But nevertheless when I am using option combined file (stack + app) it would be fine that CySmart would tell me I have a wrong file as in the other cases. Now when I just select app FW image file it performs OTA FW update, but it actually only updates the application.

Thanks again for all the clues, there were really helpful, Frenk

0 Likes
Reply