https://github.com/rubberduck203/avr
Dockerfile for avr development
https://github.com/rubberduck203/avr
avr avr-development avr-docker avr-gcc cpputest gcc make
Last synced: 3 months ago
JSON representation
Dockerfile for avr development
- Host: GitHub
- URL: https://github.com/rubberduck203/avr
- Owner: rubberduck203
- License: mit
- Created: 2017-10-02T12:21:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T13:18:34.000Z (about 4 years ago)
- Last Synced: 2025-01-28T13:52:42.334Z (5 months ago)
- Topics: avr, avr-development, avr-docker, avr-gcc, cpputest, gcc, make
- Language: Dockerfile
- Size: 3.91 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rubberduck/avr
Docker image for AVR development
This image contains all the dependencies you need for AVR development.
- Make
- CppUTest
- gcc
- avr-gcc## Build Image
docker build -t rubberduck/avr .
## Run Container As Build Tool
This command will run the container and mount the current working directory to the working directory of the container. Mounting the current container means we leave the build artifacts behind on the host machine.
```bash
docker run --rm -it -v ${PWD}:/mount rubberduck/avr bash
```Once inside the container, just run your makefile like you would if you had the dependencies installed on your local machine.
```bash
make check
make
# etc.
```### Flashing
The container has [avrdude](https://www.nongnu.org/avrdude/user-manual/avrdude_10.html) installed and a default conf file located in `/root/.avrduderc`.
By default, it points to the `/dev/ttyUSB0` port.```bash
docker run --rm -it --device /dev/ttyUSB0 -v ${PWD}:/mount rubberduck/avr bash
```If you need to use a differenc avrdude conf file, you can mount it in like this.
```bash
docker run --rm -it --device /dev/someOtherTty -v ${PWD}:/mount -v someOtherAvrdude.conf:/root/.avrduderc rubberduck/avr bash
```#### Mac/Windows
Accessing the host's USB ports can be difficult on non-Linux operating systems.
You need to use a virtual machine to host the docker daemon.[See this blog post for instructions on accessing USB ports inside the container on Mac](https://christopherjmcclellan.wordpress.com/2019/04/21/using-usb-with-docker-for-mac/).
## CppUTest and Make
This image includes pkg-config.
It can be leveraged in your makefile to locate the CppUTest includes and libs.```bash
CPPFLAGS += $(shell pkg-config --cflags cpputest)
CXXFLAGS += -include CppUTest/MemoryLeakDetectorNewMacros.h
CFLAGS += -include CppUTest/MemoryLeakDetectorMallocMacros.h
LD_LIBRARIES = $(shell pkg-config --libs cpputest)
```