External Flash and APP

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

cross mob
HiIg_4537276
Level 3
Level 3
10 replies posted 5 replies posted 5 questions asked

Hi

When firmware update is performed, update data acquired from the server is written to "APP0" and "APP1" of the external Flash.
It is a process of updating at a fixed cycle, and I want to write "APP0" and "APP1" alternately at each update. Is this possible?

If possible, please tell us how to implement it.

The implementation environment is as follows.
・ Chip model: CYW43438
・ SDK: WICED-Studio-6.4

Thanks!

0 Likes
1 Solution

Our current flow should have a match with your description:

OTA2 Staging area = APP0  in your description.

Below comments are extracted from our OTA2 document , the checking process.

4 OTA2 Bootloader Logic

The state of the Current Application Area, LKG (if enabled) and Staged OTA2 Image is stored in the OTA2 DCT. The

OTA2 Bootloader will run the snip/ota2_extract application if OTA2 Image Extraction is needed.

The OTA2 Image Staging area will have a status value (incorporated into the OTA2 Image Header) so that a background

OTA2 Service running from the Current Application (or the SoftAP in snip/ota2_extract) can save an OTA2 Image and the

download progress so that the OTA2 Bootloader can determine if there is a valid OTA2 Image to be extracted on a reboot

(it will then launch the snip/ota2_extract application to do the extraction). 

NOTES: 

The FLASH writing code can check for battery level before starting writing.

The WICED software CRC32 calculation can be replaced at compile time.

#  Sample Layout for 8MB FLASH

#

#   Sizes are on sector boundaries for this platform

#

#   +---------------------------------------+

#   | Boot loader Area | 32k  Size of build/waf.ota2_bootloader-<platform>/binary/waf.ota2_bootloader-<platform>.stripped.elf

#   +---------------------------------------+

#   | Factory Reset OTA Image | 2MB - 100k for Failsafe App (Adjust this size to fit build/<your_application>-<platform>/OTA2_factory_reset_file.bin)

#   +---------------------------------------+

#   | OTA2 Failsafe App | 100k  Size of build/waf.ota2_failsafe-<platform>/binary/waf.ota2_failsafe-<platform>.stripped.elf

#   +---------------------------------------+

#   | DCT Save area (when updating) | 16k  (same size as normal DCT)

#   +--                                   --+

#   | Application Lookup Table (LUT) |  4k

#   +--                                   --+

#   | DCT Copy 1                      | 16k   DCT 1 & 2 must be contiguous

#   +--                                   --+

#   | DCT Copy 2                      | 16k

#   +--                                   --+

#   | OTA2 Extractor Application      | 308/316k  Size of build/snip.ota2_extract-<platform>/binary/snip.ota2_extract-<platform>.stripped.elf

#   +--                                   --+

#   | File system                      | ???   Adjust this size to fit future update size of build/<app><platform>/filesystem.bin

#   +--                                   --+

#   | Current Application      | ??? --\

#   +--                                   --+        >-- total 2.77MB

#   | Expansion area   | ??? --/

#   +---------------------------------------+

#   | OTA2 Staging area (downloaded image)  | 2MB  Adjust this size to max. expectation of update build/<your_application>-<platform>/OTA2_image_file.bin

# | |      (Will probably be larger than the Factory Reset Image in Update builds)

#   +---------------------------------------+

#

View solution in original post

8 Replies
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

   I am a little confused about the requests,  Are you use our OTA mechanism to realize update from a HTTP server ?

Hypothetically ,  you have no problem to run the snip.ota_fr ,  now your request is to update App0 ,App1 on the first time and second time ?

Would you please describe your steps wanted ?  we can give a analysis based on current structure to see if it can be supported.

0 Likes

Hello

I am not good at English.

I'm sorry if it's hard to read.

I want to update a program regularly using the OTA mechanism.

For example, at 0 o'clock every day, the update program is downloaded to APP0.

Next time at 0:00, download the update program to APP1.

Write the update program alternately every day.

First, I want to make this happen.

Thank you

0 Likes

we have a multi app in the reference , they are sharing same DCT ,  changing APP by pressing key.

I think that should be a good start for your application.

0 Likes

Hello


The steps I want to carry out are as follows:

--------------------
① Download the update file from the server where the update file is stored.

② Save the downloaded update file to “APP0” on the external flash.

③ Confirm that the file saved in APP0 is not damaged.

④-1 If the update file is not damaged, save the update file in “Current Application”.
④-2 If the update file is damaged, interrupt the update and restart the board.
--------------------

I want to know the existence of sample code that can be used as a reference to implement the above.


Thank you

0 Likes

hello:

   I want to know if this question was resolved in your side-

0 Likes

Hello

No, this issue has not been resolved,
The investigation needs to continue.

0 Likes

Our current flow should have a match with your description:

OTA2 Staging area = APP0  in your description.

Below comments are extracted from our OTA2 document , the checking process.

4 OTA2 Bootloader Logic

The state of the Current Application Area, LKG (if enabled) and Staged OTA2 Image is stored in the OTA2 DCT. The

OTA2 Bootloader will run the snip/ota2_extract application if OTA2 Image Extraction is needed.

The OTA2 Image Staging area will have a status value (incorporated into the OTA2 Image Header) so that a background

OTA2 Service running from the Current Application (or the SoftAP in snip/ota2_extract) can save an OTA2 Image and the

download progress so that the OTA2 Bootloader can determine if there is a valid OTA2 Image to be extracted on a reboot

(it will then launch the snip/ota2_extract application to do the extraction). 

NOTES: 

The FLASH writing code can check for battery level before starting writing.

The WICED software CRC32 calculation can be replaced at compile time.

#  Sample Layout for 8MB FLASH

#

#   Sizes are on sector boundaries for this platform

#

#   +---------------------------------------+

#   | Boot loader Area | 32k  Size of build/waf.ota2_bootloader-<platform>/binary/waf.ota2_bootloader-<platform>.stripped.elf

#   +---------------------------------------+

#   | Factory Reset OTA Image | 2MB - 100k for Failsafe App (Adjust this size to fit build/<your_application>-<platform>/OTA2_factory_reset_file.bin)

#   +---------------------------------------+

#   | OTA2 Failsafe App | 100k  Size of build/waf.ota2_failsafe-<platform>/binary/waf.ota2_failsafe-<platform>.stripped.elf

#   +---------------------------------------+

#   | DCT Save area (when updating) | 16k  (same size as normal DCT)

#   +--                                   --+

#   | Application Lookup Table (LUT) |  4k

#   +--                                   --+

#   | DCT Copy 1                      | 16k   DCT 1 & 2 must be contiguous

#   +--                                   --+

#   | DCT Copy 2                      | 16k

#   +--                                   --+

#   | OTA2 Extractor Application      | 308/316k  Size of build/snip.ota2_extract-<platform>/binary/snip.ota2_extract-<platform>.stripped.elf

#   +--                                   --+

#   | File system                      | ???   Adjust this size to fit future update size of build/<app><platform>/filesystem.bin

#   +--                                   --+

#   | Current Application      | ??? --\

#   +--                                   --+        >-- total 2.77MB

#   | Expansion area   | ??? --/

#   +---------------------------------------+

#   | OTA2 Staging area (downloaded image)  | 2MB  Adjust this size to max. expectation of update build/<your_application>-<platform>/OTA2_image_file.bin

# | |      (Will probably be larger than the Factory Reset Image in Update builds)

#   +---------------------------------------+

#

Hello

Reviewing the sample code based on your advice solved the current question.

Use your time
Thank you very much.

0 Likes