From 24fc4ca6bddac5f68cc5c6868b74d854bbd5d276 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 22 Aug 2022 21:31:00 -0400 Subject: [PATCH 1/9] Updates for Ubuntu 20.04 --- .devcontainer/Dockerfile | 39 ++++++++++++------- .devcontainer/devcontainer.json | 68 ++++++++++++++++++--------------- .vscode/launch.json | 2 +- README.md | 27 ++++++------- 4 files changed, 78 insertions(+), 58 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c808b1b..1bc8050 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,24 +1,35 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/cpp/.devcontainer/base.Dockerfile - -# [Choice] Debian / Ubuntu version: debian-10, debian-9, ubuntu-20.04, ubuntu-18.04 ARG VARIANT="ubuntu-20.04" FROM mcr.microsoft.com/vscode/devcontainers/cpp:0-${VARIANT} -# [Optional] Uncomment this section to install additional packages. -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends cmake build-essential wget ca-certificates \ - gdb-multiarch automake autoconf libtool libftdi-dev libusb-1.0-0-dev pkg-config clang-format +RUN apt-get update && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get -y install --no-install-recommends \ + cmake \ + build-essential \ + wget \ + ca-certificates \ + gdb-multiarch \ + binutils-multiarch \ + automake \ + autoconf \ + libtool \ + libftdi-dev \ + libusb-1.0-0-dev \ + pkg-config \ + clang-format WORKDIR /apps -RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 && \ +RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 && \ tar xjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 RUN mv gcc-arm-none-eabi-10.3-2021.10 gcc-arm-none && \ + ln -s /apps/gcc-arm-none/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc && \ rm gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 ENV PATH=$PATH:/apps/gcc-arm-none/bin RUN git clone -b master https://github.com/raspberrypi/pico-sdk.git --depth=1 && cd pico-sdk && git submodule update --init ENV PICO_SDK_PATH=/apps/pico-sdk -RUN git clone https://github.com/raspberrypi/openocd.git -b picoprobe --depth=1 \ - && cd openocd && ./bootstrap && ./configure --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install \ - && cd /apps && git clone https://github.com/raspberrypi/picotool.git --depth=1 \ - && cd picotool && mkdir build && cd build && cmake ../ && make -j 8 && cp picotool /usr/local/bin \ - && cd /apps && git clone https://github.com/wtarreau/bootterm.git --depth=1 \ - && cd bootterm && make -j 8 install +RUN git clone https://github.com/raspberrypi/openocd.git -b picoprobe --depth=1 && \ + cd openocd && ./bootstrap && ./configure --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install && \ + cd /apps && git clone https://github.com/raspberrypi/picotool.git --depth=1 && \ + cd picotool && mkdir build && cd build && cmake ../ && make -j 8 && cp picotool /usr/local/bin && \ + cd /apps && git clone https://github.com/wtarreau/bootterm.git --depth=1 && \ + cd bootterm && make -j 8 install +RUN cd /usr/bin && ln -s /usr/bin/objdump objdump-multiarch && ln -s /usr/bin/nm nm-multiarch diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ba6d0e8..6345e92 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,38 +1,46 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/mwinters-stuff/vscode-devcontainer-raspberrypi-pico { - "name": "C++ Raspberry Pi Pico", - "build": { - "dockerfile": "Dockerfile", - }, - "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--device=/dev/bus/usb", "--device=/dev/ttyACM0"], - - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.profiles.linux": { - "bash": { - "path": "/usr/bin/bash" - }, - } - }, + "name": "C++ Raspberry Pi Pico", + "build": { + "dockerfile": "Dockerfile", + }, + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "--privileged", + "-v", "/dev/bus/usb:/dev/bus/usb", + "--device=/dev/bus/usb", + "--device=/dev/ttyACM0" + ], + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/usr/bin/bash" + }, + } + }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-vscode.cpptools", - "marus25.cortex-debug", - "ms-vscode.cmake-tools", - "twxs.cmake", - "eamodio.gitlens", - "xaver.clang-format", - "chris-hock.pioasm" - ], + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-vscode.cpptools", + "marus25.cortex-debug", + "ms-vscode.cmake-tools", + "twxs.cmake", + "eamodio.gitlens", + "xaver.clang-format", + "chris-hock.pioasm" + ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "gcc -v", + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "gcc -v", - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" } diff --git a/.vscode/launch.json b/.vscode/launch.json index 87909de..6fd1b04 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,7 +18,7 @@ "target/rp2040.cfg" ], "svdFile": "${env:PICO_SDK_PATH}/src/rp2040/hardware_regs/rp2040.svd", - "runToMain": true, + "runToEntryPoint": "main", // Give restart the same functionality as runToMain "postRestartCommands": [ "break main", diff --git a/README.md b/README.md index ee2a844..6dd2998 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,6 @@ -# vscode-devcontainer-raspberrypi-pico [![Create docker image](https://github.com/mwinters-stuff/vscode-devcontainer-raspberrypi-pico/actions/workflows/build-image.yml/badge.svg)](https://github.com/mwinters-stuff/vscode-devcontainer-raspberrypi-pico/actions/workflows/build-image.yml) -VSCode Dev Container for the Raspberry PI Pico C SDK +# vscode-devcontainer-raspberrypi-pico -## Usage - -Clone or download repository, copy the contents of .devcontainer into your project -Remove any existing "build" directory. - -Open the folder, and allow the container to build. - -# To know -* SDK is installed in /pico-sdk -* All USB devices are exported to container - so the picoprobe can be found and used. -* USB Device /dev/ttyACM0 is exported to container for monitoring +## VSCode Dev Container for the Raspberry PI Pico C SDK ## This container includes * pico-sdk @@ -19,3 +8,15 @@ Open the folder, and allow the container to build. * picotool * bootterm (for serial monitoring) - see https://github.com/wtarreau/bootterm +## Usage + +* Clone or download repository +* Copy the contents of .devcontainer into your project +* Remove any existing "build" directory. +* Open the folder and allow the container to build. + +## To know + +* SDK is installed in /pico-sdk +* All USB devices are exported to container - so the picoprobe can be found and used. +* USB Device /dev/ttyACM0 is exported to container for monitoring From b18d23d175b86dcc47a036511d5a195629cc5e26 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 4 Mar 2024 21:49:46 -0500 Subject: [PATCH 2/9] Added pico-extras to the Dockerfile --- .devcontainer/Dockerfile | 10 ++++++++- .devcontainer/devcontainer.json | 37 +++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1bc8050..9c722c3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -24,8 +24,16 @@ RUN mv gcc-arm-none-eabi-10.3-2021.10 gcc-arm-none && \ ln -s /apps/gcc-arm-none/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc && \ rm gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 ENV PATH=$PATH:/apps/gcc-arm-none/bin -RUN git clone -b master https://github.com/raspberrypi/pico-sdk.git --depth=1 && cd pico-sdk && git submodule update --init +RUN cd /apps && \ + git clone -b master https://github.com/raspberrypi/pico-sdk.git --depth=1 && \ + cd pico-sdk && \ + git submodule update --init ENV PICO_SDK_PATH=/apps/pico-sdk +RUN cd /apps && \ + git clone -b master https://github.com/raspberrypi/pico-extras.git --depth=1 \ + && cd pico-extras && \ + git submodule update --init +ENV PICO_EXTRAS_PATH=/apps/pico-extras RUN git clone https://github.com/raspberrypi/openocd.git -b picoprobe --depth=1 && \ cd openocd && ./bootstrap && ./configure --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install && \ cd /apps && git clone https://github.com/raspberrypi/picotool.git --depth=1 && \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6345e92..8abd80d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "C++ Raspberry Pi Pico", "build": { - "dockerfile": "Dockerfile", + "dockerfile": "Dockerfile" }, "runArgs": [ "--cap-add=SYS_PTRACE", @@ -16,25 +16,30 @@ ], // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.profiles.linux": { - "bash": { - "path": "/usr/bin/bash" + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/usr/bin/bash" + } + } }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-vscode.cpptools", + "marus25.cortex-debug", + "ms-vscode.cmake-tools", + "twxs.cmake", + "eamodio.gitlens", + "xaver.clang-format", + "chris-hock.pioasm", + "ms-vscode.cpptools-extension-pack" + ] } }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-vscode.cpptools", - "marus25.cortex-debug", - "ms-vscode.cmake-tools", - "twxs.cmake", - "eamodio.gitlens", - "xaver.clang-format", - "chris-hock.pioasm" - ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], From 23b2a1f52655ed798bf3abe06f3a5328ba93d0d9 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 23 Mar 2024 14:00:46 -0400 Subject: [PATCH 3/9] Added the pico-project-generator to installed utilities. Fixed errors in sample program. --- .devcontainer/Dockerfile | 7 ++++++- CMakeLists.txt | 18 +++++++++--------- README.md | 9 +++++++-- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9c722c3..23b3685 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,7 +16,9 @@ RUN apt-get update && \ libftdi-dev \ libusb-1.0-0-dev \ pkg-config \ - clang-format + clang-format \ + python3 \ + python3-tk WORKDIR /apps RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 && \ tar xjf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 @@ -34,6 +36,9 @@ RUN cd /apps && \ && cd pico-extras && \ git submodule update --init ENV PICO_EXTRAS_PATH=/apps/pico-extras +RUN cd /apps && \ + git clone https://github.com/raspberrypi/pico-project-generator.git +ENV PATH=$PATH:/apps/pico-project-generator RUN git clone https://github.com/raspberrypi/openocd.git -b picoprobe --depth=1 && \ cd openocd && ./bootstrap && ./configure --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install && \ cd /apps && git clone https://github.com/raspberrypi/picotool.git --depth=1 && \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 346deb0..ffac705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 17) # set(PICO_SDK_PATH "/home/mathew/src/pico/pico-sdk") # Pull in Raspberry Pi Pico SDK (must be before project) -include(pico_sdk_import.cmake) +include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake) project(TestProject C CXX ASM) @@ -21,24 +21,24 @@ pico_sdk_init() # Add executable. Default name is the project name, version 0.1 -add_executable(TestProject TestProject.cpp ) +add_executable(${PROJECT_NAME} TestProject.cpp ) -pico_set_program_name(TestProject "TestProject") -pico_set_program_version(TestProject "0.1") +#pico_set_program_name(${PROJECT_NAME} "TestProject") +#pico_set_program_version(${PROJECT_NAME} "0.1") -pico_enable_stdio_uart(TestProject 1) -pico_enable_stdio_usb(TestProject 0) +pico_enable_stdio_uart(${PROJECT_NAME} 0) +pico_enable_stdio_usb(${PROJECT_NAME} 1) # Add the standard library to the build -target_link_libraries(TestProject pico_stdlib) +target_link_libraries(${PROJECT_NAME} pico_stdlib) # Add any user requested libraries -target_link_libraries(TestProject +target_link_libraries(${PROJECT_NAME} hardware_spi hardware_i2c hardware_dma hardware_clocks ) -pico_add_extra_outputs(TestProject) +pico_add_extra_outputs(${PROJECT_NAME}) diff --git a/README.md b/README.md index 6dd2998..251ce1a 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,24 @@ ## This container includes * pico-sdk +* pico-extras +* pico-project-generator * openocd - compiled for picoprobe * picotool * bootterm (for serial monitoring) - see https://github.com/wtarreau/bootterm ## Usage -* Clone or download repository +* Clone or download the repository * Copy the contents of .devcontainer into your project +* Copy the contents of .vscode into your project * Remove any existing "build" directory. * Open the folder and allow the container to build. ## To know -* SDK is installed in /pico-sdk +* SDK is installed in /apps/pico-sdk +* EXTRAS is installed in /apps/pico-extras +* PICO-PROJECT-GENERATOR is installed in /apps/pico-project-generator * All USB devices are exported to container - so the picoprobe can be found and used. * USB Device /dev/ttyACM0 is exported to container for monitoring From 68f5117e761424f33dacca009d5ba3fd94fb0c41 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 23 Mar 2024 14:26:16 -0400 Subject: [PATCH 4/9] Updated the README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 251ce1a..b925c84 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ## VSCode Dev Container for the Raspberry PI Pico C SDK ## This container includes + * pico-sdk * pico-extras * pico-project-generator @@ -18,6 +19,24 @@ * Remove any existing "build" directory. * Open the folder and allow the container to build. +## To create a new project + +* Open the folder where you want to create the project in the dev container. +* Open a terminal in the dev container and execute the command "pico_project.py --gui". +* Configure the project but do not select Create VSCode project under the IDE options. +* Click OK to generate the code. +* Click Quit to exit the code generator. +* Copy the .devcontainer folder from the container repository to the project folder. +* Copy the .vscode folder from the container repository to the project folder. +* In VSCode, select File > Open Folder and select the project folder. +* Click OK and open the project in the dev container. + +To make sure you can build and debug the project: + +* In VSCode, open the Settings menu (P) and choose CMake: Select a Kit. Chose the arm-none-eabi compiler. +* Build the executable as normal. +* You can now debug the executable using the Run and Debug extension. + ## To know * SDK is installed in /apps/pico-sdk From 8a70ac3a4caa445eae0d7e5dc2cb160edcfaa882 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 30 Mar 2024 19:00:56 -0400 Subject: [PATCH 5/9] Added the pico-vga library. Update the README. --- .devcontainer/Dockerfile | 3 +++ README.md | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 23b3685..0cb55ae 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -39,6 +39,9 @@ ENV PICO_EXTRAS_PATH=/apps/pico-extras RUN cd /apps && \ git clone https://github.com/raspberrypi/pico-project-generator.git ENV PATH=$PATH:/apps/pico-project-generator +RUN cd /apps && \ + git clone https://github.com/codaris/picovga-cmake.git pico-vga +ENV PICOVGA_PATH=/apps/pico-vga RUN git clone https://github.com/raspberrypi/openocd.git -b picoprobe --depth=1 && \ cd openocd && ./bootstrap && ./configure --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install && \ cd /apps && git clone https://github.com/raspberrypi/picotool.git --depth=1 && \ diff --git a/README.md b/README.md index b925c84..ac08222 100644 --- a/README.md +++ b/README.md @@ -7,40 +7,51 @@ * pico-sdk * pico-extras * pico-project-generator +* pico-vga * openocd - compiled for picoprobe * picotool * bootterm (for serial monitoring) - see https://github.com/wtarreau/bootterm ## Usage +**For an existing project** + * Clone or download the repository * Copy the contents of .devcontainer into your project * Copy the contents of .vscode into your project * Remove any existing "build" directory. * Open the folder and allow the container to build. -## To create a new project +**For a new project** * Open the folder where you want to create the project in the dev container. * Open a terminal in the dev container and execute the command "pico_project.py --gui". * Configure the project but do not select Create VSCode project under the IDE options. * Click OK to generate the code. * Click Quit to exit the code generator. -* Copy the .devcontainer folder from the container repository to the project folder. -* Copy the .vscode folder from the container repository to the project folder. +* Copy the .devcontainer folder from the dev container repository to the project folder. +* Copy the .vscode folder from the dev container repository to the project folder. * In VSCode, select File > Open Folder and select the project folder. * Click OK and open the project in the dev container. -To make sure you can build and debug the project: +**Confirm you can build and debug the project** -* In VSCode, open the Settings menu (P) and choose CMake: Select a Kit. Chose the arm-none-eabi compiler. +* In VSCode, open the Settings menu (\\P) and choose CMake: Select a Kit. +* Chose the arm-none-eabi compiler. * Build the executable as normal. * You can now debug the executable using the Run and Debug extension. +## Environment Variables + +* PICO_SDK_PATH=/apps/pico-sdk +* PICO_EXTRAS_PATH=/apps/pico-extras +* PICOVGA_PATH=/apps/pico-vga + ## To know * SDK is installed in /apps/pico-sdk * EXTRAS is installed in /apps/pico-extras * PICO-PROJECT-GENERATOR is installed in /apps/pico-project-generator +* PICO-VGA is installed in /apps/pico-vga * All USB devices are exported to container - so the picoprobe can be found and used. * USB Device /dev/ttyACM0 is exported to container for monitoring From 105158b283f456176389fa59913500f344f79d06 Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 11 May 2024 13:18:45 -0400 Subject: [PATCH 6/9] Added the arduino core and arduino pico libraries --- .devcontainer/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0cb55ae..2882a63 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -42,6 +42,12 @@ ENV PATH=$PATH:/apps/pico-project-generator RUN cd /apps && \ git clone https://github.com/codaris/picovga-cmake.git pico-vga ENV PICOVGA_PATH=/apps/pico-vga +RUN cd /apps && \ + git clone https://github.com/earlephilhower/arduino-pico.git arduino-pico +ENV ARDUINO_PICO_PATH=/apps/arduino-pico +RUN cd /apps && \ + git clone https://github.com/earlephilhower/ArduinoCore-API.git arduino-core +ENV ARDUINO_CORE_PATH=/apps/arduino-core RUN git clone https://github.com/raspberrypi/openocd.git -b picoprobe --depth=1 && \ cd openocd && ./bootstrap && ./configure --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install && \ cd /apps && git clone https://github.com/raspberrypi/picotool.git --depth=1 && \ From 6a731e4f776fd8d56ea97f67616735aaf42be01f Mon Sep 17 00:00:00 2001 From: joesugar Date: Sat, 11 May 2024 13:35:53 -0400 Subject: [PATCH 7/9] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ac08222..a8c8524 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ * pico-extras * pico-project-generator * pico-vga +* arduino-pico +* arduino-core * openocd - compiled for picoprobe * picotool * bootterm (for serial monitoring) - see https://github.com/wtarreau/bootterm @@ -46,6 +48,8 @@ * PICO_SDK_PATH=/apps/pico-sdk * PICO_EXTRAS_PATH=/apps/pico-extras * PICOVGA_PATH=/apps/pico-vga +* ARDUINO_PICO_PATH=/apps/arduino-pico +* ARDUINO_CORE_PATH=/apps/arduino-core ## To know @@ -53,5 +57,7 @@ * EXTRAS is installed in /apps/pico-extras * PICO-PROJECT-GENERATOR is installed in /apps/pico-project-generator * PICO-VGA is installed in /apps/pico-vga +* ARDUINO-CORE is installed in /apps/arduino-core +* ARDUINO-PICO is installed in /apps/arduino-pico * All USB devices are exported to container - so the picoprobe can be found and used. * USB Device /dev/ttyACM0 is exported to container for monitoring From 4c5c1c057da9c2357082b8c707fbfa1ec71ee3ee Mon Sep 17 00:00:00 2001 From: Joseph Date: Sat, 18 May 2024 22:52:07 -0400 Subject: [PATCH 8/9] Updated README.md --- README.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a8c8524..5002470 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ * arduino-pico * arduino-core * openocd - compiled for picoprobe +* arduino libraries * picotool * bootterm (for serial monitoring) - see https://github.com/wtarreau/bootterm @@ -22,26 +23,30 @@ * Copy the contents of .devcontainer into your project * Copy the contents of .vscode into your project * Remove any existing "build" directory. -* Open the folder and allow the container to build. +* Open the folder in VSCode and allow the container to build. **For a new project** -* Open the folder where you want to create the project in the dev container. +* Create the folder where you want to create the project. +* Copy the contents of .devcontainer into your project +* Copy the contents of .vscode into your project +* Open the folder in VSCode. When prompted reopen the folder in the container. * Open a terminal in the dev container and execute the command "pico_project.py --gui". -* Configure the project but do not select Create VSCode project under the IDE options. +* Change the project name to the name of your folder. Change the location to "/workspaces". +* Configure the rest of the project as desired but do not select Create VSCode project under the IDE options. * Click OK to generate the code. * Click Quit to exit the code generator. -* Copy the .devcontainer folder from the dev container repository to the project folder. -* Copy the .vscode folder from the dev container repository to the project folder. -* In VSCode, select File > Open Folder and select the project folder. -* Click OK and open the project in the dev container. -**Confirm you can build and debug the project** +**Build and debug the project** -* In VSCode, open the Settings menu (\\P) and choose CMake: Select a Kit. -* Chose the arm-none-eabi compiler. -* Build the executable as normal. -* You can now debug the executable using the Run and Debug extension. +* In the left hand pane, select the Run and Debug icon +* In VSCode, press P and select the command CMake: Select a Kit +* Select the GCC 10.3.1 arm-none-eabi compiler. +* In VSCode, press P and select the command CMake: Select a Variant +* Select the Debug variant +* At the top of the screen in the Run and Debug dropdown select Cortext Debug +* Click the green arrow. If prompted to select a launch target select your project. +* The project will build and run in the debugger. ## Environment Variables @@ -57,7 +62,7 @@ * EXTRAS is installed in /apps/pico-extras * PICO-PROJECT-GENERATOR is installed in /apps/pico-project-generator * PICO-VGA is installed in /apps/pico-vga -* ARDUINO-CORE is installed in /apps/arduino-core -* ARDUINO-PICO is installed in /apps/arduino-pico +* Arduino pico libraries are available in /apps/arduino-pico +* Arduino core libraries are available in /apps/arduino-core * All USB devices are exported to container - so the picoprobe can be found and used. * USB Device /dev/ttyACM0 is exported to container for monitoring From e48df727890d19df208b298bde2c562083b5e385 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 11 Nov 2024 18:07:36 -0500 Subject: [PATCH 9/9] Turned off error on warnings for openocd. Updated README.md. --- .devcontainer/Dockerfile | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2882a63..91a35a5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -49,7 +49,7 @@ RUN cd /apps && \ git clone https://github.com/earlephilhower/ArduinoCore-API.git arduino-core ENV ARDUINO_CORE_PATH=/apps/arduino-core RUN git clone https://github.com/raspberrypi/openocd.git -b picoprobe --depth=1 && \ - cd openocd && ./bootstrap && ./configure --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install && \ + cd openocd && ./bootstrap && ./configure --disable-werror --enable-ftdi --enable-sysfsgpio --enable-picoprobe && make -j 8 install && \ cd /apps && git clone https://github.com/raspberrypi/picotool.git --depth=1 && \ cd picotool && mkdir build && cd build && cmake ../ && make -j 8 && cp picotool /usr/local/bin && \ cd /apps && git clone https://github.com/wtarreau/bootterm.git --depth=1 && \ diff --git a/README.md b/README.md index 5002470..7590adf 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,8 @@ **Build and debug the project** -* In the left hand pane, select the Run and Debug icon +* In the VSCode project Explorer pane, delete the project's build folder. +* In the VSCode left hand pane, select the Run and Debug icon * In VSCode, press P and select the command CMake: Select a Kit * Select the GCC 10.3.1 arm-none-eabi compiler. * In VSCode, press P and select the command CMake: Select a Variant