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?
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.
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.
1 of 1 people found this helpful
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.
understood, thanks for the answer.