APP0 INDEX for internal+external flash system

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

cross mob
Anonymous
Not applicable

Hi

All the DCT index define as below:

platform_dct.h

#define DCT_FR_APP_INDEX                        ( 0 )

#define DCT_DCT_IMAGE_INDEX                 ( 1 )

#define DCT_OTA_APP_INDEX                     ( 2 )

#define DCT_FILESYSTEM_IMAGE_INDEX  ( 3 )

#define DCT_WIFI_FIRMWARE_INDEX         ( 4 )

#define DCT_APP0_INDEX                             ( 5 )

#define DCT_APP1_INDEX                             ( 6 )

#define DCT_APP2_INDEX                             ( 7 )

internal + external system flash layout  (4343WWCD1 evb), the layout get from WICED-OTA.pdf

pastedImage_1.png

0 Likes
1 Solution
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

The application which runs after wiced_framework_reboot() is copied to the internal flash area. Hence the main app gets replaced with APP0 or APP1.

View solution in original post

5 Replies
Anonymous
Not applicable

My Question is

1. Why there are "two" main applications in both internal and external flash, from the programming process the main application should flash to internal flash. right ?

2. I did a simple test, programming main app and APP1 from WICED IDE

    => in main app, set boot to APP1 => the new boot will run APP1 => in APP1 set boot to APP0(INDEX 5) => boot failed, I believe the failed reason is the INDEX 5(external flash) is NULL, the main app in internal flash.

3. if main app in internal flash, what is the APP INDEX ? if the board runs APP1, how do I set back boot to the main app of internal flash?

Thanks

PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

1. Yes, the application is flashed to internal flash as the application can run directly from internal Flash or from RAM.

2. The main app is in internal flash hence when you set the boot to APP0, it returns an error as it is NULL. The application that is initially built goes to internal flash and during OTA update, the app runs from internal flash/RAM and writes the new image in the APP0 area.  If the application is executing from internal flash, it cannot write download the new image into internal flash as this will cause rewriting its own area. Hence there are two areas of main application: one in internal and another in external.

3. As an exercise, I tried building the main application and two different applications in APP0 and APP1 area.

APP0_FILE = snip.apsta-$(PLATFORM)

APP0 = build/$(APP0_FILE)/binary/$(APP0_FILE).stripped.elf

APP1_FILE = snip.gpio-$(PLATFORM)

APP1 = build/$(APP1_FILE)/binary/$(APP1_FILE).stripped.elf

Now I forced the application to run as: main app -> APP0 -> APP1->APP0->APP1...

Let me look more into this and get back to you.

0 Likes
Anonymous
Not applicable

Hi riya,

Thanks for feedback, from your example, there are 3 apps

1. main app (internal flash)

2. APP0 (SPI Flash)

3. APP1 (SPI Flash)

I believe "main app -> APP0 -> APP1->APP0->APP1..." by using wiced_waf_app_set_boot API (set INDEX 5/6) is no problem, but it seems there is no INDEX asign for the main app in the current SDK, Actually I would like to know how to set back the boot to main app(internal flash) if the current boot already set to APP0/1.

Thanks,

PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

The application which runs after wiced_framework_reboot() is copied to the internal flash area. Hence the main app gets replaced with APP0 or APP1.

Anonymous
Not applicable

understood, thanks for the answer.

0 Likes