AN694 SILABS [Silicon Laboratories], AN694 Datasheet - Page 7

no-image

AN694

Manufacturer Part Number
AN694
Description
WRITING TO FLASH FROM FIRMWARE ON SiM3XXXX DEVICES
Manufacturer
SILABS [Silicon Laboratories]
Datasheet
4.7. Example Code Implementation Notes
The FLASHCTRL example code that is installed with the Precision32 SDK contains functions that can be copied
and pasted into applications. These functions can be modified as needed but should be used as a starting point for
Flash write and erase operations.
5. Flash Write and Erase Guidelines
The following guidelines are strongly recommended for any system containing routines that write or erase Flash
from code.
5.1. Voltage Supply Maintenance and the Voltage Supply Monitor
The following sections show how to enable the voltage supply monitor, enable the voltage supply monitor as a
reset source, and enable the high threshold setting where applicable using both HAL and non-HAL methods on
various device families.
5.1.1. SiM3Cxxx/SiM3U1xx/SiM3L1xx Devices
Enable voltage supply monitor:
Enable voltage supply monitor as a reset source:
Enable the high voltage monitor threshold:
10. Write the multiple lock value to KEY (0x5A).
11. Enable interrupts.
1. If the system power supply is subject to voltage or current “spikes”, add sufficient transient protection
2. If the device has a minimum voltage supply rise time specification, ensure that it is met. If the system
3. Enable the on-chip voltage supply monitor and enable the voltage supply monitor as a reset source as
4. As an added precaution, explicitly enable the voltage supply monitor and enable the voltage supply monitor
5. Ensure that all writes to the RESETEN register explicitly set the VMONREN bit to a 1. Areas to check are
6. If the device has a high and low threshold setting for the voltage supply monitor, enable the high setting.
devices to the power supply to ensure that the supply voltages listed in the Absolute Maximum Ratings
table in the device data sheet are not exceeded.
cannot meet the rise time specification, add an external voltage supply brownout circuit to the RESETb pin
of the device that holds the device in reset until the voltage supply reaches the VDD High Supply Monitor
Threshold and re-asserts RESETb if the voltage supply drops below the VDD High Supply Monitor
Threshold.
early in code as possible. This should be the first set of instructions executed after the Reset Vector. For C-
based systems, this will involve modifying the startup code in the Precision32 HAL. Ensure that there are
no delays in software between enabling the voltage supply monitor and enabling the voltage supply
monitor as a reset source.
as a reset source inside the functions that write and erase Flash memory. The voltage supply monitor
enable instructions should be placed at the beginning of the Flash write and erase functions.
initialization code, which enables other reset sources, such as the Missing Clock Detector or Comparator,
and instructions that force a Software Reset. A global search on “RESETEN” can quickly verify this.
SI32_VMON_0->CONTROL.VMONEN = 1; // non-HAL
SI32_VMON_A_enable_vdd_supply_monitor(SI32_VMON_0); // HAL
SI32_RSTSRC_0->RESETEN.VMONREN = 1; // non-HAL
SI32_RSTSRC_A_enable_vdd_monitor_reset_source(SI32_RSTSRC_0); // HAL
Rev. 0.1
AN694
7

Related parts for AN694