https://github.com/prdktntwcklr/cpp-on-avr
C++ code for AVR microcontrollers.
https://github.com/prdktntwcklr/cpp-on-avr
avr cmake cpp gtest microcontrollers
Last synced: about 1 month ago
JSON representation
C++ code for AVR microcontrollers.
- Host: GitHub
- URL: https://github.com/prdktntwcklr/cpp-on-avr
- Owner: prdktntwcklr
- License: mit
- Created: 2023-10-21T09:24:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-08T14:46:01.000Z (almost 2 years ago)
- Last Synced: 2025-03-26T00:51:26.454Z (over 1 year ago)
- Topics: avr, cmake, cpp, gtest, microcontrollers
- Language: C++
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C++ on AVR
C++ code for resource-constrained microcontrollers.
## Getting started
The best way to get started is to use the provided `Dockerfile` that comes with
all required dependencies pre-installed.
### Building the project
To build the project for the target hardware, you have to supply the toolchain
file as follows:
```bash
cmake -DCMAKE_TOOLCHAIN_FILE="avr.cmake" -B Build/Avr
```
Then, build the project:
```bash
cmake --build Build/Avr --target app size hex
```
### Flashing firmware
These commands need to be run outside of `Docker`. First, erase the chip:
```bash
avrdude -p m168 -P COM6 -c avrispv2 -e
```
Then, flash the firmware:
```bash
avrdude -p m168 -P COM6 -c avrispv2 -U flash:w:app.hex
```
## Further reading
- Kormanyos, C. (2021): *Real-Time C++: Efficient Object-Oriented and Template
Microcontroller Programming.* Springer Berlin Heidelberg.