English
Language : 

AN694 Datasheet, PDF (1/10 Pages) Silicon Laboratories – WRITING TO FLASH FROM FIRMWARE ON SiM3XXXX DEVICES
AN694
WRITING TO FLASH FROM FIRMWARE ON SiM3XXXX DEVICES
1. Introduction
This application note applies to the SiM3Cxxx, SiM3Uxxx, and SiM3Lxxx device families. The Flash memory on all
Silicon Labs MCU devices is readable and writable from application code. This capability allows user software to
store values, such as calibration constants or system parameters, to the Flash and to implement a boot-loading
feature in which user firmware can be updated in-system from a remote site. The Flash that is not used by
application code can be treated like an EEPROM, thus negating the need to connect an external EEPROM to the
device.
This document starts with the basics of accessing Flash from application code on any device, including device-
specific details. Then, it discusses advanced routines that can be developed from the basic routines. Finally, it
describes precautions to take when writing or erasing Flash. Example code for the basic routines for all devices is
installed with the Precision32 SDK, which can be downloaded from www.silabs.com/32bit-software.
2. Key Points
The voltage supply monitor must be enabled in the VMONn module during Flash write and erase
operations.
The voltage supply monitor must be enabled as a reset source in the RSTSRCn module during Flash write
and erase operations.
Note:Any write or erase operations initiated while the voltage supply monitor is disabled or the voltage supply monitor is
disabled as a reset source will be ignored.
A Lock and Key sequence must be executed before executing a write or erase operation. The Flash
interface can be unlocked for one or multiple write or erase operations.
Writes to the WRDATA register while the Flash interface is locked or an incorrect unlock sequence will
permanently lock the Flash interface until the next device reset.
Firmware should disable interrupts when writing or erasing Flash to ensure the Flash interface accesses are
sequential in time and take the minimum time possible.
For all Flash write operations, firmware will stall unless operating from a memory space other than Flash.
Interrupts posted during a Flash write or erase operation will be held pending until the completion of the
Flash operation, after which they will be serviced in priority order.
Rev. 0.1 9/12
Copyright © 2012 by Silicon Laboratories
AN694