Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ghcr.io/hyperloop-upv/hyperloop-firmware-toolchain:latest
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the :latest tag makes the devcontainer environment non-reproducible and can break unexpectedly when the image is updated. Consider pinning to a specific version tag or immutable digest (and updating deliberately when needed).

Suggested change
FROM ghcr.io/hyperloop-upv/hyperloop-firmware-toolchain:latest
FROM ghcr.io/hyperloop-upv/hyperloop-firmware-toolchain@sha256:REPLACE_WITH_APPROVED_IMAGE_DIGEST

Copilot uses AI. Check for mistakes.

WORKDIR /workspaces
27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "STM32 Development Lab",
"build": {
"dockerfile": "Containerfile"
},
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"runArgs": [
"--privileged",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--privileged grants the container essentially full access to the host. If USB access is the main requirement, consider a more constrained configuration (e.g., --device=/dev/bus/usb and/or specific cgroup device rules) to reduce the security blast radius.

Suggested change
"--privileged",

Copilot uses AI. Check for mistakes.
"-v", "/dev/bus/usb:/dev/bus/usb"
],
"postStartCommand": "stlink-server &",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting stlink-server via postStartCommand with & can lead to orphaned/duplicated servers on rebuild/reopen and may not stay running depending on how the devcontainer shell is launched. Consider managing it more explicitly (e.g., check if it’s already running before starting, or use a dedicated supervisor/service script).

Suggested change
"postStartCommand": "stlink-server &",
"postStartCommand": "sh -lc 'pgrep -x stlink-server >/dev/null || nohup stlink-server >/tmp/stlink-server.log 2>&1 &'",

Copilot uses AI. Check for mistakes.
"containerEnv": {
"CONTAINER_NAME": "stm32-project"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"marus25.cortex-debug",
"twxs.cmake",
"ms-vscode.cmake-tools"
]
}
},
"containerUser": "root",
"updateRemoteUserUID": false
}
Loading