I hope you are pointing to this piece of code:
if (platform_write_flash_chunk(curr_dct + OFFSETOF(platform_dct_data_t, dct_version) + OFFSETOF(platform_dct_version_t, initial_write), &zero_byte, sizeof( zero_byte )) != 0)
It is not a bug.
Hello riya and thank you for your time!
My question is that in that particular function (wiced_dct_finish_new_dct) the variable curr_dct is only defined when the macro DCT_BOOTLOADER_CRC_IS_IN_HEADER is not defined.
Therefore, the code block you mentioned should be in the previous #if !defined(DCT_BOOTLOADER_CRC_IS_IN_HEADER) block (starts at line 609), since it uses that variable.
1 of 2 people found this helpful
Sorry for not giving the entire explanation earlier.
CRC is included in header(platform_dct_header_t) in SDK version prior to Wiced 3.6.3. After SDK 3.7.0, CRC is moved to version (platform_dct_version_t) section. So all the recent versions have CRC in version. Hence the macro DCT_BOOTLOADER_CRC_IS_IN_HEADER is not defined in the current version. Hence the variable curr_dct will always be declared. Consequently the other part of the code you are pointing will also work.
One more point, if we compare the function wiced_dct_finish_new_dct() in wiced_dct_internal_common.c and wiced_dct_external_common.c file, it appears that curr_dct should not be declared in the #if - #endif block. (I will discuss this internally and update you if we incorporate this change)
Hello Riya and thank you,
This is very relevant to my situation, since we are upgrading our firmware from WICED version 3.5.2 (UPDATE_FROM_SDK=3_5_2) to the latest one!
I see that this is still an issue with version 6.1 of the SDK