410 CHAPTER 15 Device specifics
J-Link / J-Trace (UM08001) ©
2004-2017 SEGGER Microcontroller GmbH & Co. KG
0x06000000 which represents the 8 option bytes and their complements. You do not
have to care about the option bytes’ complements since they are computated auto-
matically. The following table describes the structure of the option bytes sector:
Note: Writing a value of 0xFF inside option byte 0 will read-protect the STM32.
In order to keep the device unprotected you have to write the key value 0xA5 into
option byte 0.
Note: The address 0x06000000 is a virtual address only. The option bytes are
originally located at address 0x1FFFF800. The remap from 0x06000000 to
0x1FFFF800 is done automatically by J-Flash.
Example
To program the option bytes 2 and 3 with the values 0xAA and 0xBB, but leave the
device unprotected your option byte sector (at addr 0x06000000) should look like as
follows:
For a detailed description of each option byte, please refer to
ST programming man-
ual PM0042, section "Option byte description".
15.16.2.3Securing/unsecuring the device
The user area internal flash of the STM32 devices can be protected (secured) against
read by untrusted code. The J-Flash software allows securing a STM32F10x device.
For more information about J-Flash, please refer to
UM08003, J-Flash User Guide. In
order to unsecure a read-protected STM32F10x device, SEGGER offers two software
components:
•J-Flash
• J-Link STM32 Commander (command line utility)
For more information about J-Flash, please refer to
UM08003, J-Flash User Guide. For
more information about the J-Link STM32 Commander, please refer to
J-Link STM32
Unlock (Command line tool)
on page 152.
Note: Unsecuring a secured device will cause a mass-erase of the internal flash
memory.
15.16.2.4Hardware watchdog
The hardware watchdog of a STM32F10x device can be enabled by programming the
option bytes. If the hardware watchdog is enabled the device is reset periodically if
the watchdog timer is not refreshed and reaches 0. If the hardware watchdog is
enabled by an application which is located in flash and which does not refresh the
watchdog timer, the device can not be debugged anymore.
Address [31:24] [23:16] [15:8] [7:0]
0x06000000 complement Option byte 1 complement Option byte 0
0x06000004 complement Option byte 3 complement Option byte 2
0x06000008 complement Option byte 5 complement Option byte 4
0x0600000C complement Option byte 7 complement Option byte 6
Table 15.1: Option bytes sector description
Address [31:24] [23:16] [15:8] [7:0]
0x06000000 0x00 0xFF 0x5A 0xA5
0x06000004 0x44 0xBB 0x55 0xAA
0x06000008 0x00 0xFF 0x00 0xFF
0x0600000C 0x00 0xFF 0x00 0xFF
Table 15.2: Option bytes programming example