118 lines
3.4 KiB
Markdown
118 lines
3.4 KiB
Markdown
|
# arm-none-eabi.buildenv
|
||
|
|
||
|
Arm bare metal compilation environment.
|
||
|
|
||
|
## Creating the image
|
||
|
|
||
|
The following command can be used to create an image from the docker file. It is assume the Dockerfile is located in the same directory.
|
||
|
|
||
|
```shell
|
||
|
docker build -t arm-none-eabi.buildenv .
|
||
|
```
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
The working directory of the image is `/work`. To use the image call it similar to the following examples:
|
||
|
|
||
|
```shell
|
||
|
docker run --rm -v $(pwd):/work --user $(id -u):$(id -g) arm-none-eabi.buildenv make
|
||
|
```
|
||
|
|
||
|
This puts your current work directory into the container, builds your code and
|
||
|
afterwards it removes the container.
|
||
|
|
||
|
```shell
|
||
|
docker run --rm -v $(pwd):/work --user $(id -u):$(id -g) -it arm-none-eabi.buildenv /bin/bash
|
||
|
```
|
||
|
|
||
|
This puts your current work directory into the container and starts an interactive bash from the container.
|
||
|
|
||
|
## Example output
|
||
|
|
||
|
```shell
|
||
|
docker run --rm arm-none-eabi.buildenv arm-none-eabi-gcc --version
|
||
|
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
|
||
|
Copyright (C) 2019 Free Software Foundation, Inc.
|
||
|
This is free software; see the source for copying conditions. There is NO
|
||
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||
|
```
|
||
|
|
||
|
## Example integration (vscode)
|
||
|
|
||
|
For Microsoft's open source visual studio code, the integration of how to invoke make within the docker container is shown in the following excerpt:
|
||
|
|
||
|
```javascript
|
||
|
{
|
||
|
"version": "2.0.0",
|
||
|
"options": {
|
||
|
"env": {
|
||
|
"PLATFORM": "nrf52",
|
||
|
// "PLATFORM": "posix",
|
||
|
"APPLICATION": "blinky",
|
||
|
// "APPLICATION": "spi",
|
||
|
// "APPLICATION": "st7789_lcd",
|
||
|
"${BUILD_CMD}": "eval docker run --env PLATFORM=${PLATFORM} --env APPLICATION=${APPLICATION} -t --rm -v '${workspaceFolder}':/work --user $(id -u):$(id -g) arm-none-eabi.buildenv",
|
||
|
},
|
||
|
},
|
||
|
"presentation": {
|
||
|
"focus": true,
|
||
|
"reveal": "always",
|
||
|
"panel": "shared",
|
||
|
"clear": true,
|
||
|
},
|
||
|
"tasks": [
|
||
|
{
|
||
|
"label": "all",
|
||
|
"type":"shell",
|
||
|
"command": "${BUILD_CMD} make all -j8",
|
||
|
"problemMatcher": {
|
||
|
"base": "$gcc",
|
||
|
"owner": "gcc",
|
||
|
"fileLocation": [
|
||
|
"relative",
|
||
|
"${workspaceFolder}"
|
||
|
]
|
||
|
},
|
||
|
"group": {
|
||
|
"kind": "build",
|
||
|
"isDefault": true
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"label": "clean",
|
||
|
"type":"shell",
|
||
|
"command": "${BUILD_CMD} make clean -j8",
|
||
|
"problemMatcher": {
|
||
|
"base": "$gcc",
|
||
|
"owner": "gcc",
|
||
|
"fileLocation": [
|
||
|
"relative",
|
||
|
"${workspaceFolder}"
|
||
|
]
|
||
|
},
|
||
|
"group": {
|
||
|
"kind": "build",
|
||
|
"isDefault": true
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"label": "distclean",
|
||
|
"type":"shell",
|
||
|
"command": "${BUILD_CMD} make distclean",
|
||
|
"problemMatcher": {
|
||
|
"base": "$gcc",
|
||
|
"owner": "gcc",
|
||
|
"fileLocation": [
|
||
|
"relative",
|
||
|
"${workspaceFolder}"
|
||
|
]
|
||
|
},
|
||
|
"group": {
|
||
|
"kind": "build",
|
||
|
"isDefault": true
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
```
|