1 Reply Latest reply on Sep 7, 2017 3:30 AM by NeerajPant

    Not able to perform OTA in WM-BN-BM-22 eval kit

    NeerajPant

      Hi,

       

      I am using WICED STACK 4.1.2 to achieve OTA firmware upgrade.

       

      But i see when i am uploading the firmware into the web browser and clicking start upgrade , transferred will always show "NaN%".

      To narrow down this issue i checked the o/p of API used inside progress_upgrade_chunk function in wiced_ota_server.c file.

       

      if (wiced_framework_app_get_size( &app, &current_size ) != WICED_SUCCESS)

              {

                  return -1;

              }

      if (wiced_framework_app_set_size( &app, file_size) != WICED_SUCCESS)

      {

              return -1;

      }

       

      Here the app_set_size always failing and app_get_size always returns with current_size 0.

       

      I have compiled and flashed the application using command - "./make snip.ota_fr-BCMUSI22.A1 download_apps download run" and i am uploading the snip.scan-BCMUSI22.A1.stripped.elf file into web browser.

       

      Can you pleas help me to resolve this?

        • 1. Re: Not able to perform OTA in WM-BN-BM-22 eval kit
          NeerajPant

          I did some more analysis on this by adding some code to ota_fr.c, below is the snippet.

           

          sflash_handle_t sflash_handle;

                  app_header_t    app_header;

                  uint32_t        address, available_size,current_size;

                  sflash_read_t  sflash_read_func;

                  wiced_app_t app;

                  int index;

                  wiced_framework_app_open( DCT_APP0_INDEX, &app );

                  WICED_VERIFY( init_sflash( &sflash_handle, PLATFORM_SFLASH_PERIPHERAL_ID, SFLASH_WRITE_NOT_ALLOWED ) );

                  WICED_VERIFY( sflash_read( &sflash_handle, app.app_header_location.detail.external_fixed.location, &app_header, sizeof(app_header_t) ) );

                  wiced_apps_get_physical_address( &app_header, 0, &address, &available_size );

                  //wiced_framework_app_get_size( &app, &current_size );

                  for ( index = 0; index < app_header.count; index++ )

                      {

                          current_size = current_size + app_header.sectors[ index ].count;

           

           

                      }

                  current_size = current_size * SFLASH_SECTOR_SIZE;

              printf("Address is %ld, available_size is %ld ,size of app %ld ,header.count %ld\n",address,available_size,current_size,app_header.count);

           

          Attached is the output of it, and which is same for DCT_FR_APP_INDEX too.

          I don't know why the location is not different for both.

           

          ota.png

           

          Please help here.