2 Replies Latest reply on Nov 24, 2019 6:06 PM by HiIg_4537276

    About "ota2_failsafe_app_load"

    HiIg_4537276

      Hello

       

      I have a question about the implementation of "apps \ waf \ ota2_bootloader \ ota2_bootloader.c" in the sample code.

      When "ota2_failsafe_app_load" is called, the following processing is performed.

      ------------------------------

          / * Check boot_type FAILSAFE-if so, use ota2_failsafe to recover * /
          BOOTLOADER_PRINTF (("Bootloader: boot_type =% d! \ R \ n", dct_ota2_config.boot_type));
          if ((dct_ota2_config.boot_type == OTA2_BOOT_FAILSAFE_FACTORY_RESET) ||
              (dct_ota2_config.boot_type == OTA2_BOOT_FAILSAFE_UPDATE))
          {
              uint32_t entry_point;
              platform_led_set_state (PLATFORM_RED_LED_INDEX, WICED_LED_ON);
              platform_led_set_state (PLATFORM_GREEN_LED_INDEX, WICED_LED_ON);

              if (ota2_failsafe_app_load (OTA2_IMAGE_FAILSAFE_APP_AREA_BASE, & entry_point) == WICED_SUCCESS)
              {
                  platform_led_set_state (PLATFORM_GREEN_LED_INDEX, WICED_LED_OFF);
                  wiced_waf_start_app (entry_point);
              }
          }

      ------------------------------

      If "OTA2_BOOT_FAILSAFE_FACTORY_RESET" or "OTA2_BOOT_FAILSAFE_UPDATE"
      I think "ota2_failsafe_app_load" is called and failsafe is implemented
      Please tell me how "OTA2_BOOT_FAILSAFE_FACTORY_RESET" and "OTA2_BOOT_FAILSAFE_UPDATE" are distinguished in "ota2_failsafe_app_load".