Skip to content

Commit d1993ad

Browse files
author
Simon Burkhardt
committed
added new items
1 parent bc6f3b2 commit d1993ad

File tree

7 files changed

+223
-7
lines changed

7 files changed

+223
-7
lines changed

README.md

+57-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
21
# STM32-Tutorial
2+
33
Getting started with the STM32 HAL development environment. Tutorial documents in Markdown.
44

55
---
@@ -9,13 +9,13 @@ You can find the current tutorials on my website: [simonmartin.ch](https://simon
99

1010
---
1111

12-
## STM32 Tutoriall 000 - Intro
12+
## STM32 Tutorial 000 - Intro
1313
contains:
1414

1515
- IDE installation guides and download links
1616
- links to source material (Datasheets)
1717

18-
## STM32 Tutoriall 001 - GPIO Operations
18+
## STM32 Tutorial 001 - GPIO Operations
1919
contains:
2020

2121
- first steps in STM32CubeMX
@@ -24,6 +24,60 @@ contains:
2424
- GPIO Pin operations
2525
- GPIO interrupts (EXTI)
2626

27+
## STM32 Tutorial 002 - UART Interface
28+
contains:
29+
30+
- configuring the UART peripheral using STM32CubeMX
31+
- forwarding the `printf()` function to the UART channel
32+
- receiving bytes over peripheral interrupts
33+
34+
## STM32 Tutorial 003 - ADC
35+
36+
- WIP
37+
38+
## STM32 Tutorial 004 - PWM
39+
40+
- WIP
41+
42+
## STM32 Tutorial 005 - I2C Peripherals
43+
44+
- WIP
45+
46+
## STM32 Tutorial 006 - SPI Peripherals
47+
48+
- WIP
49+
50+
## STM32 Tutorial 007 - Custom Hardware Libraries
51+
52+
- WIP
53+
54+
---
55+
56+
## Contribution
57+
58+
I am always happy to hear, when a tutorial was useful to someone.
59+
If you have feedback, suggesetions or wishes, feel free to open an Issue or drop me a Telegram.
60+
61+
---
62+
63+
**MIT License**
64+
65+
Copyright (c) 2020 Simon Burkhardt / simonmartin.ch / github.com/mnemocron
2766

67+
> Permission is hereby granted, free of charge, to any person obtaining a copy
68+
of this software and associated documentation files (the "Software"), to deal
69+
in the Software without restriction, including without limitation the rights
70+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
71+
copies of the Software, and to permit persons to whom the Software is
72+
furnished to do so, subject to the following conditions:
2873

74+
> The above copyright notice and this permission notice shall be included in all
75+
copies or substantial portions of the Software.
2976

77+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
78+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
79+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
80+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
81+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
82+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
83+
SOFTWARE.

STM32 Tutorial 000 - Introduction/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# STM32 Tutoriall 000 - Intro
1+
# STM32 Tutorial 000 - Intro
22

33
Embedded Software Programming on the STM32 Plattform
44

STM32 Tutorial 001 - GPIO Operations/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# STM32 Tutoriall 001 - GPIO Operations
1+
# STM32 Tutorial 001 - GPIO Operations
22

33
Embedded Software Programming on the STM32 Plattform
44

STM32 Tutorial 002 - UART Communication/README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# STM32 Tutoriall 002 - UART Communication
1+
# STM32 Tutorial 002 - UART Communication
22

33
Embedded Software Programming on the STM32 Plattform
44

@@ -20,6 +20,7 @@ Furthermore, for this tutorial you also need a COM-Terminal emulator like [PuTTY
2020
- STM32CubeMX installed
2121
- arm Keil µVision 5 IDE installed
2222
- (read through _Tutorial 001 - GPIO Operations_)
23+
- COM-Terminal emulator [PuTTY](https://www.putty.org/) or [Termite](https://www.compuphase.com/software_termite.htm)
2324

2425
---
2526

@@ -39,6 +40,9 @@ If you check the default settings of the `USART2` communication interface, you w
3940

4041
![STM32CubeMX Uart settings](images/STM32CubeMX_001.png)
4142

43+
Here the STM32CubeMX shows you all the configuration parameters that a peripheral device like `USARTx` has.
44+
The most important here are the **Baud Rate**, **Word Lenght**, **Parity-** and **Stop Bits**.
45+
4246
> **Note**: The reason for using the `USART2` interface on GPIO pins `PA2` (`Tx`) and `PA3` (`Rx`) in this example is the following: The `USART2` interface is connected to the STLink/V2 debugger.
4347
> On your computer it should be connected on one of your `COM` ports (Windows) when you connect the Nucleo board through USB.
4448
@@ -50,7 +54,7 @@ Click on `GENERATE CODE` and open the project in Keil µVision 5.
5054

5155
---
5256

53-
## Programm the `printf` function
57+
## Sending text to the console
5458

5559
As we have seen in the previous example, the HAL library offers a couple of functions to use peripheral devices on your STM32 MCU.
5660

@@ -86,6 +90,10 @@ Now, this way of printing information is very unhandy.
8690
A better option is to use the `printf` function from the C standard IO library.
8791
Use the following steps to **redirect the printf output to the UART interface**.
8892
93+
---
94+
95+
## Programm the `printf` function
96+
8997
First, you need to include the standard IO C library.
9098
9199
```c
@@ -149,6 +157,8 @@ For example:
149157
/* USER CODE END 3 */
150158
```
151159

160+
---
161+
152162
## Reading UART from Terminal
153163

154164
in `main.c`

STM32 Tutorial 003 - ADC/README.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# STM32 Tutorial 003 - ADC
2+
3+
Embedded Software Programming on the STM32 Plattform
4+
5+
---
6+
7+
You can use the STM32CubeMX software to create the necessary configuration files to enable the UART port(s) with the required parameters.
8+
In this tutorial I’m going to explain how you can use the UART interface to print values using `printf()` and react to user input via UART interrupts.
9+
10+
## Requirements
11+
12+
You need any of the **STM32-Nucleo 64 boards**. I am going to use the `STM32f103rb` board in this tutorial. You should also have an the **STM32CubeMX** Configurator and a compatible IDE installed. Check Tutorial 000 for installation instructions. I will build upon the _Tutorial 001 - GPIO Operations_. It is also handy if you happen to have the User Manual of the Nucleo-64 board and the datasheet for the STM32 microcontroller nearby.
13+
14+
- [STM32 NUCLEO-F103RB](https://www.st.com/en/evaluation-tools/nucleo-f103rb.html)
15+
- [STM32F103c8 Datasheet](https://www.st.com/resource/en/datasheet/stm32f103c8.pdf)
16+
- STM32 Nucleo-64 boards User Manual **[UM1724](https://www.st.com/content/ccc/resource/technical/document/user_manual/98/2e/fa/4b/e0/82/43/b7/DM00105823.pdf/files/DM00105823.pdf/jcr:content/translations/en.DM00105823.pdf)** (pdf)
17+
- Description of **STM32F1** HAL and low-layer drivers **[UM1850](https://www.st.com/content/ccc/resource/technical/document/user_manual/72/52/cc/53/05/e3/4c/98/DM00154093.pdf/files/DM00154093.pdf/jcr:content/translations/en.DM00154093.pdf)** (pdf)
18+
- STM32CubeMX installed
19+
- arm Keil µVision 5 IDE installed
20+
- (read through _Tutorial 001 - GPIO Operations_)
21+
22+
---
23+
24+
This tutorial comes with the following source code files
25+
26+
- [STM32F103-Tutorial-001-GPIO.ioc](src/STM32F103-Tutorial-001-GPIO.ioc) (STM32CubeMX project file)
27+
- [`main.c`](src/main.c)
28+
- [`stm32f1xx_it.c`](src/stm32f1xx_it.c)
29+
30+
---
31+
32+
## STM32CubeMX Settings
33+
34+
For this tutorial I am using the same file as in the previous tutorial.
35+
36+
If you check the default settings of the `USART2` communication interface, you will see the following settings:
37+
38+
39+
40+
41+
---
42+
43+
**MIT License**
44+
45+
Copyright (c) 2020 Simon Burkhardt / simonmartin.ch / github.com/mnemocron
46+
47+
> Permission is hereby granted, free of charge, to any person obtaining a copy
48+
of this software and associated documentation files (the "Software"), to deal
49+
in the Software without restriction, including without limitation the rights
50+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
51+
copies of the Software, and to permit persons to whom the Software is
52+
furnished to do so, subject to the following conditions:
53+
54+
> The above copyright notice and this permission notice shall be included in all
55+
copies or substantial portions of the Software.
56+
57+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
58+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
59+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
60+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
61+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
62+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
63+
SOFTWARE.
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+
Loading

template.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# STM32 Tutorial 00x - Title
2+
3+
Embedded Software Programming on the STM32 Plattform
4+
5+
---
6+
7+
You can use the STM32CubeMX software to create the necessary configuration files to enable the UART port(s) with the required parameters.
8+
In this tutorial I’m going to explain how you can use the UART interface to print values using `printf()` and react to user input via UART interrupts.
9+
10+
## Requirements
11+
12+
You need any of the **STM32-Nucleo 64 boards**. I am going to use the `STM32f103rb` board in this tutorial. You should also have an the **STM32CubeMX** Configurator and a compatible IDE installed. Check Tutorial 000 for installation instructions. I will build upon the _Tutorial 001 - GPIO Operations_. It is also handy if you happen to have the User Manual of the Nucleo-64 board and the datasheet for the STM32 microcontroller nearby.
13+
14+
- [STM32 NUCLEO-F103RB](https://www.st.com/en/evaluation-tools/nucleo-f103rb.html)
15+
- [STM32F103c8 Datasheet](https://www.st.com/resource/en/datasheet/stm32f103c8.pdf)
16+
- STM32 Nucleo-64 boards User Manual **[UM1724](https://www.st.com/content/ccc/resource/technical/document/user_manual/98/2e/fa/4b/e0/82/43/b7/DM00105823.pdf/files/DM00105823.pdf/jcr:content/translations/en.DM00105823.pdf)** (pdf)
17+
- Description of **STM32F1** HAL and low-layer drivers **[UM1850](https://www.st.com/content/ccc/resource/technical/document/user_manual/72/52/cc/53/05/e3/4c/98/DM00154093.pdf/files/DM00154093.pdf/jcr:content/translations/en.DM00154093.pdf)** (pdf)
18+
- STM32CubeMX installed
19+
- arm Keil µVision 5 IDE installed
20+
- (read through _Tutorial 001 - GPIO Operations_)
21+
22+
---
23+
24+
This tutorial comes with the following source code files
25+
26+
- [STM32F103-Tutorial-001-GPIO.ioc](src/STM32F103-Tutorial-001-GPIO.ioc) (STM32CubeMX project file)
27+
- [`main.c`](src/main.c)
28+
- [`stm32f1xx_it.c`](src/stm32f1xx_it.c)
29+
30+
---
31+
32+
## STM32CubeMX Settings
33+
34+
For this tutorial I am using the same file as in the previous tutorial.
35+
36+
If you check the default settings of the `USART2` communication interface, you will see the following settings:
37+
38+
39+
40+
41+
---
42+
43+
**MIT License**
44+
45+
Copyright (c) 2020 Simon Burkhardt / simonmartin.ch / github.com/mnemocron
46+
47+
> Permission is hereby granted, free of charge, to any person obtaining a copy
48+
of this software and associated documentation files (the "Software"), to deal
49+
in the Software without restriction, including without limitation the rights
50+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
51+
copies of the Software, and to permit persons to whom the Software is
52+
furnished to do so, subject to the following conditions:
53+
54+
> The above copyright notice and this permission notice shall be included in all
55+
copies or substantial portions of the Software.
56+
57+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
58+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
59+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
60+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
61+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
62+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
63+
SOFTWARE.
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+

0 commit comments

Comments
 (0)