OTA trouble after OTA to firmware built with SDK-3.5.2

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

cross mob
Anonymous
Not applicable

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.

0 Likes
6 Replies
Anonymous
Not applicable

Hi Sam

Long time, no talk.

^^

0 Likes

I'm battling the exact problem. The first indications of any issues is already present in 3.3.1 and 3.4.0 where new sections was added. This would not affect the bootloader but would require the OTA software to handle the addition of new sections, which could be handled in a few different ways.

The new changes include changes to the struct of the header which the bootloader and even the DCT itself uses to determine which DCT is active. Since the bootloader can not be updated OTA, this is a serious issue.

I currently working on a solution where I create a new custom section in the start of the DCT which only the bootloader will use, this gives us control over the data the bootloader looks at. This requires adding the new section (hence moving the others down), modifying the DCT functions to handle the new section and make sure bootloader only uses the first section. My first tests seems to be working.

Since we have some test devices based on 3.1.2 already deployed, my next task is to be able to push my new bootloader and DCT layout out to these devices. This is going to be a fun problem to solve.

0 Likes
Anonymous
Not applicable

Hello,

We work on OTA upgrade. Our code working fine with SDK 3.1.2 but get problem while using the SDK 3.5.2

We facing same problem.

Have you getting any idea ?

Any help in this case highly appreciated.

Thanks & Regards,

Chintan

0 Likes

Try have a look at the latest releas (WICED 3.7.0). This includes backwards compatibility in the DCT code. Since this implementation is designed and supported by Cypress, it will properly be the best solution.

Regards

René Josefsen

Anonymous
Not applicable

Hello renejos,

From the Wiced Community i find that SDK3.7.0 has lots of bug like mqtt, uart etc. and it takes a lot of time consuming while we shift the SDK from SDK3.5.2 to SDK3.7.0.

So have any update regarding it ???

0 Likes

Hello, currently I have our project running in 3.7.0 and have not seen any issues with uart communication. We do not use the provided OTA system, but still relies on the DCT, so the changes we have seen from 3.3.1 and to now has given us some additional work.

I'm not a part of the cypress development team, so I can give you any details, sorry.

Regards

René Josefsen

0 Likes