ota error

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

cross mob
user_2212361
Level 2
Level 2
First like received First like given Welcome!

Hi

I have been testing the ofa. (WICED OTA Upgrade and Factory Reset (SDK 3.1.2) )

Connected to the otp web server, and the file was opened.

\WICED-SDK-3.3.1\WICED-SDK\build\demo_temp_control-MurataTypeYD\binary\demo_temp_control-MurataTypeYD.stripped.elf

proceeded to "start upgrade".

Receiving the data properly and then came the reboot messages.

But is not a reboot. Press the reset key, but this should not work.

Why does this happen?

Download ota_fr again and had access to a web server. And I've tried downloading progress.

The error occurred in the source below.

wiced_ota_server.c

static int process_upgrade_chunk( ota_http_request_message_t* request, wiced_tcp_stream_t* stream, void* arg )

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

{

       printf("wiced_framework_app_set_size err - file_size:%d  \r\n", file_size );

       return -1;

}

Download ota_fa again and tried to upgrade, but the same error occurs.

What is the reason?

SDK : 3.3.1

serial flash : winbond w25q32bv

0 Likes
12 Replies
Anonymous
Not applicable

Are you trying to use OTA update from SDK 3.3.1 to update application built with SDK 3.3.1?

This should work and has been tested extensively

If you are getting error in that function - can you check the return value?

0 Likes

Hi.

Thank you for having answered.

Are you trying to use OTA update from SDK 3.3.1 to update application built with SDK 3.3.1?

=>  It is not well understood what you said.

       I have been testing a variety of sample code in the SDK 3.3.1.

If you are getting error in that function - can you check the return value?

=>    wiced_result_t result;

        if (wiced_framework_app_open( DCT_APP0_INDEX, &app ) != WICED_SUCCESS)

        {

            printf("wiced_framework_app_open err  \r\n");

            return -1;

        }

        printf("wiced_framework_app_open - app_id:%d, offset:%d, last_erased_sector:%d   \r\n",

                                       app.app_id, app.offset, app.last_erased_sector );

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

        {

            printf("wiced_framework_app_get_size err  \r\n");

            return -1;

        }

        printf("wiced_framework_app_get_size - current_size:%d  \r\n", current_size );

        result = wiced_framework_app_set_size( &app, file_size);

        if ( result != WICED_SUCCESS)

        {

             printf("wiced_framework_app_set_size err[%d] - file_size:%d  \r\n", result, file_size );

            return -1;

        }

Serial messages is shown below. error number : 4

wiced_framework_app_open - app_id:5, offset:0, last_erased_sector:-1

wiced_framework_app_get_size - current_size:0

wiced_framework_app_set_size err[4] - file_size:527152

0 Likes

Hi

serial flash replaced and tftp tested.

Serial messages is shown below.

[TFTP]RRQ

current size 1080156160, request:0

new size 940888064

Writing size 512 from offset 0 [0x7f]

Writing size 512 from offset 512 [0x0]

Writing size 512 from offset 1024 [0x0]

Writing size 512 from offset 1536 [0x0]

Writing size 512 from offset 2048 [0x0]

Writing size 512 from offset 2560 [0x0]

Writing size 512 from offset 3072 [0x0]

Writing size 512 from offset 3584 [0x0]

Writing size 512 from offset 4096 [0x0]

Writing size 512 from offset 4608 [0x0]

Error Writing, err:4

Writing size 512 from offset 5120 [0x0]

Error Writing, err:4

Writing size 512 from offset 5632 [0x0]

Error Writing, err:4

Writing size 512 from offset 6144 [0x0]

Error Writing, err:4

Writing size 512 from offset 6656 [0x0]

Error Writing, err:4

Writing size 512 from offset 7168 [0x0]

Error Writing, err:4

Writing size 512 from offset 7680 [0x0]

Error Writing, err:4

Writing size 512 from offset 8192 [0x0]

After downloading the tftp tested again.

Serial messages is shown below.

current size 0, request:0

Error wiced_framework_app_set_size, err:4, size:527152

Writing size 512 from offset 0 [0x7f]

Error Writing, err:4

Writing size 512 from offset 512 [0x0]

Error Writing, err:4

Writing size 512 from offset 1024 [0x0]

Error Writing, err:4

Writing size 512 from offset 1536 [0x0]

Error Writing, err:4

Writing size 512 from offset 2048 [0x0]

Error Writing, err:4

Writing size 512 from offset 2560 [0x0]

Error Writing, err:4

Writing size 512 from offset 3072 [0x0]

Error Writing, err:4

Writing size 512 from offset 3584 [0x0]

Error Writing, err:4

Please advise why this is the result comes out.

0 Likes
Anonymous
Not applicable

Is this error on the Winbond SFLASH?

0 Likes

SFLASH use W25Q32BV / Winbond.

error message is shown in the tftp sample code.

tftp.c

wiced_result_t snip_tftp_establish( tftp_t* tftp, void* p_user )

{

    uint32_t file_size = tftp->transfer_size;

    uint8_t file_index = get_file_index( tftp->filename );

    if ( file_index == (uint8_t) -1 )

    {

        return WICED_ERROR;

    }

    if ( wiced_framework_app_open( file_index, &app ) != WICED_SUCCESS )

    {

        return WICED_ERROR;

    }

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

    {

        return WICED_ERROR;

    }

   printf( "current size %lu, request:%d \n", current_size, tftp->request );

    if ( tftp->request == TFTP_GET )

    {

       wiced_result_t result;

        result = wiced_framework_app_set_size( &app, file_size );

        if ( result != WICED_SUCCESS )

        {

            printf( "Error wiced_framework_app_set_size, err:%d, size:%d \n", result, file_size );

            return WICED_ERROR;

        }

        result = wiced_framework_app_get_size( &app, &current_size );

        if ( result != WICED_SUCCESS )

        {

            printf( "Error wiced_framework_app_get_size, err:%d \n", result );

            return WICED_ERROR;

        }

    }

    else

    {

        if ( current_size == 0 )

        {

            return WICED_ERROR;

        }

    }

    offset = 0;

   printf( "new size %lu\n", current_size );

    return WICED_SUCCESS;

}

wiced_result_t snip_tftp_write( tftp_t* tftp, uint8_t* data, void* p_user )

{

    printf( "Writing size %d from offset %lu [0x%x] \r\n", tftp->block_size, offset, data[ 0 ] );

    wiced_result_t result = wiced_framework_app_write_chunk( &app, data, tftp->block_size );

    if ( result != WICED_SUCCESS )

    {

        printf( "Error Writing, err:%d \n", result );

    }

    offset += tftp->block_size;

    return WICED_SUCCESS;

}

0 Likes
Anonymous
Not applicable

I have same issue .

So, I need this issue solution.

This issue is not resolved?

0 Likes
Anonymous
Not applicable

Can you please try a newer SDK?

0 Likes
Anonymous
Not applicable

I'm used SDK version is 3.3.1

3.5.2 SDK is error fixed?

0 Likes
Anonymous
Not applicable

I am not sure, but this error on 3.3.1 has not been reported by any other customer. Hence would suggest to see if you can try 3.5.2 first

0 Likes
Anonymous
Not applicable

I,m used SSBWMN01 borad check.

USI BM30 board is normal operation

but, SSBWMN01 board error operation.

0 Likes
Anonymous
Not applicable

Then please work with SPIL and Exceltech to make sure there is no HW issue here on their board

0 Likes
Anonymous
Not applicable

SPIL platform file support (SSBWMN01.mk) apply.

And, snip.tftp app is normal operation.

but, i'm make apps apply tftp routine.

ota issue is same.

It added more questions to below test sequence result different.

1. snip.tftp download download_apps run -> tftp download my test app-> normal behavour

-> reboot run my app-> tftp download -> normal behavour

2. my app download download_apps run -> tftp download -> error and not update

Writing size 512 from offset 4096 [0x0]

Writing size 512 from offset 4608 [0x0]

Error Writing, err:4

error offset is always 4608.

First ota/tftp app download -> my apps dowload(ota/tftp) -> my app run -> ota/tfpt run is normal behavour.

But, my app download-> ota/tftp run is error.

I would like to know how to look at any part.

0 Likes