- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm working on an application based on a custom board that includes external flash memory. Currently, I can manage to read/write from/into this memory, and now I would like to use it for OTA purpose. So, I started to research in the Application Management Functions provided by the framework.
I started with a simple operation which consists of opening several apps and reading their size. Here is the sample code for one application:
/*
* DCT_APP0_INDEX
*/
if( wiced_framework_app_open( DCT_APP0_INDEX, &app ) != WICED_SUCCESS ) {
return WICED_ERROR;
}
if( wiced_framework_app_get_size( &app, ¤t_size ) != WICED_SUCCESS ) {
return WICED_ERROR;
}
if( wiced_framework_app_close( &app ) != WICED_SUCCESS ) {
return WICED_ERROR;
}
WPRINT_APP_DEBUG( ("[D - OTA] Current app size (at DCT_APP0_INDEX)\t\t: %lu bytes\n", (unsigned long)(current_size)) );
The code is the same for every applications. And here is the output:
[D - OTA] Current app size (at DCT_FR_APP_INDEX) : 99913728 bytes
[D - OTA] Current app size (at DCT_DCT_IMAGE_INDEX) : 1965531136 bytes
[D - OTA] Current app size (at DCT_OTA_APP_INDEX) : 1848942592 bytes
[D - OTA] Current app size (at DCT_FILESYSTEM_IMAGE_INDEX) : 852418560 bytes
[D - OTA] Current app size (at DCT_WIFI_FIRMWARE_INDEX) : 2306969600 bytes
[D - OTA] Current app size (at DCT_APP0_INDEX) : 2316611584 bytes
[D - OTA] Current app size (at DCT_APP1_INDEX) : 2360836096 bytes
[D - OTA] Current app size (at DCT_APP2_INDEX) : 2349637632 bytes
As specified in the documentation, wiced_framework_app_get_size is supposed to return the size of an application in bytes format.
/** Returns the current size of the application.
*
* Returns the current size of the application.
*
* @warning The size of the application is always aligned to sector boundaries. Application
* size may be different from actual size on a PC.
*
* @param[inout] app : Application handler.
* @param[out] size : The size allocated to the application in bytes.
*
* @return Wiced reuslt code
*/
As you can see in the output, the function returns very strange values. I wonder if it is a normal behaviour (not yet stable part of SDK), or if it comes from my code.
SDK version : WICED 3.3.1
Microcontroller : STM32F415
External memory chip : AMIC A25L
Thanks in advance for your support !
Solved! Go to Solution.
- Labels:
-
Memory
-
Over The Air Updates (OTA)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you burn the APPS.BIN into the external flash via download_apps ?
otherwise you may get the size incorrect!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you burn the APPS.BIN into the external flash via download_apps ?
otherwise you may get the size incorrect!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello jone
Sorry for the late answer, I'm quite busy with other aspects of my project.
I made another try following your instructions. When I first write some content into external memory, specifying applications and DCT at flash time, it works well !
Thanks for your help.