Programming stm32 in C. ARM

This article, which is another “quick start” in mastering ARM controllers, will perhaps help you take the first steps in mastering 32-bit ARM controllers based on the Cortex-M3 core - STM32F1xxx series. Perhaps this article (which appears on this topic like mushrooms after rain) will be useful for someone.

Introduction

Why ARM?
1. There are plenty to choose from ( by different manufacturers Today more than 240 ARM controllers are produced)
2. Low price(for example, for $1 you can get 37xI/O, 16K Flash, 4K RAM, 2xUART, 10x12bitADC, 6x16bitPWM).

Let's start our work with controllers from ST Microelectronics. Controllers based on the ARM Cortex-M3 core are characterized by a wide range of peripherals, high level performance, low price
P.S. At the very beginning, it seems that ARMs are some kind of terrible creatures (in soldering, wiring, programming). But this is only at first glance :) and you will see this for yourself.

So, we will study ARMs using the example of STM32F1 controllers. At the same time, this series has several lines:

  • Value line STM32F100 - 24 MHz CPU, motor control, CEC.
  • Access line STM32F101 - 36 MHz CPU, up to 1 MB Flash
  • USB access line STM32F102 - 48 MHz CPU with USB FS
  • Performance line STM32F103 - 72 MHz, up to 1 MB Flash, motor control, USB, CAN
  • Connectivity line STM32F105/107 - 72 MHz CPU, Ethernet MAC, CAN, USB 2.0 OTG

There is also the following classification:

STM32 controllers can be forced to boot from 3 memory areas (depending on the state of the BOOT0 and BOOT1 pins when the controller starts or after it is reset). You can write a program to the controller memory in the following ways:

1 way:
Using the bootloader (it is already written to system memory) and USART1(USART2 remaped): Uses internal 8 MHz clock signal. To launch the built-in bootloader hardwired into the controller by the manufacturer, you just need to throw a signal from the RS232-3.3V converter (for example, based on FT232RL) onto the paws of the controller TX1, RX1 and before that set BOOT0 = 1 and BOOT1 = 0, press RESET and we can sew the program in controller. And it is sewn up in Flash program Loader Demonstartor by STM (for Windows).

PS. If you are running LINUX and do not have a discovery-type debugging board, you can upload the firmware to the controller via everyone’s favorite rs-232 (actually, via the rs-232-3.3V converter). To do this, you need to use a python script (Ivan A-R) (for LINUX or MACOSX).
To begin, you must have Python 2.6 installed and a library for working with serial port- PySerial library.
Now, in order to run the stmloader.py script (from the terminal, of course), you need to tweak it a little to suit your computer: open it in a text editor.
Recruiting at command line
~$ dmesg | grep tty
to see everything serial ports PC.
and after typing...
~$ setserial -g /dev/ttyS
we find out the path to our 232nd port. If the system complains about setserial, install it
~$ sudo apt-get install setserial
we find out the path to our physical port (for example, mine is /dev/ttyS0). Now you need to write this path to the stm32loader.py script file instead of the default “/dev/tty.usbserial-...”. Type in the terminal
~$ python stm32loader.py -h
...to call for help and upload the firmware to our controller.

Method 2:
Via USB OTG using DFU mode requires an external quartz at 8 MHz, 14.7456 MHz or 25 MHz (not all controllers with USB OTG have this bootloader; you need to carefully look at the labeling of your controller)

3 way:
JTAG/SWD. Well, for those who have a Discovery-type demo board or a home-made JTAG/SWD programmer, you can upload the code and already debug your microcontroller in this way. For JTAG, the microcontroller has 6 legs (TRST, TDI, TMS, TCK, TDO, RST) + 2 for power. SWD uses 4 signals (SWDIO, SWCLK SWO, RESET) and 2 for power.

PS. In the EAGLE environment, I sketched out several blank circuits for 48, 64 and 100-leg controllers (eagle folder), and stm32loader contains the script stm32loader.py

It is best to start getting acquainted with any thing with instructions. In some cases everything is clear and so, in others - “hmm, nothing works, it looks like you still need to read the instructions.” Microcontrollers are quite complex devices, and you certainly can’t do anything useful with them without reading the documentation, although...

After some AVRs, you may experience a slight shock at the number of different PDFs for STM32 microcontrollers. Where to look first? How to use it? What's going on anymore?? At first glance, nothing is clear. Therefore, I decided to make a small overview of the world of documentation for these wonderful microcontrollers. I will place special emphasis on the STM32F103C8T6, since I plan to write several lessons on using this particular stone.

The main documents for STMs are the following:

  1. Datasheet
  2. Reference manual
  3. Programming Manual
  4. Errata Sheet

Datasheet

The Datasheet contains information about the presence of certain peripherals in a particular MK, pinout, electrical characteristics and markings of chips for STM32F103x8 and STM32F103xB, that is, for these ones, which are circled in a red rectangle:

Quite simply, one datasheet for 8 microcontrollers.

Basics of the Datasheet

First of all, you need to pay attention to the section 7.Ordering information scheme, in which it is indicated, then stands for each character in the marking. For example, for STM32F103C8T6: LQFP-48 package, 64Kb flash, temperature range –40 to 85 °C.

The main difference between microcontrollers from different columns is the number of legs and the volume of flash, everything else is the same. A small exception is the first version column Tx: These microcontrollers have fewer SPI, I2C and USART modules. Peripheral numbering starts from one: that is, if in STM32F103 Cx we have 2 SPIs, then they have the names SPI1 and SPI2, and in STM32F103 Tx We only have SPI1. Since we have a Datasheet for the STM32F103x8 and STM32F103xB microcontrollers, this table is valid only for these models. For example STM32F103 C8 or STM32F103 C.B. correspond to this table, and STM32F103 C6 no, there is a separate datasheet for it.

In the section 2.2 Full compatibility throughout the family it is said that STM32F103xx devices are software, functional and pin-to-pin (for the same cases) compatible.

In the reference manual there is a division into the following “types” of microcontrollers: STM32F103x4 and STM32F103x6 are designated as low-density devices , STM32F103x8 and STM32F103xB as medium-density devices , STM32F103xC, STM32F103xD and STM32F103xE as high-density devices . Low-density devices have less Flash and RAM memory, timers and peripherals. High-density devices have more Flash and RAM memory, and also have additional peripherals such as SDIO, FSMC, I2S and DAC, while remaining fully compatible with other members of the STM32F103xx family. That is, if at some stage of development it became clear that the selected microcontroller is not enough to implement all the capabilities, then you can safely choose a more sophisticated stone without having to rewrite all the existing software, and if the new stone is in the same case, then There is no need to re-wire the printed circuit board.

Reference manual

Let's move on. Reference manual contains detailed description all peripherals, registers, offsets, and so on. This is the main document that is used when creating firmware for a microcontroller. The Reference manual is compiled for a large group of microcontrollers, in our case for all STM32F10xxx, namely STM32F101xx, STM32F102xx, STM32F103xx and STM32F105xx/STM32F107xx. But STM32F100xx are not included in this RM, there is one for them.

The main thing in the Reference manual

As mentioned above, in the reference manual there is a division into the following “types” of microcontrollers: low-, medium-, high-density and connectivity
line. IN 2.3 Glossary explained who is who:

  • Low-density devices These are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers whose Flash memory size is between 16 and 32 Kbytes.
  • Medium-density devices these are STM32F101xx, STM32F102xx and STM32F103xx, flash memory sizes between 64 and 128 Kbytes.
  • High-density devices these are STM32F101xx and STM32F103xx, flash memory sizes between 256 and 512 Kbytes.
  • XL-density devices these are STM32F101xx and STM32F103xx, flash memory sizes between 768 Kbytes and 1 Mbyte.
  • Connectivity line devices These are microcontrollers STM32F105xx and STM32F107xx.

Our STM32F103C8T6 is a Medium-density device. This will be useful to know when studying peripherals, for example, there are separate sections about RCC for Low-, medium-, high- and XL-density devices, and Connectivity line devices.

Programming Manual

The Programming Manual is not an essential document at the very beginning of getting to know STMs, but it is very important when studying these microcontrollers in depth. It contains information about the processor core, instruction set and core peripherals. Moreover, this is not the same periphery that is described in the Reference manual. It includes:

  • System timer - system timer
  • Nested vectored interrupt controller - priority interrupt controller
  • System control block
  • Memory protection unit

Once we start getting familiar with interrupts in the STM32, we will need a section 4.3 Nested vectored interrupt controller (NVIC). Well, the system timer is a very cool thing that will be useful in some RTOS or for creating software timers.

Errata Sheet

Errata Sheet is a collection of all known hardware glitches and jambs of microcontrollers and tips on how to get around them. Quite a fun document 🙂 Before using any peripherals, I advise you to take a look. This can help reduce the number of lost nerve cells when debugging your miracle firmware, which just doesn’t want to work :)

Recently, a colleague got me hooked on the idea of ​​creating a smart home, and I even managed to order dozens of different sensors for myself. The question arose about choice Microcontroller(hereinafter referred to as MK) or boards. After some searching I found several options. Among them were Arduino(including his clones, one of which I ordered for myself just to have fun) and Launchpad, but all this is redundant and cumbersome (although in terms of programming it is much simpler, but I will not raise the topic of holivars, everyone has their own tastes). In the end, I decided not to decide on a ready-made board, but to take only the MK and do everything from scratch. In the end I chose between Atmel ATtiny (2313), Atmel ATmega(decided to refuse because I couldn’t find it for adequate money), STM32(Cortex on the core ARM). I had already played around with the teen, so I took it for myself STM32VL-Discovery. This can be called an introduction to a series of articles on STM32. Let me make a reservation right away: I will not be the author of most of these articles, because... I’m just learning it myself, here I publish them primarily for myself, so that it’s easier to search if I forget something. And so let's go!

General information

Microcontrollers families STM32 contain up to seven 16-bit I/O ports with names from PORTA to PORTG. IN specific model microcontroller Without exception, all port pins are available, the total number of which depends on the type of housing and is specified in the DataSheet for the corresponding subfamily.

To enable port x, you must first connect it to the APB2 bus by setting the corresponding IOPxEN bit in the peripheral clock enable register RCC_APB2ENR:

RCC->APB2ENR |= RCC_APB2ENR_IOPxEN; // Enable PORTx clocking.

Port management STM32 carried out using sets of seven 32-bit registers:

  • GPIOx_CRL, GPIOx_CRH– set the operating modes of each of the port bits as an input or output, determine the configuration of the input and output stages.
  • GPIOx_IDR– input data register for reading the physical state of port x pins.
  • GPIOx_ODR– the output register writes data directly to the port.
  • GPIOx_BSRR– atomic reset and port bit setting register.
  • GPIOx_BSR– port bit reset register.
  • GPIOx_LCKR– pin configuration lock register.

GPIO pin operating modes

The operating modes of individual pins are determined by a combination of bits MODEy And CNFy registers GPIOx_CRL And GPIOx_CRH(hereinafter: x is the port name, y is the port bit number).

GPIOx_CRL- pin configuration register 0...7 ports x:

Register structure GPIOx_CRH similar structure GPIOx_CRL and is designed to control the operating modes of the port’s senior pins (bits 8...15).

The MODEy bits of the specified registers determine the output direction and switching speed limit in output mode:

  • MODEy = 00: Input mode (state after reset);
  • MODEy = 01: Output mode maximum speed– 10 MHz;
  • MODEy = 10: Output mode, maximum speed – 2 MHz;
  • MODEy = 11: Output mode, maximum speed – 50 MHz.

The CNF bits specify the configuration of the output stages of the corresponding pins:

in login mode:

  • CNFy = 00: Analog input;
  • CNFy = 01: Input in third state (state after reset);
  • CNFy = 10: Input with pull-up resistor (if PxODR=1) or pull-down (if PxODR=0);
  • CNFy = 11: Reserved.

in exit mode:

  • CNFy = 00: Push-pull output general purpose;
  • CNFy = 01: General purpose open drain output;
  • CNFy = 10: Push-pull output with alternative function;
  • CNFy = 11: Open drain output with alternative function.

In order to increase noise immunity, all input buffers contain Schmidt triggers. Part of the conclusions STM32, equipped with protective diodes connected to the common bus and the power bus, are marked in the datasheet as FT (5V tolerant) - compatible with a voltage of 5 volts.

Protecting GPIO Configuration Bits

To protect bits in configuration registers from unauthorized writing to STM32 a settings lock register is provided GPIOx_LCKR
GPIOx_LCKR- port output settings lock register:

To protect the settings of an individual port pin, the corresponding LCKy bit must be set. Then carry out sequential recording in the category LCKK values ​​“1” - “0” - “1” and two register read operations LCKR, which in case of successful blocking will give for the bit LCKK values ​​"0" and "1". The protection of the setting bits will remain in effect until the next reboot of the microcontroller.

Peripheral Definition File microcontrollers STM32 stm32f10x.h defines separate groups of registers united by a common functional purpose (including GPIO), as structures of the C language, and the registers themselves as elements of this structure. For example:

GPIOC->BSRR– GPIOC port set/reset register BSRR.
Let's use the definitions from the file stm32f10x.h to illustrate how to work with microcontroller I/O registers STM32F100RB installed in the starter kit STM32VLDISCOVERY:

#include "stm32F10x.h" u32 tmp; int main (void) ( RCC->APB2ENR |= RCC_APB2ENR_IOPCEN; // Enable PORTC clocking. GPIOC->CRH |= GPIO_CRH_MODE8; // Output LED4 PC8 to output. GPIOC->CRH &=~GPIO_CRH_CNF8; // Push-pull output on PC8. GPIOC->CRH |= GPIO_CRH_MODE9; // Output LED3 PC9 GPIOC->CRH &=~GPIO_CRH_CNF9; // Push-pull output on PC9. PA0 - to input. // Lock pin settings PC8, PC9. GPIOC->LCKR = GPIO_LCKR_LCK8|GPIO_LCKR_LCKK; GPIOC->LCKR = GPIO_LCKR_LCK8|GPIO_LCKR_LCK9; LCKR_LCK9|GPIO_LCKR_LCKK;tmp=GPIOC-> LCKR;tmp=GPIOC->LCKR;

Write and read GPIO

The input ports are intended for writing and reading GPIOx_IDR and day off GPIOx_ODR data registers.

Write to output register ODR port configured for output, sets the output levels of all bits of the port in accordance with the recorded value. If a pin is configured as a pull-up input, the state of the corresponding register bit ODR activates the pull-up of the output to the power bus (pull-up, ODR=1) or the general bus of the microcontroller (pull-down, ODR=0).

Read register IDR returns the state value of the microcontroller pins configured as inputs:

// If the button is pressed (PA0=1), set the port C bits, otherwise reset. if (GPIOA->IDR & GPIO_IDR_IDR0) GPIOC->ODR=0xFFFF; else GPIOC->ODR=0x0000;

Resetting and setting port bits

For atomic reset and bit set GPIO in microcontrollers STM32 register is intended GPIOx_BSRR. Traditional for architecture ARM a method of managing register bits that does not require the use of a type operation "read-modify-write" allows you to set and reset port bits by simply writing one to the set bits BS (BitSet) and reset BR (BitReset) register BSRR. In this case, writing zero bits to the register does not affect the state of the corresponding pins.

GPIOx_BSRR– register for resetting and setting port bits:

GPIOC->BSRR=GPIO_BSRR_BS8|GPIO_BSRR_BR9; // Light up LED4 (PC8), turn off LED3. GPIOC->BSRR=GPIO_BSRR_BS9|GPIO_BSRR_BR8; // Light up LED3 (PC9), turn off LED4.

Alternative functions GPIO and their reassignment (remapping)
Almost all external circuits special purpose STM32(including leads for connecting quartz resonators, JTAG/SWD and so on) can be enabled on the corresponding pins of the microcontroller, or disabled from them to allow their use as general-purpose pins. The selection of an alternative output function is carried out using registers with the prefix "AFIO”_.
In addition, registers AFIO _ allow you to choose several layout options special functions on the pins of the microcontroller. This applies in particular to the outputs of communication interfaces, timers (registers AFIO_MAPR), external interrupt pins (registers AFIO_EXTICR), etc.

I welcome all lovers of programming, microcontrollers, and electronics in general to our website! In this article I’ll tell you a little about what we will be doing here, namely about the training course on ARM microcontrollers.

So, first, let’s figure out what you need to know and be able to do to start learning ARMs. But, in principle, nothing super complicated and enchanting 😉 Of course, people usually switch to ARM controllers after having already played enough with PICs and AVRs, that is, most of them are experienced developers. But I will try to describe in as much detail and clearly as possible everything that we will analyze, so that those who decided to try their hand at programming microcontrollers for the first time can easily understand the material. By the way, if you have any questions, or if something simply doesn’t work as intended, write in the comments, I’ll try to figure it out and help.

Now let's move on to technical issues) Several times I have already mentioned the name " Training course ARM", but, by and large, this is not entirely true. There is no such thing as an ARM microcontroller. There is a controller with an ARM core(!), but this, you see, is still not the same thing. So, such devices are produced by a number of companies, among which STMicroelectronics and NXP Semiconductors stand out. Accordingly, they produce STM and LPC controllers. I opted for the STM32, I just liked them better =) It’s very captivating with STM that once you’ve dealt with any MK from the STM32F10x line, you won’t have any problems with any other. One line – one datasheet. By the way there is huge amount both expensive and not so expensive development boards with STM32 controllers, which is very pleasing, although at first we will debug our programs in a simulator to evaluate the capabilities of the controller before buying hardware. Here, just in case, is the official website of STMicroelectronics -.

Somehow we moved smoothly onto the topic of the compiler, so I’ll say a few words about it. Without thinking twice, I chose Keil, not least because of the powerful built-in simulator. You can look at the UART there, and at any register, and even a logic analyzer is available. In a word, Keil left me with mostly only pleasant impressions, although there are some disadvantages, of course, but not catastrophic. So you can safely download Keil uvision4 from off. site(). True, there is one BUT - the IDE is paid, but a demo mode is available with a code limit of 32 kB, which is more than enough for us for now. For whom this is not enough, there are a huge number of cracks for Keil 😉 Everything is installed without problems - we poke further a couple of times and everything installs perfectly and works without additional dances with a tambourine.

Actually, that’s all I wanted to tell you here, it’s time to move from words to action, but that’s in the next article. We will learn programming STM32 microcontrollers from scratch!

Published 08/09/2016

Microcontrollers STM32 are becoming increasingly popular due to their power, fairly diverse peripherals, and flexibility. We will start studying using a budget test board, the cost of which does not exceed $2 (from the Chinese). We will also need ST-Link programmer, the cost of which is about $2.5 (from the Chinese). Such amounts of expenses are available to both students and schoolchildren, so it is from this budget option I suggest we start.


This microcontroller is not the most powerful among STM32, but not the weakest either. There are various boards with STM32, including Discovery which cost about $20. On such boards, almost everything is the same as on our board, plus a programmer. In our case, we will use the programmer separately.

Microcontroller STM32F103C8. Characteristics

  • ARM 32-bit Cortex-M3 core
  • Maximum frequency 72MHz
  • 64Kb Flash memory for programs
  • 20Kb SRAM memory
  • Power supply 2.0 … 3.3V
  • 2 x 12-bit ADC (0 ... 3.6V)
  • DMA controller
  • 37 5V tolerant inputs/outputs
  • 4 16-bit timers
  • 2 watchdog timers
  • I2C – 2 buses
  • USART – 3 buses
  • SPI – 2 buses
  • USB 2.0 full-speed interface
  • RTC – built-in clock

Available on STM32F103C8 board

  • Output ports A0-A12, B0-B1, B3-B15, C13-C15
  • Micro-USB through which you can power the board. The board has a 3.3V voltage stabilizer. 3.3V or 5V power can be supplied to the corresponding pins on the board.
  • Button Reset
  • Two jumpers BOOT0 And BOOT1. We will use it during flashing via UART.
  • Two quartz 8 MHz and 32768 Hz. The microcontroller has a frequency multiplier, so with an 8 MHz quartz we can reach the maximum controller frequency of 72 MHz.
  • Two LEDs. PWR– signals that power is supplied. PC13– connected to the output C13.
  • Connector for programmer ST-Link.

So, let's start by trying to flash the microcontroller. This can be done via USART, or using a programmer ST-Link.

You can download the test file for the firmware. The program flashes the LED on the board.

STM32 firmware using USB-Uart adapter for Windows

IN system memory STM32 There is Bootloader. Bootloader is recorded at the production stage and any microcontroller STM32 can be programmed via interface USART using a USART-USB adapter. Such adapters are most often made on the basis of popular microcircuits FT232RL. First of all, connect the adapter to the computer and install the drivers (if required). You can download drivers from the manufacturer's website FT232RL– ftdichip.com. You need to download drivers VCP(virtual com port). After installing the drivers, a virtual serial port should appear on your computer.


Connecting RX And TX outputs to the corresponding pins USART1 microcontroller. RX connect the adapter to TX microcontroller (A9). TX connect the adapter to RX microcontroller (A10). Since USART-USB has 3.3V power outputs, we will supply power to the board from it.

To put the microcontroller into programming mode, you need to set the pins BOOT0 And BOOT1 to the desired state and reboot it with the button Reset or turn off and on the power of the microcontroller. For this we have jumpers. Various combinations drive the microcontroller into various modes. We are only interested in one mode. To do this, the microcontroller has BOOT0 there should be a logical one, and the output BOOT1– logical zero. On the board this is the following jumper position:

After pressing the button Reset or disconnecting and connecting the power, the microcontroller must enter programming mode.

Firmware software

If we use a USB-UART adapter, the port name will be something like this /dev/ttyUSB0

Get chip information

Result:

We read from the chip into the file dump.bin

sudo stm32flash -r dump.bin /dev/ttyUSB0

Write to the chip

sudo stm32flash -w dump.bin -v -g 0x0 /dev/ttyUSB0

Result:

Stm32flash 0.4 http://stm32flash.googlecode.com/ Using Parser: Raw BINARY Interface serial_posix: 57600 8E1 Version: 0x22 Option 1: 0x00 Option 2: 0x00 Device ID: 0x0410 (Medium-density) - RAM: 20KiB (512b reserved by bootloader) - Flash: 128KiB (sector size: 4x1024) - Option RAM: 16b - System RAM: 2KiB Write to memory Erasing memory Wrote and verified address 0x08012900 (100.00%) Done. Starting execution at address 0x08000000... done.

Firmware STM32 using ST-Link programmer for Windows

When using a programmer ST-Link conclusions BOOT0 And BOOT1 are not used and must be in the standard position for normal operation of the controller.

(Book in Russian)

STM32 marking

Device familyProduct typeDevice subfamilyPin countFlash memory sizePackageTemperature range
STM32 =
ARM-based 32-bit microcontroller
F = General-purpose
L = Ultra-low-power
TS=TouchScreen
W = wireless system-on-chip
60 = multitouch resistive
103 = performance line
F = 20 pins
G = 28 pins
K = 32 pins
T = 36 pins
H = 40 pins
C = 48/49 pins
R = 64 pins
O = 90 pins
V = 100 pins
Z = 144 pins
I = 176 pins
B = 208 pins
N = 216 pins
4 = 16 Kbytes of Flash memory
6 = 32 Kbytes of Flash memory
8 = 64 Kbytes of Flash memory
B = 128 Kbytes of Flash memory
Z = 192 Kbytes of Flash memory
C = 256 Kbytes of Flash memory
D = 384 Kbytes of Flash memory
E = 512 Kbytes of Flash memory
F = 768 Kbytes of Flash memory
G = 1024 Kbytes of Flash memory
I = 2048 Kbytes of Flash memory
H = UFBGA
N=TFBGA
P = TSSOP
T = LQFP
U = V/UFQFPN
Y = WLCSP
6 = Industrial temperature range, –40…+85 °C.
7 = Industrial temperature range, -40…+ 105 °C.
STM32F103 C8 T6

How to remove write/read protection?

If you received a board with STM32F103, but the programmer does not see it, this means that the Chinese have protected the Flash memory of the microcontroller. The question “why?” let's ignore it. To remove the blocking, we will connect a UART adapter and program through it. We set the jumpers for programming and off we go:

I will do this from Ubuntu using the stm32flash utility.

1. Check whether the microcontroller is visible:

Sudo stm32flash /dev/ttyUSB0

You should get something like this:

Stm32flash 0.4 http://stm32flash.googlecode.com/ Interface serial_posix: 57600 8E1 Version: 0x22 Option 1: 0x00 Option 2: 0x00 Device ID: 0x0410 (Medium-density) - RAM: 20KiB (512b reserved by bootloader) - Flash: 128KiB (sector size: 4x1024) - Option RAM: 16b - System RAM: 2KiB

2. Remove read protection and then write protection:

Sudo stm32flash -k /dev/ttyUSB0 stm32flash 0.4 http://stm32flash.googlecode.com/ Interface serial_posix: 57600 8E1 Version: 0x22 Option 1: 0x00 Option 2: 0x00 Device ID: 0x0410 (Medium-density) - RAM: 20KiB ( 512b reserved by bootloader) - Flash: 128KiB (sector size: 4x1024) - Option RAM: 16b - System RAM: 2KiB Read-UnProtecting flash Done. sudo stm32flash -u /dev/ttyUSB0 stm32flash 0.4 http://stm32flash.googlecode.com/ Interface serial_posix: 57600 8E1 Version: 0x22 Option 1: 0x00 Option 2: 0x00 Device ID: 0x0410 (Medium-density) - RAM: 20KiB ( 512b reserved by bootloader) - Flash: 128KiB (sector size: 4x1024) - Option RAM: 16b - System RAM: 2KiB Write-unprotecting flash Done.

Now you can work normally with the microcontroller.

Share