Difference between revisions of "ST STM32F4"

From SEGGER Wiki
Jump to: navigation, search
(Via J-Flash)
Line 1: Line 1:
 
== Option byte programming ==
 
== Option byte programming ==
The STM32F4 series devices provide some option bytes which allow some "permanent" configuration as well as readout protection for the device. Unfortunately, the option bytes become effective immediately when programmed. This means when enabling the read protection of the device via option bytes, the programmer will
+
The STM32F4 series devices provide some option bytes which allow some "permanent" configuration as well as readout protection for the device. Unfortunately, the option bytes become effective immediately when programmed. This means when enabling the read protection of the device via option bytes, the programmer will immediately lose the access to the flash, without any possibility to verify the complete flash operation. Therefore, the option bytes cannot be programmed as part of the flash image. The sequence, to program the option bytes consists of multiple read / write accesses to special function registers of the STM32F4 MCU.
immediately lose the access to the flash, without any possibility to verify the complete flash operation. Therefore, the option bytes cannot be programmed as part of the flash image.
 
via J-Flash
 
 
=== Via J-Flash===
 
=== Via J-Flash===
  +
In order to program the option bytes, some exit-steps need to be added to the J-Flash project. The exit steps will be executed at the end of an successful auto-programming process (''Target -> Auto''). The option byte values are transmitted in the step which writes the ''OPTCR''. J-Flash comes with an example project for the STM32F405OE which demonstrates how to program the option bytes. These steps can be adapted for all STM32F2 / F4 devices since they are compatible regarding option byte programming. Example project: [[File:STM32F405OE_OptBytes.jflash]]<br>
In order to program the option bytes, some exit-steps need to be added to the J-Flash project:
 
  +
[[File:Wiki-STM32F4_OptionByteProg.png]]
''J-Flash project settings -> MCU -> Exit Steps''
 
<table>
 
<tr>
 
<td valign="top">[[File:Wiki-STM32F4_OptionByteProg]]</td>
 
<td valign="top"></td>
 
<td valign="top">asd</td>
 
</tr>
 
</table>
 
The exit steps will be executed right after ''Target -> Auto'' has been issued to program the opened data file.
 
 
The option byte values are transmitted in the step which writes the OPTCR. J-Flash comes with an example project for the STM32F405OE which demonstrates how to program the option bytes. These steps can be adapted for all STM32F2 / F4 devices since they are identical. The example can be found by selecting Create project from template, navigating to the ST folder and select STM32F405OE_OptBytes.jflash .
 

Revision as of 10:17, 14 June 2016

Option byte programming

The STM32F4 series devices provide some option bytes which allow some "permanent" configuration as well as readout protection for the device. Unfortunately, the option bytes become effective immediately when programmed. This means when enabling the read protection of the device via option bytes, the programmer will immediately lose the access to the flash, without any possibility to verify the complete flash operation. Therefore, the option bytes cannot be programmed as part of the flash image. The sequence, to program the option bytes consists of multiple read / write accesses to special function registers of the STM32F4 MCU.

Via J-Flash

In order to program the option bytes, some exit-steps need to be added to the J-Flash project. The exit steps will be executed at the end of an successful auto-programming process (Target -> Auto). The option byte values are transmitted in the step which writes the OPTCR. J-Flash comes with an example project for the STM32F405OE which demonstrates how to program the option bytes. These steps can be adapted for all STM32F2 / F4 devices since they are compatible regarding option byte programming. Example project: File:STM32F405OE OptBytes.jflash
Wiki-STM32F4 OptionByteProg.png