6 Replies Latest reply on Sep 5, 2016 5:22 AM by user_2177781

    OTA trouble after OTA to firmware built with SDK-3.5.2

      Hi,

      After testing OTA from SDK-3.1.2 to SDK-3.5.2.

      The application no longer work because load filesystem fails.

       

      In my case, if I download the image built with SDK-3.5.2 directly, it looks ok.

      However, If I OTA to the image built with SDK-3.5.2, the firmware doesn't work.

       

      Tracing the issue and found after OTA,

      app->app_header_location.detail.external_fixed.location becomes 0.

       

      Below is the debug code:

      wiced_result_t wiced_waf_app_open( uint8_t app_id, wiced_app_t* app )
      {
          if ( wiced_dct_get_app_header_location( app_id,
      &app->app_header_location ) != WICED_SUCCESS )
          {
              return WICED_ERROR;
          }
      printf("app_id=%u app->app_header_location.detail.external_fixed.location=%u\n",
      (unsigned) app_id, (unsigned)app->app_header_location.detail.external_fixed.location);
          app->offset = 0x00000000;
          app->app_id = app_id;
          app->last_erased_sector = 0xFFFFFFFF;
      
          return WICED_SUCCESS;
      }
      

      Then I got below debug message:

      app_id=3 app->app_header_location.detail.external_fixed.location=0

       

      I think the problem is due to the data structure change in platform_dct_header_t.

       

      In SDK-3.5.2:

      typedef struct
      {
              unsigned long full_size;
              unsigned long used_size;
              unsigned long magic_number;
              char write_incomplete;
              char app_valid;
              char mfg_info_programmed;
              char initial_write;         /* first time DCT is written at manufacture */
              unsigned long sequence;
              unsigned long crc32;
              boot_detail_t boot_detail;
              image_location_t apps_locations[ DCT_MAX_APP_COUNT ];
              void (*load_app_func)( void ); /* WARNING: TEMPORARY */
      #ifdef  DCT_HEADER_ALIGN_SIZE
              uint8_t padding[DCT_HEADER_ALIGN_SIZE - sizeof(struct platform_dct_header_s)];
      #endif
      } platform_dct_header_t;
      

      In SDK-3.1.2/SDK-3.4.0-awt:

       

      typedef struct
      {
              unsigned long full_size;
              unsigned long used_size;
              char write_incomplete;
              char is_current_dct;
              char app_valid;
              char mfg_info_programmed;
              unsigned long magic_number;
              boot_detail_t boot_detail;
              image_location_t apps_locations[ DCT_MAX_APP_COUNT ];
              void (*load_app_func)( void ); /* WARNING: TEMPORARY */
      #ifdef  DCT_HEADER_ALIGN_SIZE
              uint8_t padding[DCT_HEADER_ALIGN_SIZE - sizeof(struct platform_dct_header_s)];
      #endif
      } platform_dct_header_t;
      

       

      The platform_dct_header_t is the format stored in storage, change it in new sdk will

      break compatibility.

      I have no idea how to fix it, please advice.