Skip to content

Commit 1f0f93e

Browse files
committed
🍱 add output
1 parent 9245bf3 commit 1f0f93e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

uart-polling/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ GPIOA->CRH &= ~(GPIO_CRH_MODE10 | GPIO_CRH_MODE9 | GPIO_CRH_CNF10 | GPIO_CRH_CNF
6161
* PA10 as floating input.
6262

6363
```C
64-
GPIOA->CRH |= GPIO_CRH_MODE9_0 | GPIO_CRH_MODE9_1 | GPIO_CRH_CNF9_1;
65-
GPIOA->CRH |= GPIO_CRH_CNF10_0;
64+
GPIOA->CRH |= GPIO_CRH_MODE9_0 | GPIO_CRH_MODE9_1 | GPIO_CRH_CNF9_1;
65+
GPIOA->CRH |= GPIO_CRH_CNF10_0;
6666
```
6767

6868
4. Calculate and set baud rate values in register.
@@ -72,7 +72,7 @@ uint32_t baud = (uint32_t)(SystemCoreClock / baudrate);
7272
USART1->BRR = baud;
7373
```
7474

75-
5. Enable transmitter, receiver, transmitter interrupt, receiver interrupt and USART1 clock.
75+
5. Enable transmitter, receiver, receiver interrupt and USART1 clock.
7676

7777
```C
7878
USART1->CR1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_RXNEIE | USART_CR1_UE;
@@ -94,7 +94,7 @@ NVIC_EnableIRQ(USART1_IRQn);
9494
9595
## Project Working
9696
97-
The application prints time elapsed since boot in interval of 5 seconds. Configure serial onitor on host for 9600 baudrate to be able to read and write to blue pill using uart.
97+
The application prints time elapsed since boot in interval of 5 seconds. Configure serial onitor on host for 9600 baudrate to be able to read and write to blue pill using uart. The expected output is displayed in the *Output* section.
9898
9999
## Dependencies
100100
@@ -115,7 +115,7 @@ The application prints time elapsed since boot in interval of 5 seconds. Configu
115115
```bash
116116
sudo apt install gcc-arm-none-eabi
117117
```
118-
* For mac, visit ![ARM Downloads](https://developer.arm.com/downloads/-/gnu-rm) page to install arm embedded toolchain.
118+
* For mac, visit [ARM Downloads](https://developer.arm.com/downloads/-/gnu-rm) page to install arm embedded toolchain.
119119
120120
* **openocd**\
121121
It is an Open On Circuit Debugging tool used to flash and debug arm micro controllers. You can install openocd on linux by running command:
@@ -156,7 +156,7 @@ Running the project is super easy. Just clone, build, and flash.
156156
cd bluepill-baremetal-projects/uart-polling
157157
```
158158

159-
## Configuration
159+
### Configuration
160160

161161
All the configuration required for building this project is given below.
162162

@@ -166,19 +166,16 @@ All the configuration required for building this project is given below.
166166
2. Build type
167167
In `Makefile`, build type can be configured using variable`DEBUG`. Possible values are `Debug` and `Release`.
168168

169-
3. Binary name
170-
In `CMakeLists.txt`, output binary name can be configured using `project(<binary-name>)` macro.
171-
** update above info in `.vscode/launch.json` as well for debugging to work.
172169

173-
## Build
170+
### Build
174171

175172
Run following command in terminal to generate flashable binaries for blue pill board. Build files will be written to **Build Output Directory** as configured.
176173

177174
```bash
178175
make all
179176
```
180177

181-
## Flash
178+
### Flash
182179

183180
1. Connect STlink to PC and blue pill board using swd headers.
184181
2. Put blue pill board in programming mode.
@@ -190,7 +187,10 @@ make flash
190187

191188
## Output
192189

193-
Onboard led connected to Pin C13 can be observed to be blinking every second.
190+
The following output should be available on serial monitor.
191+
192+
![Output on Serial monitor](https://github.com/csrohit/bluepill-baremetal-projects/blob/main/uart-polling/resources/output.jpg "Serial messages printed on monitor")
193+
194194

195195
## Debug
196196

uart-polling/resources/output.jpg

175 KB
Loading

0 commit comments

Comments
 (0)