DCT migration issue (3.5.1 to 3.5.2)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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.

0 Likes
1 Solution
Anonymous
Not applicable

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

View solution in original post

4 Replies
VikramR_26
Employee
Employee
25 sign-ins 10 sign-ins 10 comments on KBA

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

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi vik86​h

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).

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 olivierdufour​,

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.

0 Likes
Anonymous
Not applicable

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