Understanding for embedding OTA function

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

cross mob
HiIw_4620611
Level 3
Level 3
10 replies posted 5 replies posted 5 questions asked

Hello.

When incorporating OTA functions into application creation,

Please teach me specific procedures and mechanisms for understanding.

  • The target MPU is STM32F412 (ROM: 1MB / RAM: 256KB), with an external 4MB sflash.
  • The operation of OTA to be implemented is as follows.

a). Download directly to APP0 of external flash in user application, check VALID, and rewrite DCT.

b). After the reboot, update the firmware according to the DCT settings.

Q1. Does the example described in WICED-OTA.pdf and WICED-WAF.pdf, correct with the following understanding?

  1. After reset start, main of waf/bootloader/bootloader.c starts from crt0.
  2. Read boot information from DCT by wiced_dct_read_with_copy() function.
  3. When it is determined from the DCT boot information that there is an application update, the OTA-APP is deployed in RAM. (WICED-WAF.pdf 2.1)
  4. Jump to entry point in boot information's.

Q2. The wiced_waf_app_load () function can be considered as processing to deploy the application from external/internal flash and RAM to external/internal flash and RAM.

Are the parameters to be given to load_details_t the following?

  • .id: Means copy source type ... <NONE>, <INTERNAL>, <EXTERNAL_FIXED_LOCATION>(external sflash), or <EXTERNAL_FILESYSTEM_FILE>(It is Invalid, because BOOTLOADER_LOAD_MAIN_APP_FROM_FILESYSTEM is undefined)
  • .detail.internal_fixed: { .location=<source address>, .size=<source size> }

Q2-1.How to specify when the extract destination is RAM?

Q3. Q2's parameters are considered to be included in the DCT boot information (DCT_INTERNAL_SECTION, platform_dct_header_t).

Can this DCT rewrite be done with wiced_framework_set_boot() function?

Q4. In the following generally method, Is there no problem with the way in thinking of a).?

wiced_framework_app_open( DCT_APP0_INDEX, &app );

wiced_framework_app_erase( &app );

wiced_framework_app_set_size( &app, app_size );

while ( eof )

{

    wiced_framework_app_write_chunk( &app, p_data, chunk_size );

}

for ( result = CRC32_INIT_VALUE, offset = 0; offset < app_size; offset += chunk_size )

{

    wiced_framework_app_read_chunk( &app, offset, p_data, chunk_size );

    result = crc32( p_data, chunk_size, result );

}

wiced_framework_app_close( &app );

if ( result == valid )

{

    wiced_framework_set_boot( DCT_APP0_INDEX, WICED_FRAMEWORK_LOAD_ONCE );

    wiced_framework_reboot( );

}

メッセージ編集者: Hiroyuki Iwasaki I wanted to get some answers, so translated it into English. Thank you.

1 Solution
HirotakaT_91
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

A1.1. Yes, it starts from _start() of the crt0_GCC.c based on the core that is used.

A1.2-4. Yes

A2. Yes.

Regarding the deploying to RAM, the implementation in WICED uses an external Flash by defaut and modifications such as deploying destination in RAM hasn't been tested. Please let us know if you face any issues while testing this out and we will try to debug the issue.

A3. The wiced_framework_set_boot() function is used to set the index of the APP that needs to be used on BOOT. An example of how to reqrite the contents of DCT has been provided at /43xxx_Wi-Fi/apps/snip/dct_read_write

A4. This is an enhancement which isn't present by default with the OTA implementation. Please feel free to implement this and try it out and do let us know if you face any issues during the implementation.

Best regards,

Hirotaka

View solution in original post

0 Likes
3 Replies