- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Overview
In WICED Smart, it supports two types of storage to store application image and data:
- EEPROM
- SFLASH (Serial Flash)
The storage is divided into different section (partition) based on different purpose and function.
There are three types of section:
- SS (Static Section)
- Store Configuration Data, etc.
- VS (Volatile Section)
- Store the data which may be modified frequently. Ex. paring information or application’s private data.
- DS (Data Section)
- Store application’s executable binary image built from source codes.
User can select different type and size of storage, so we need to do the following configuration based on requirements:
- Storage type
- Section layout (offset and size).
Notes:
- In this document, all of the examples are based on WICED Smart SDK 2.1.0.
Configure Storage Type
The default storage type is defined by variable PLATFORM_NV in the platform’s makefile as shown in Figure 1.
File: BCM920737TAG_Q32.mk (WICED-Smart-SDK\Platforms\BCM920737TAG_Q32) |
CHIP := 20737 … PLATFORM_NV ?= EEPROM PLATFORM_STORAGE_BASE_ADDR := 0xFF000000 PLATFORM_BOOTP := 20737_$(PLATFORM_NV).btp … |
Figure 1: Storage Type Configuration
The file path of platform’s makefile is as below:
WICED-Smart-SDK\Platforms\[PLATFORM]\[PLATFORM].mk
We can specify the storage type in the platform makefile directly as shown above, or specify the storage type by added the parameter in the make target as below:
PLATFORM_NV=EEPROM|SFLASH
For example, in application “ota_secure_firmware_upgrade”, its default make target is “ota_secure_firmware_upgrade-BCM920737TAG_Q32 download”. If want to change the storage type to SFLASH, we just need to add the parameter “PLATFORM_NV=SFLASH” behind “ota_secure_firmware_upgrade-BCM920737TAG_Q32”. It is like
“ota_secure_firmware_upgrade-BCM920737TAG_Q32 download PLATFORM_NV=SFLASH”
or
“ota_secure_firmware_upgrade-BCM920737TAG_Q32 PLATFORM_NV=SFLASH download”.
Configure Section Layout
There should be at least two sections (SS and DS) in an application image. Both of them should be flashed into storage. We need specify the location which these two sections should be flashed into. And we also need to configure a VS section to store user data.
The file to configure the section layout is defined in the variable PLATFORM_BOOTP in the platform’s makefile as shown in Figure 1.
We call this file as BTP file. Its path is “WICED-Smart-SDK\Platforms\[PLATFORM]\[PLATFORM_BOOTP]”.
In the BTP file, user can configure the following parameters based on their requirement:
- ConfigDSLocation
- DS location, use to indicate which location the DS should be downloaded into storage by UART. In other word, it is the start address of a DS in storage.
- DLConfigSSLocation
- SS location, use to indicate which location the SS should be downloaded into storage by UART. In other word, it is the start address of a SS in storage.
- DLConfigVSLocation
- VS Start Address
- DLConfigVSLength
- VS Total Length
The EEPROM’s configuration is shown in Figure 2.
File: 20737_EEPROM.btp (WICED-Smart-SDK\Platforms\BCM920737TAG_Q32) |
… DLConfigVSOffset = 0 ConfigDSLocation = 1408 DLConfigSSLocation = 0 … DLConfigVSLocation = 320 DLConfigVSLength = 1024 … |
Figure 2: EEPROM Section Configuration
The SFLASH’s configuration is shown in Figure 3.
File: 20737_SFLASH.btp (WICED-Smart-SDK\Platforms\BCM920737TAG_Q32) |
… DLConfigVSOffset = 0 ConfigDSLocation = 16384 DLConfigSSLocation = 0 … DLConfigVSLocation = 8192 DLConfigVSLength = 4096 … |
Figure 3: SFLASH Section Configuration
After built an application, it generates an Intel HEX file used to indicate what data is flashed and how to flash the data into storage by UART. For Intel HEX format, you can easy to learn it in internet (ex. http://en.wikipedia.org/wiki/Intel_HEX ).
In the HEX file as shown in Figure 4, we can see application image contains two sections:
- SS
- The start address of the first HEX section is 0x0000, same as the parameter “DLConfigSSLocation” configured in BTP file, as shown in Figure 2. It means that this section will be flashed into SS sections by UART.
- DS
- The start address of the second HEX section is 0x0580, same as the parameter “ConfigDSLocation” configured in BTP file, as shown in Figure 2. It means that this section will be flashed into DS section by UART.
File: ota_secure_firmware_upgrade-BCM920737TAG_Q32-rom-ram-Wiced-release.hex (WICED-Smart-SDK\build\ota_secure_firmware_upgrade-BCM920737TAG_Q32-rom-ram-Wiced-release) |
:02000004FF00FB :28000000010800F000006208C05D89FD0400FFFFFFFF400600DF3D1A7A7320020A008005000040010000000473 :02000004FF00FB :FB058000A21A006C3000001B3300…944F6D6F800F037FA0CF62EBB03B4064F4FF448180549086810B103BC28C5 :FB067B00F678BA03BC28F690BA00…0410AF67EBD38B5054626A104200AF6B0F8FF2028706946042026F690FA73 … |
Figure 4: Application Image’s Sections
Section Layout without OTA Firmware Upgrade Support
If OTA Firmware Upgrade is not supported and the total size of storage is 64 Kbytes, we can draw whole the section layout as below based on the parameters configured in BTP file:
- EEPROM Section Layout
- SFLASH Section Layout
Section Layout with OTA Firmware Upgrade Support
If support OTA Firmware Upgrade, at least, it need one more DS to store the download OTA image, and one more SS to backup the original configuration.
The section layout is as below when the total size of storage is 64 KBytes:
- EEPROM Section Layout
- SFLASH Section Layout
Besides the common configuration in above chapter “Configure Section Layout”, we still need to do more configurations