Difference between revisions of "ST STM32F3"

From SEGGER Wiki
Jump to: navigation, search
Line 1: Line 1:
 
__TOC__
 
__TOC__
  +
== Option byte programming ==
 
  +
= 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 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.
 
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 ===
 
  +
== 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 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"
 
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]]
 
[[File:STM32F303VC_OptBytes.jflash]]
  +
  +
= Samples =
  +
  +
== Tracing ==
  +
  +
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
  +
  +
=== 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, [https://www.segger.com/embedded-studio.html SEGGER Embedded Studio] can be used.
  +
  +
[[Media:ST_STM32F303_EVAL_Trace_Example.zip | ST_STM32F303_EVAL_Trace_Example.zip ]]
  +
  +
'''Note:''' The example is shipped with a compiled .JLinkScriptfile, should you need the original source it can be requested at [mailto:support@segger.com support@segger.com]
  +
  +
To create your own .JLinkScriptfile you can use the following project as reference: [https://wiki.segger.com/Tracing_on_ST_STM32F407_(SEGGER_Cortex-M_Trace_Reference_Board) Tracing on SEGGER_Cortex-M_Trace_Reference_Board]
  +
  +
=== Tested Hardware ===
  +
[[File:STM32F303_EVAL.jpg|none|thumb|STM3303F-EVAL Rev.C]]
  +
  +
== RTT ==
  +
  +
SEGGER's [[RTT]] can be used with a J-Link connected to a STM32F303 MCU.<br>
  +
For a sample [[Embedded Studio]] project, refer to the following .zip archive:<br>
  +
  +
[[Media:ST_STM32F303_EVAL_RTT.zip | ST_STM32F303_EVAL_RTT.zip ]]
  +
  +
'''Note''': 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
  +
|}

Revision as of 09:13, 25 September 2019

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

Samples

Tracing

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

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.

ST_STM32F303_EVAL_Trace_Example.zip

Note: The example is shipped with a compiled .JLinkScriptfile, should you need the original source it can be requested at support@segger.com

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

Tested Hardware

STM3303F-EVAL Rev.C

RTT

SEGGER's RTT can be used with a J-Link connected to a STM32F303 MCU.
For a sample Embedded Studio project, refer to the following .zip archive:

ST_STM32F303_EVAL_RTT.zip

Note: 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