-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rovo89/devcontainer
Added development container
- Loading branch information
Showing
5 changed files
with
100,128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ARG USERNAME=dev | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
RUN groupadd --gid $USER_GID $USERNAME && \ | ||
useradd --uid $USER_UID --gid $USER_GID --groups sudo --password '' -s /bin/bash -m $USERNAME | ||
|
||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
--mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
rm -f /etc/apt/apt.conf.d/docker-clean && \ | ||
apt-get update && \ | ||
apt-get install --no-install-recommends --yes \ | ||
sudo git less \ | ||
gcc gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib \ | ||
libasio-dev iproute2 \ | ||
python3 python3-venv python3-pip \ | ||
cmake make \ | ||
gdb-multiarch && \ | ||
ln -s /usr/bin/nm /usr/bin/nm-multiarch && \ | ||
ln -s /usr/bin/objdump /usr/bin/objdump-multiarch | ||
|
||
USER $USERNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools-extension-pack", | ||
"marus25.cortex-debug", | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// For remote debugging, you need to prepare your CM4 host with a recent OpenOCD version. | ||
// Simply follow steps 1 and 2 of this description: | ||
// https://core.x-tech.online/docs/tutorials/flashing-stm32-from-cm4/ | ||
// Once done, start OpenOCD on your CM4 host via: | ||
// openocd -f interface/xcore.cfg -f target/stm32h7x.cfg -c "bindto 0.0.0.0" | ||
// Also make sure you have the Dev Mode enabled in the bootloader. | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "cppdbg (remote)", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"preLaunchTask": "CMake: build", | ||
"cwd": "${workspaceFolder}", | ||
"program": "${command:cmake.launchTargetPath}", | ||
"postRemoteConnectCommands": [ | ||
{ | ||
"text": "-target-download", | ||
} | ||
], | ||
"svdPath": "${workspaceFolder}/cfg/STM32H723.svd", | ||
"linux": { | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "gdb-multiarch", | ||
"miDebuggerServerAddress": "${input:target}:3333", | ||
}, | ||
}, | ||
{ | ||
"name": "Cortex-Debug (remote)", | ||
"type": "cortex-debug", | ||
"cwd": "${workspaceFolder}", | ||
"request": "launch", | ||
"servertype": "external", | ||
"gdbPath": "gdb-multiarch", | ||
"gdbTarget": "${input:target}:3333", | ||
"executable": "${command:cmake.launchTargetPath}", | ||
"svdFile": "${workspaceFolder}/cfg/STM32H723.svd", | ||
// Rebuild and flash on "Restart", but not on "Reset device". | ||
"preLaunchTask": "CMake: build", | ||
"preRestartCommands": [ | ||
"-target-download", | ||
], | ||
"preResetCommands": [], | ||
"breakAfterReset": false, | ||
// Uncomment to break in main before debugging | ||
// "runToEntryPoint": "main", | ||
}, | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "target", | ||
"description": "Select hostname where OpenOCD is running", | ||
"type": "promptString", | ||
} | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
#!/bin/sh | ||
docker build --output=out . | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
PRESET=${1:-Release} | ||
|
||
mkdir -p build out | ||
|
||
cd build | ||
cmake .. --preset=$PRESET | ||
cd $PRESET | ||
make -j$(nproc) | ||
|
||
cp -v openmower-with-unsafe-bootloader.bin openmower.bin openmower.elf ../../out/ |
Oops, something went wrong.