From SEGGER Wiki
Jump to: navigation, search

Option byte programming

The STM32F3 series devices provide some option bytes which allow some "permanent" configuration as well as readout protection for the device. The option bytes become effective after a reset, or, if the read protection is set while a debugger is still connected through JTAG/SWD, become effective after a power-on-reset. The sequence, to program the option bytes consists of multiple read / write accesses to special function registers of the STM32F3 MCU.

Via J-Flash / Flasher ARM

The sequence to program the option bytes, needs to be added to the exit-steps of the J-Flash project. The exit steps will be executed at the end of an successful auto-programming process (Target -> Auto). This sequence applies for all STM32F3 devices since they are compatible regarding option byte programming and can be adapted to fit custom requirements. The sequence shipped with the J-Flash project linked below sets the Read-Out-Protection (ROP) to level 1. In order to set RDP to level 2, to line commented with "Write new RDP value (RDP = 1)" needs to be changed to "Write 16bit Value: 33CC"

File:STM32F303VC OptBytes.jflash


This section describes how to get started with trace on the ST STM32F303 MCU. This section assumes that there is already a basic knowledge about trace in general (what is trace, what different implementations of trace are there, etc.). If this is not the case, we recommend to read Trace chapter in the J-Link User Manual (UM08001). The ST STM32F303 MCU implements tracing via pins, so a J-Trace can be used for tracing.

Minimum requirements

In order to use trace on the ST STM32F303 devices, the following minimum requirements have to be met:

  • J-Link software version V6.30h or later
  • Ozone V2.56e or later (if streaming trace and / or the sample project from below shall be used)
  • J-Trace PRO for Cortex-M HW version V1.0 or later

To rebuild the project our IDE Embedded Studio can be used. The recommended version to rebuild the projects is V6.30. But the examples are all prebuild and work out-of-the box with Ozone, so rebuilding is not necessary.

Sample project

Streaming trace

The following sample project is designed to be used with J-Trace PRO and Ozone to demonstrate streaming trace. The project has been tested with the minimum requirements mentioned above and a STM3303C-EVAL Rev.C Evalboard. The sample project comes with a pre-configured project file for Ozone that runs out-of-the box. In order to rebuild the sample project, SEGGER Embedded Studio can be used.

The example is shipped with a compiled .JLinkScriptfile, should you need the original source, please get in touch with SEGGER directly via our support system:

To create your own .JLinkScriptfile you can use the following project as reference: Tracing on SEGGER_Cortex-M_Trace_Reference_Board

Tested Hardware



SEGGER's RTT can be used with a J-Link connected to a STM32F3 target device.

Sample project

For a sample Embedded Studio project, refer to the following .zip archive:

The above project was tested with the following setup:
Target device STM32F303RE
Evalboard NUCLEO-F303RE (ST)
J-Link software version V6.51b
Embedded Studio version V4.18

Tested Hardware