mirror of
https://github.com/lukstep/raspberry-pi-pico-docker-sdk.git
synced 2025-12-23 02:55:55 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50c183b45b | |||
| 8a5859f324 | |||
| b0b3ad9c9f | |||
| 5f5b0d262b | |||
| dae1fa9771 | |||
| 9d57df6c8b |
13
Dockerfile
13
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.17.0
|
FROM alpine:3.21.3
|
||||||
|
|
||||||
# Install toolchain
|
# Install toolchain
|
||||||
RUN apk update && \
|
RUN apk update && \
|
||||||
@@ -12,22 +12,23 @@ RUN apk update && \
|
|||||||
bsd-compat-headers \
|
bsd-compat-headers \
|
||||||
newlib-arm-none-eabi \
|
newlib-arm-none-eabi \
|
||||||
gcc-arm-none-eabi \
|
gcc-arm-none-eabi \
|
||||||
gdb-multiarch
|
g++-arm-none-eabi \
|
||||||
|
linux-headers
|
||||||
|
|
||||||
# Raspberry Pi Pico SDK
|
# Raspberry Pi Pico SDK
|
||||||
ARG SDK_PATH=/usr/share/pico_sdk
|
ARG SDK_PATH=/usr/share/pico_sdk
|
||||||
RUN git clone --depth 1 --branch 1.5.1 https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
RUN git clone --depth 1 --branch 2.1.1 --single-branch https://github.com/raspberrypi/pico-sdk $SDK_PATH && \
|
||||||
cd $SDK_PATH && \
|
cd $SDK_PATH && \
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
ENV PICO_SDK_PATH=$SDK_PATH
|
ENV PICO_SDK_PATH=$SDK_PATH
|
||||||
|
|
||||||
# Picotool installation
|
# Picotool installation
|
||||||
RUN git clone --depth 1 --branch 1.1.2 https://github.com/raspberrypi/picotool.git /home/picotool && \
|
RUN git clone --depth 1 --branch 2.1.1 --single-branch https://github.com/raspberrypi/picotool.git /home/picotool && \
|
||||||
cd /home/picotool && \
|
cd /home/picotool && \
|
||||||
mkdir build && \
|
mkdir build && \
|
||||||
cd build && \
|
cd build && \
|
||||||
cmake .. && \
|
cmake .. && \
|
||||||
make && \
|
make -j$(nproc) && \
|
||||||
cp /home/picotool/build/picotool /bin/picotool && \
|
cmake --install . && \
|
||||||
rm -rf /home/picotool
|
rm -rf /home/picotool
|
||||||
|
|||||||
13
Jenkinsfile
vendored
Normal file
13
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
node {
|
||||||
|
stage("Download SRC") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Docker build") {
|
||||||
|
docker.build("${env.DOCKER_PREFIX}/picosdk", ".")
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("docker prune") {
|
||||||
|
sh 'docker system prune -f'
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
docker run --rm -d -it --name pico-sdk --network=host --mount type=bind,source=${PWD},target=/home/dev pico-sdk-debug
|
|
||||||
|
|
||||||
session="Pico-sdk"
|
|
||||||
|
|
||||||
tmux new-session -d -s $session
|
|
||||||
|
|
||||||
window=0
|
|
||||||
tmux rename-window -t $session:$window 'Docker'
|
|
||||||
tmux send-keys -t $session:$window 'docker exec -it pico-sdk ./bin/sh' C-m
|
|
||||||
|
|
||||||
window=1
|
|
||||||
tmux new-window -t $session:$window -n 'OpenOCD'
|
|
||||||
tmux send-keys -t $session:$window 'sudo openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "bindto 0.0.0.0"' C-m
|
|
||||||
|
|
||||||
window=2
|
|
||||||
tmux new-window -t $session:$window -n 'UART'
|
|
||||||
|
|
||||||
tmux attach-session -t $session
|
|
||||||
8
test_poject/.vscode/extensions.json
vendored
8
test_poject/.vscode/extensions.json
vendored
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"recommendations": ["llvm-vs-code-extensions.vscode-clangd",
|
|
||||||
"marus25.cortex-debug",
|
|
||||||
"ms-vscode.cmake-tools",
|
|
||||||
"ms-vscode.cpptools",
|
|
||||||
"ms-vscode.cpptools-extension-pack"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
25
test_poject/.vscode/launch.json
vendored
25
test_poject/.vscode/launch.json
vendored
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Pico debug",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"gdbPath": "/usr/bin/gdb-multiarch",
|
|
||||||
"executable": "/home/dev/build/sample.elf",
|
|
||||||
"request": "launch",
|
|
||||||
"type": "cortex-debug",
|
|
||||||
"runToEntryPoint": "main",
|
|
||||||
"servertype": "external",
|
|
||||||
"gdbTarget": "host.docker.internal:3333",
|
|
||||||
"overrideLaunchCommands": [
|
|
||||||
"monitor adapter speed 5000",
|
|
||||||
"monitor reset init",
|
|
||||||
"load ${command:cmake.launchTargetPath}"
|
|
||||||
],
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
13
test_poject/.vscode/settings.json
vendored
13
test_poject/.vscode/settings.json
vendored
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"C_Cpp.intelliSenseEngine": "disabled",
|
|
||||||
"clangd.path": "/usr/bin/clangd",
|
|
||||||
"clangd.checkUpdates": false,
|
|
||||||
"clangd.restartAfterCrash": true,
|
|
||||||
"clangd.detectExtensionConflicts": true,
|
|
||||||
"clangd.arguments": ["-log=verbose",
|
|
||||||
"-pretty",
|
|
||||||
"--background-index",
|
|
||||||
"--query-driver=/usr/bin/arm-none-eabi-gcc",
|
|
||||||
"--compile-commands-dir=/home/dev/build"],
|
|
||||||
"cmake.sourceDirectory": "/home/dev"
|
|
||||||
}
|
|
||||||
@@ -9,21 +9,13 @@ set(CMAKE_CXX_COMPILER /usr/bin/arm-none-eabi-g++ CACHE PATH "" FORCE)
|
|||||||
|
|
||||||
set(CMAKE_C_STANDARD 11)
|
set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
||||||
add_compile_options(-Wall -g -O1)
|
|
||||||
|
|
||||||
pico_sdk_init()
|
pico_sdk_init()
|
||||||
|
|
||||||
add_executable(sample main.c)
|
add_executable(sample main.c)
|
||||||
|
|
||||||
pico_enable_stdio_usb(sample 0)
|
pico_enable_stdio_usb(sample 1)
|
||||||
pico_enable_stdio_uart(sample 1)
|
pico_enable_stdio_uart(sample 1)
|
||||||
pico_add_extra_outputs(sample)
|
pico_add_extra_outputs(sample)
|
||||||
|
|
||||||
target_link_libraries(sample
|
target_link_libraries(sample pico_stdlib)
|
||||||
pico_stdlib
|
|
||||||
hardware_pio
|
|
||||||
hardware_timer
|
|
||||||
hardware_clocks
|
|
||||||
hardware_pwm
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -3,11 +3,12 @@
|
|||||||
#include "hardware/gpio.h"
|
#include "hardware/gpio.h"
|
||||||
#include "pico/binary_info.h"
|
#include "pico/binary_info.h"
|
||||||
|
|
||||||
const int LED_PIN = 0;
|
const int LED_PIN = 25;
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
int test = 0;
|
bi_decl(bi_program_description("Sample binary"));
|
||||||
|
bi_decl(bi_1pin_with_name(LED_PIN, "on-board PIN"));
|
||||||
|
|
||||||
stdio_init_all();
|
stdio_init_all();
|
||||||
|
|
||||||
@@ -19,9 +20,8 @@ int main ()
|
|||||||
gpio_put(LED_PIN, 0);
|
gpio_put(LED_PIN, 0);
|
||||||
sleep_ms(250);
|
sleep_ms(250);
|
||||||
gpio_put(LED_PIN, 1);
|
gpio_put(LED_PIN, 1);
|
||||||
printf("Hello Word %d\n", test);
|
puts("Hello Word\n");
|
||||||
sleep_ms(1000);
|
sleep_ms(1000);
|
||||||
test++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user