summaryrefslogtreecommitdiff
path: root/README.md
blob: 070c535fcfcaa06aed3181acfc1a1c28d265e315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

# ledcontrol

A firmware project for the STM32F103C8T6 to control LED strips.

## Usage

Install the necessary software. For Arch Linux this works like this:
```
sudo pacman -S \
	base-devel \
	arm-none-eabi-binutils \
	arm-none-eabi-gcc \
	arm-none-eabi-gdb \
	arm-none-eabi-newlib
```

Clone this repository with all Git submodules:
```
git clone --recurse-submodules https://gitea.xengineering.eu/xengineering/ledcontrol.git
```

Enter the repository and build the software
```
cd ledcontrol
make
```

Connect your STM32F103C8T6 with an STLINK V2 debugger and flash the firmware:
```
bash ocd.sh
# switch to a second terminal in the same folder
bash gdb.sh build/ledcontrol.elf
load
run
# CTRL + C will stop the execution
# leave GDB with CTRL + D
```

## External References

- Nice [Tutorial](https://jacobmossberg.se/posts/2018/08/11/run-c-program-bare-metal-on-arm-cortex-m3.html) about C programs on bare-metal ARM chips
- Another useful [Tutorial](https://www.rhye.org/post/stm32-with-opencm3-0-compiling-and-uploading/) about STM32 programming with libopencm3