4 Replies Latest reply on Apr 29, 2016 1:00 AM by olduc_2170276

    DCT migration issue (3.5.1 to 3.5.2)

      Hi,

       

      I am facing an issue when upgrading the SDK from 3.5.1 to 3.5.2.

      The DCT header has changed, and is not backward compatible. Has both bootloader and application use DCT, but only application can be upgraded, how am I supposed to handle this situation ?

      Bootloader creates a new DCT because it can't find a valid one, and application does the very exact thing. Hence I keep loosing the WiFi credentials of the board.

       

      On a side note, there seems to be a bug in the function wiced_dct_generate_crc_from_flash, which fails to get the right position of the crc.

        • 1. Re: DCT migration issue (3.5.1 to 3.5.2)
          VikramR_26

          Hey Olivier,

           

          presently there are issues in DCT structure being changed. we are working on a solution in order to perform ota from version to another and works reliably. will let you know once we have this

          • 2. Re: DCT migration issue (3.5.1 to 3.5.2)

            Hi VikramR_26h

             

            Good to know you are working on the issue. Find attached the fix I made that works for internal DCT (there might be some other places to patch though).

            1 of 1 people found this helpful
            • 3. Re: DCT migration issue (3.5.1 to 3.5.2)
              AxLi_1746341

              olivierdufour wrote:

               

              Hi vik86h

               

              Good to know you are working on the issue. Find attached the fix I made that works for internal DCT (there might be some other places to patch though).

              Hi olduc_2170276,

               

              I got below build error with your patch:

              wiced_dct_external_common.c: In function 'wiced_dct_generate_crc_from_flash':

              wiced_dct_external_common.c:174:18: error: array subscript is above array bounds [-Werror=array-bounds]

                                *crc_ptr = 0;

                                ^

               

              I fix it up with below changes (similar to your changes in wiced_dct_internal_common.c) , any chance to review it?

               

              --- wiced_dct_external_common.c.ori    2016-04-29 09:42:57.113396893 +0800

              +++ wiced_dct_external_common.c    2016-04-29 09:42:46.913109892 +0800

              @@ -170,7 +170,7 @@

                                uint32_t*   crc_ptr;

               

                                /* we want the crc32 value to be 0x00 when computing the value! */

              -                 crc_ptr = (uint32_t*)(&temp_buff[(curr_addr - dct_start_addr) + OFFSETOF(platform_dct_header_t, crc32)]);

              +        crc_ptr = (uint32_t*)(&temp_buff[OFFSETOF(platform_dct_header_t, crc32) - (curr_addr - dct_start_addr)]);

                                *crc_ptr = 0;

               

               

              @@ -460,6 +460,7 @@

                        deinit_sflash( sflash_handle );

                        return WICED_ERROR;

                    }

              +     new_hdr->is_current_dct = 1;

               

                    return WICED_SUCCESS;

                }

               

              Thanks.

              • 4. Re: DCT migration issue (3.5.1 to 3.5.2)

                hi axel.lin,

                as I mentionned, my patch ony covers DCT internal, but you can apply it as is for the external DCT as well. I did not perform the patch as I don't use the external DCT, hence I can't test it.

                As far as I can see in the code, it should work, but again I can't test it, so I can't be 100% sure.

                 

                Regards

                1 of 1 people found this helpful