In WICED Smart, it supports two types of storage to store application image and data:
The storage is divided into different section (partition) based on different purpose and function.
There are three types of section:
User can select different type and size of storage, so we need to do the following configuration based on requirements:
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:
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:
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”
“ota_secure_firmware_upgrade-BCM920737TAG_Q32 PLATFORM_NV=SFLASH download”.
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:
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:
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)
Figure 4: Application Image’s Sections
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:
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:
Besides the common configuration in above chapter “Configure Section Layout”, we still need to do more configurations
I understood external memory size is required 32KB for user application, it is also required additional 32KB for f/w upgrade. Moreover, if 128KB EEPROM is used, 64KB upper address can be accessed by using second slave address.
However, I am somewhat confused in using serial flash of 1Mbit(128KB) or 4Mbis(512KB) size.
If 128KB or 512KB serial flash is used and the serial flash supports for 24 bit addressing, user is possible to access whole space from 64KB upper of 128KB or 512KB so as to store user data? If to do so, serial driver in SDK should be modified? Otherwise, it can be used without modification of serial driver?
1)As I understand, 24bits addressing can access 16M Byte space. should no problem to access whole space of 128KBypte or 512KByte serial flash.
2)Check Broadcom BLE chip datasheet for supported EEPROM or serial flash, for example of 20736:
Native support for the Microchip® 24LC128, Microchip 24AA128, and ST Micro® M24128-BR is included.
Serial Flash Interface
Devices natively supported include the following:
3)Consult with Broadcom or distributors if what you will use is not in the list.
4)EEPROM or serial driver may need modification when new EEPROM/serial flash introduced.
In the EEPROM Section Layout, Is there an error with the size of SS2 (256b @ 0x100)? If SS2 is really 256 bytes, then it should end at 0x200 which overlaps with VS1 which starts at 0x140?
The ws_upgrade.c files included in Broadcom's WICED Smart SDK indicate that at least when OTA firmware support is used, the length of the SS sections is 40 instead of 256 bytes:
#define WS_UPGRADE_SS_LENGTH 40 // SS is always 40 bytes long.
This suggests that on OTA EEPROM configurations, SS2 actually ends at 0x128, leaving 24 unused bytes before the start of VS1.