ST STM32F0
This article describes device specifics of the ST STM32F0 series devices.
Option Byte Programming in J-Flash
J-Flash supports programming of the option bytes for STM32F0 devices. In order to program the option bytes simply choose the appropriate Device, which allows option byte programming, in the CPU settings tab (e.g. STM32F030CC (allow opt. bytes) ). J-Flash will allow programming a virtual 16-byte sector at address 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 automatically. The following table describes the structure of the option bytes sector:
Address | [31:24] | [23:16] | [15:08] | [07:00] |
---|---|---|---|---|
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 |
Note: Writing a value of 0xFF inside option byte 0 will read-protect the STM32F0. In order to keep the device unprotected you have to write the key value 0xAA 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:
Address | [31:24] | [23:16] | [15:08] | [07:00] |
---|---|---|---|---|
0x06000000 | 0x00 | 0xFF | 0x55 | 0xAA |
0x06000004 | 0x44 | 0xBB | 0x55 | 0xAA |
0x06000008 | 0x00 | 0xFF | 0x00 | 0xFF |
0x0600000C | 0x00 | 0xFF | 0x00 | 0xFF |
For a detailed description of each option byte, please refer to ST reference manual RM0091, section "Option bytes".
Securing/unsecuring the device
Please refer to the generic wiki-article: STM32#MCU_Security