From beb64b752ca17dc68ac507bedde9a26d03513de9 Mon Sep 17 00:00:00 2001 From: InfraredAces <44279698+InfraredAces@users.noreply.github.com> Date: Wed, 2 Oct 2024 05:46:45 -0700 Subject: [PATCH] Reorganize development documentation (#63) * Version documentation for 0.7.8 * Remove unnecessary versions * Separate and reorganize development docs * Remove versioned documentation * Update sidebarsDevelopment.json --- ...evelopment.mdx => board-configuration.mdx} | 283 +----------------- development/build-environment.mdx | 262 ++++++++++++++++ development/compile-firmware.mdx | 114 +++++++ sidebarsDevelopment.json | 5 +- 4 files changed, 396 insertions(+), 268 deletions(-) rename development/{firmware-development.mdx => board-configuration.mdx} (67%) create mode 100644 development/build-environment.mdx create mode 100644 development/compile-firmware.mdx diff --git a/development/firmware-development.mdx b/development/board-configuration.mdx similarity index 67% rename from development/firmware-development.mdx rename to development/board-configuration.mdx index f633f3f..c146bbe 100644 --- a/development/firmware-development.mdx +++ b/development/board-configuration.mdx @@ -1,267 +1,16 @@ --- -title: Firmware Development +title: Board Configuration # tags: # - pagination_next: null pagination_prev: null -description: "Documentation on building and developing for GP2040-CE Firmware" +description: "Documentation on creating a board configuration for GP2040-CE Firmware" --- import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; -# Firmware Development - -GP2040-CE is written in C++ and set up as a standard Pico SDK project. - -See [Getting Started with the Raspberry Pi Pico](https://rptl.io/pico-get-started). - -## Environment Setup - -Most of this will be parroting the above linked PDF from the Raspberry Pi Foundation. - - - - -1. Download and install [CMake](https://github.com/Kitware/CMake/releases/download/v3.27.4/cmake-3.27.4-windows-x86_64.msi). -2. Install [NodeJS](https://nodejs.org/en/download) -3. Install [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) -4. Download and install [pico-setup-windows-x64-standalone](https://github.com/raspberrypi/pico-setup-windows/releases/). -5. Download and install VSCode. -6. Download and install [Windows Terminal](https://github.com/microsoft/terminal/releases/tag/v1.17.11461.0). -7. Open Windows Terminal. -8. Download the GP2040-CE-main repository by running the following commands in the Windows Terminal. This will download the folder to `C:\Users\user\GP2040-CE`. - - ```console - git clone https://github.com/OpenStickCommunity/GP2040-CE.git - cd GP2040-CE - git submodule update --init - ``` - -After installing the Raspberry Pi Pico SDK, you should now have a shortcut to "Pico-Visual Studio Code" (search for it using Windows Search). - -8. Open "Pico-Visual Studio Code" via Windows search. This is a shortcut with pre-configured environment variables (this will be explained later). -9. Navigate to the Extensions window by pressing `Ctrl+Shift+X`. -10. Install "CMake Tools" by Microsoft. -11. Open the GP2040-CE folder you downloaded earlier via "File > Open Folder." - - - - -1. Install the latest[Arm GNU Toolchain](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) -2. Install latest version of [CMake](https://cmake.org/download/) -3. Install [Visual Studio Build tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022), or the full [Visual Studio Community Edition IDE](https://visualstudio.microsoft.com/downloads/#visual-studio-community-2022) - - Make sure to select the Desktop development with C++ workload - - Select the latest Windows 10 or Windows 11 SDK from the Individual Components -4. Install [Python 3.10](https://www.python.org/downloads/windows/) - - At the end of the installation, there is an option to disable max file path length. You want to select this. -5. Install [Visual Studio Code](https://code.visualstudio.com/) - Optional -6. Install git - - Set default editor to anything other than VIM, such as Visual Studio Code -7. Install [NodeJS](https://nodejs.org/en/download) and NPM -8. Clone the Pico SDK to your local computer - - ```console - git clone https://github.com/raspberrypi/pico-sdk.git - cd pico-sdk - git submodule update --init - cd .. - ``` - -9. From a command-prompt, Clone GP2040-CE to your local computer - - ```console - git clone https://github.com/OpenStickCommunity/GP2040-CE.git - cd GP2040-CE - ``` - - - - -#### Ubuntu - -This setup assumes an understanding of Linux terminal usage. - -1. Get the SDK - - ```bash - cd ~/ - mkdir pico - cd pico - git clone https://github.com/raspberrypi/pico-sdk.git --branch master - cd pico-sdk - git submodule update --init - cd .. - ``` - -2. Install the toolchain - - ```bash - sudo apt update - sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential - ``` - - - May additionally need to install `libstdc++-arm-none-eabi-newlib` - -3. Install NodeJS and NPM - - ```bash - curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\ - sudo apt-get install -y nodejs - ``` - -4. Get GP2040-CE - - ```bash - git clone https://github.com/OpenStickCommunity/GP2040-CE.git - cd GP2040-CE - git submodule update --init - ``` - -#### Raspberry Pi - -This setup script requires approximately 2.5GB of disk space on your SD card. - -1. Download the setup script - - ```bash - wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh - ``` - -2. Make script executable and Run it. - - ```bash - chmod +x pico_setup.sh - ``` - -3. Install NodeJS and NPM - - ```bash - curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\ - sudo apt-get install -y nodejs - ``` - -4. Reboot your Pi - - ```bash - sudo reboot - ``` - -5. Get GP2040-CE - - ```bash - git clone https://github.com/OpenStickCommunity/GP2040-CE.git - cd GP2040-CE - git submodule update --init - ``` - - - - -## Building - -### Environment Variables - -A number of new environment variables have been setup to control parts of the build flow. - -| Name | Default | Description | -| ------------------ | ------- | ------------------------------------------------------------------------------------------------------- | -| GP2040_BOARDCONFIG | Pico | The boards.h config file to use for the build. | -| SKIP_WEBBUILD | FALSE | Determines whether the web configurator is built during the cmake configuration step. | -| SKIP_SUBMODULES | FALSE | Determines whether the submodule init command is run automatically during the cmake configuration step. | - -#### SDK Variables - -There are a few SDK variables we take advantage of for our builds. - -| Name | Default | Description | -| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| PICO_BOARD | pico | This is the embedded board that the RP2040 chip is part of. By default, it assumes the Pico. This variable would match the `` file in the board's configs folder. | - - - - -After installing the Raspberry Pi Pico SDK, you should now have a shortcut to "Pico-Visual Studio Code" (search for it using Windows Search). This shortcut should already have everything configured, **allowing you to skip to step 7**. If you're experiencing compilation issues, consider following the manual steps outlined here. - -Ensure the `PICO_SDK_PATH` environment variable is set: - -1. Search for "Edit environment variables for your account" in Windows. -2. Under "User Variables," click "New...". -3. In the dialog that appears, enter `PICO_SDK_PATH` for the Variable Name. -4. Click "Browse Directory" and navigate to `C:\Program Files\Raspberry Pi\Pico SDK v1.5.1\pico-sdk` for the Variable Value. -5. Create another new variable. -6. Enter `GP2040_BOARDCONFIG` for the Variable Name. -7. Enter `Pico` (or the name of your edited config folder) for the Variable Value. - -You can also set the variable within VSCode: - -1. Press `Ctrl + ,` to open the settings. -2. Use the search bar to find "CMake." -3. Scroll until you see "CMake: Configure Environment." -4. Click "Add Item." -5. Key: `GP2040_BOARDCONFIG` -6. Value: `Pico` (or your working folder name). - -When prompted, choose `GCC 10.3.1 ARM NONE EABI` for "Select a kit for GP2040-CE" - -From inside VSCode: - -1. Click the CMake icon on the left sidebar of VSCode. -2. You'll see three icons at the top-right corner of the CMake project outline. Click the "Configure All Projects" icon (looks like a page with an arrow). -3. Wait for the configuration process to complete. If progress isn't visible, open a new terminal in VSCode by clicking on the "Terminal" menu, then "New Terminal". A new terminal window will open at the bottom, navigate the "Output" tab. -4. Click "Build All Projects" in the CMake project outline. -5. The files should be in a new folder named "build" inside the GP2040-CE folder - - - - -Start in the GP2040-CE folder. **From a Developer Powershell or Developer Command Command Prompt**: - -:::note - -A new Powershell or Command Prompt session will be required after setting an environment variable. - -::: - -1. Ensure you have the `PICO_SDK_PATH` environment variable set to the path to your pico-sdk folder. -2. (optional) Set the `GP2040_BOARDCONFIG` environment variable to the folder name for your board configuration. - - - Default value is `Pico` - -3. Create a build directory, configure the build, and execute the build. - - ```console - mkdir build - cd build - cmake -G "NMake Makefiles" .. - nmake - ``` - -4. Your UF2 file should be in the build directory. - - - - -Start in the GP2040-CE folder - -1. Ensure you have the `PICO_SDK_PATH` environment variable set to the path to your pico-sdk folder. -2. (optional) Set the `GP2040_BOARDCONFIG` environment variable to the folder name for your board configuration. - - Default value is `Pico` -3. Create a build directory, configure the build, and execute the build. - - ```bash - mkdir build - cd build - cmake .. - make - ``` - -4. Your UF2 file should be in the build directory. - - - - -## Configuration +# Configuration :::note @@ -271,18 +20,18 @@ We're looking to move away from compile time configuration, in favor of runtime There are two simple options for building GP2040-CE for your board. You can either edit an existing board definition, or create your own. Several example configurations are located in the repository **[configs](https://github.com/OpenStickCommunity/GP2040-CE/tree/main/configs)** folder. This document will outline setting up a new build configuration. -### Board Configuration Folder +## Board Configuration Folder Each subfolder in [`configs`](https://github.com/OpenStickCommunity/GP2040-CE/tree/main/configs) contains a separate board configuration, which consists of the following: -| Name | Required? | Description | -| ----------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BoardConfig.h` | Yes | The configuration file used when building GP2040-CE for a specific controller/board. Contains initial pin mappings, LED configuration, etc. | -| `README.mdx` | No | Provides information related to this board configuration. Not required for the build process, but suggested for pull requests of new board configurations. | -| `assets/` | No | Folder for containing assets included in the `README.mdx`. Not required for the build process. | -| '\' | No | Board definition file, named after the board itself, used by the Pico SDK for configuring board specific SDK features. [Pico Example](https://github.com/raspberrypi/pico-sdk/blob/master/src/boards/include/boards/pico.h) | +| Name | Required? | Description | +| --------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `BoardConfig.h` | Yes | The configuration file used when building GP2040-CE for a specific controller/board. Contains initial pin mappings, LED configuration, etc. | +| `README.mdx` | No | Provides information related to this board configuration. Not required for the build process, but suggested for pull requests of new board configurations. | +| `assets/` | No | Folder for containing assets included in the `README.mdx`. Not required for the build process. | +| `` | No | Board definition file, named after the board itself, used by the Pico SDK for configuring board specific SDK features. [Pico Example](https://github.com/raspberrypi/pico-sdk/blob/master/src/boards/include/boards/pico.h) | -### Board Configuration (`BoardConfig.h`) +## Board Configuration (`BoardConfig.h`) The following board options are available in the `BoardConfig.h` file: @@ -325,7 +74,7 @@ Create `configs/NewBoard/BoardConfig.h` and add your pin configuration and optio #define BUTTON_LAYOUT BUTTON_LAYOUT_ARCADE ``` -#### RGB LEDs +### RGB LEDs GP2040-CE supports per-button WS2812 and similar RGB LEDs. @@ -378,7 +127,7 @@ An example RGB LED setup in the `BoardConfig.h` file: #define LEDS_BUTTON_L2 11 ``` -#### Player LEDs +### Player LEDs GP2040-CE supports PWM and RGB player LEDs (PLEDs) and can be configured in the `BoardConfig.h` file. @@ -412,7 +161,7 @@ An example PLED setup in the `BoardConfig.h` file: #define PLED4_PIN 15 ``` -#### I2C Displays +### I2C Displays GP2040-CE supports 128x64 monochrome displays that run on the SSD1306, SH1106 or SH1107 drivers. The following options are available for displays: @@ -439,9 +188,9 @@ An example I2C display setup in the `BoardConfig.h` file: #define I2C_SPEED 800000 ``` -### I2C Display Custom Button Layouts +#### I2C Display Custom Button Layouts -As of v0.7.9 you have the ability to create a custom `left` and `right` display layout through the boardconfig.h as `DEFAULT_BOARD_LAYOUT_A` and `DEFAULT_BOARD_LAYOUT_B`. +As of v0.7.9 you have the ability to create a custom `left` and `right` display layout through the boardconfig.h as `DEFAULT_BOARD_LAYOUT_A` and `DEFAULT_BOARD_LAYOUT_B`. You can find an example of how to set this up in the [Zero Rhythm BoardConfig.h](https://github.com/OpenStickCommunity/GP2040-CE/blob/main/configs/ZeroRhythm/BoardConfig.h#L90) file. diff --git a/development/build-environment.mdx b/development/build-environment.mdx new file mode 100644 index 0000000..c4f8a3c --- /dev/null +++ b/development/build-environment.mdx @@ -0,0 +1,262 @@ +--- +title: Set Up Build Environment +# tags: +# - +pagination_next: null +pagination_prev: null +description: "Documentation on setting up the build environment for GP2040-CE firmware development" +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Firmware Development + +GP2040-CE is written in C++ and set up as a standard Pico SDK project. + +See [Getting Started with the Raspberry Pi Pico](https://rptl.io/pico-get-started). + +## Environment Setup + +Most of this will be parroting the above linked PDF from the Raspberry Pi Foundation. + + + + +1. Download and install [CMake](https://github.com/Kitware/CMake/releases/download/v3.27.4/cmake-3.27.4-windows-x86_64.msi). +2. Install [NodeJS](https://nodejs.org/en/download) +3. Install [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +4. Download and install [pico-setup-windows-x64-standalone](https://github.com/raspberrypi/pico-setup-windows/releases/). +5. Download and install VSCode. +6. Download and install [Windows Terminal](https://github.com/microsoft/terminal/releases/tag/v1.17.11461.0). +7. Open Windows Terminal. +8. Download the GP2040-CE-main repository by running the following commands in the Windows Terminal. This will download the folder to `C:\Users\user\GP2040-CE`. + + ```console + git clone https://github.com/OpenStickCommunity/GP2040-CE.git + cd GP2040-CE + git submodule update --init + ``` + +After installing the Raspberry Pi Pico SDK, you should now have a shortcut to "Pico-Visual Studio Code" (search for it using Windows Search). + +8. Open "Pico-Visual Studio Code" via Windows search. This is a shortcut with pre-configured environment variables (this will be explained later). +9. Navigate to the Extensions window by pressing `Ctrl+Shift+X`. +10. Install "CMake Tools" by Microsoft. +11. Open the GP2040-CE folder you downloaded earlier via "File > Open Folder." + + + + +1. Install the latest[Arm GNU Toolchain](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) +2. Install latest version of [CMake](https://cmake.org/download/) +3. Install [Visual Studio Build tools](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022), or the full [Visual Studio Community Edition IDE](https://visualstudio.microsoft.com/downloads/#visual-studio-community-2022) + - Make sure to select the Desktop development with C++ workload + - Select the latest Windows 10 or Windows 11 SDK from the Individual Components +4. Install [Python 3.10](https://www.python.org/downloads/windows/) + - At the end of the installation, there is an option to disable max file path length. You want to select this. +5. Install [Visual Studio Code](https://code.visualstudio.com/) - Optional +6. Install git + - Set default editor to anything other than VIM, such as Visual Studio Code +7. Install [NodeJS](https://nodejs.org/en/download) and NPM +8. Clone the Pico SDK to your local computer + + ```console + git clone https://github.com/raspberrypi/pico-sdk.git + cd pico-sdk + git submodule update --init + cd .. + ``` + +9. From a command-prompt, Clone GP2040-CE to your local computer + + ```console + git clone https://github.com/OpenStickCommunity/GP2040-CE.git + cd GP2040-CE + ``` + + + + +#### Ubuntu + +This setup assumes an understanding of Linux terminal usage. + +1. Get the SDK + + ```bash + cd ~/ + mkdir pico + cd pico + git clone https://github.com/raspberrypi/pico-sdk.git --branch master + cd pico-sdk + git submodule update --init + cd .. + ``` + +2. Install the toolchain + + ```bash + sudo apt update + sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential + ``` + + - May additionally need to install `libstdc++-arm-none-eabi-newlib` + +3. Install NodeJS and NPM + + ```bash + curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\ + sudo apt-get install -y nodejs + ``` + +4. Get GP2040-CE + + ```bash + git clone https://github.com/OpenStickCommunity/GP2040-CE.git + cd GP2040-CE + git submodule update --init + ``` + +#### Raspberry Pi + +This setup script requires approximately 2.5GB of disk space on your SD card. + +1. Download the setup script + + ```bash + wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh + ``` + +2. Make script executable and Run it. + + ```bash + chmod +x pico_setup.sh + ``` + +3. Install NodeJS and NPM + + ```bash + curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\ + sudo apt-get install -y nodejs + ``` + +4. Reboot your Pi + + ```bash + sudo reboot + ``` + +5. Get GP2040-CE + + ```bash + git clone https://github.com/OpenStickCommunity/GP2040-CE.git + cd GP2040-CE + git submodule update --init + ``` + + + + +## Building + +### Environment Variables + +A number of new environment variables have been setup to control parts of the build flow. + +| Name | Default | Description | +| ------------------ | ------- | ------------------------------------------------------------------------------------------------------- | +| GP2040_BOARDCONFIG | Pico | The boards.h config file to use for the build. | +| SKIP_WEBBUILD | FALSE | Determines whether the web configurator is built during the cmake configuration step. | +| SKIP_SUBMODULES | FALSE | Determines whether the submodule init command is run automatically during the cmake configuration step. | + +#### SDK Variables + +There are a few SDK variables we take advantage of for our builds. + +| Name | Default | Description | +| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| PICO_BOARD | pico | This is the embedded board that the RP2040 chip is part of. By default, it assumes the Pico. This variable would match the `` file in the board's configs folder. | + + + + +After installing the Raspberry Pi Pico SDK, you should now have a shortcut to "Pico-Visual Studio Code" (search for it using Windows Search). This shortcut should already have everything configured, **allowing you to skip to step 7**. If you're experiencing compilation issues, consider following the manual steps outlined here. + +Ensure the `PICO_SDK_PATH` environment variable is set: + +1. Search for "Edit environment variables for your account" in Windows. +2. Under "User Variables," click "New...". +3. In the dialog that appears, enter `PICO_SDK_PATH` for the Variable Name. +4. Click "Browse Directory" and navigate to `C:\Program Files\Raspberry Pi\Pico SDK v1.5.1\pico-sdk` for the Variable Value. +5. Create another new variable. +6. Enter `GP2040_BOARDCONFIG` for the Variable Name. +7. Enter `Pico` (or the name of your edited config folder) for the Variable Value. + +You can also set the variable within VSCode: + +1. Press `Ctrl + ,` to open the settings. +2. Use the search bar to find "CMake." +3. Scroll until you see "CMake: Configure Environment." +4. Click "Add Item." +5. Key: `GP2040_BOARDCONFIG` +6. Value: `Pico` (or your working folder name). + +When prompted, choose `GCC 10.3.1 ARM NONE EABI` for "Select a kit for GP2040-CE" + +From inside VSCode: + +1. Click the CMake icon on the left sidebar of VSCode. +2. You'll see three icons at the top-right corner of the CMake project outline. Click the "Configure All Projects" icon (looks like a page with an arrow). +3. Wait for the configuration process to complete. If progress isn't visible, open a new terminal in VSCode by clicking on the "Terminal" menu, then "New Terminal". A new terminal window will open at the bottom, navigate the "Output" tab. +4. Click "Build All Projects" in the CMake project outline. +5. The files should be in a new folder named "build" inside the GP2040-CE folder + + + + +Start in the GP2040-CE folder. **From a Developer Powershell or Developer Command Command Prompt**: + +:::note + +A new Powershell or Command Prompt session will be required after setting an environment variable. + +::: + +1. Ensure you have the `PICO_SDK_PATH` environment variable set to the path to your pico-sdk folder. +2. (optional) Set the `GP2040_BOARDCONFIG` environment variable to the folder name for your board configuration. + + - Default value is `Pico` + +3. Create a build directory, configure the build, and execute the build. + + ```console + mkdir build + cd build + cmake -G "NMake Makefiles" .. + nmake + ``` + +4. Your UF2 file should be in the build directory. + + + + +Start in the GP2040-CE folder + +1. Ensure you have the `PICO_SDK_PATH` environment variable set to the path to your pico-sdk folder. +2. (optional) Set the `GP2040_BOARDCONFIG` environment variable to the folder name for your board configuration. + - Default value is `Pico` +3. Create a build directory, configure the build, and execute the build. + + ```bash + mkdir build + cd build + cmake .. + make + ``` + +4. Your UF2 file should be in the build directory. + + + \ No newline at end of file diff --git a/development/compile-firmware.mdx b/development/compile-firmware.mdx new file mode 100644 index 0000000..9ec4b97 --- /dev/null +++ b/development/compile-firmware.mdx @@ -0,0 +1,114 @@ +--- +title: Compile Firmware +# tags: +# - +pagination_next: null +pagination_prev: null +description: "Documentation on creating a board configuration for GP2040-CE Firmware" +--- + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Building + +## Environment Variables + +A number of new environment variables have been setup to control parts of the build flow. + +| Name | Default | Description | +| ------------------ | ------- | ------------------------------------------------------------------------------------------------------- | +| GP2040_BOARDCONFIG | Pico | The boards.h config file to use for the build. | +| SKIP_WEBBUILD | FALSE | Determines whether the web configurator is built during the cmake configuration step. | +| SKIP_SUBMODULES | FALSE | Determines whether the submodule init command is run automatically during the cmake configuration step. | + +### SDK Variables + +There are a few SDK variables we take advantage of for our builds. + +| Name | Default | Description | +| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| PICO_BOARD | pico | This is the embedded board that the RP2040 chip is part of. By default, it assumes the Pico. This variable would match the `` file in the board's configs folder. | + + + + +After installing the Raspberry Pi Pico SDK, you should now have a shortcut to "Pico-Visual Studio Code" (search for it using Windows Search). This shortcut should already have everything configured, **allowing you to skip to step 7**. If you're experiencing compilation issues, consider following the manual steps outlined here. + +Ensure the `PICO_SDK_PATH` environment variable is set: + +1. Search for "Edit environment variables for your account" in Windows. +2. Under "User Variables," click "New...". +3. In the dialog that appears, enter `PICO_SDK_PATH` for the Variable Name. +4. Click "Browse Directory" and navigate to `C:\Program Files\Raspberry Pi\Pico SDK v1.5.1\pico-sdk` for the Variable Value. +5. Create another new variable. +6. Enter `GP2040_BOARDCONFIG` for the Variable Name. +7. Enter `Pico` (or the name of your edited config folder) for the Variable Value. + +You can also set the variable within VSCode: + +1. Press `Ctrl + ,` to open the settings. +2. Use the search bar to find "CMake." +3. Scroll until you see "CMake: Configure Environment." +4. Click "Add Item." +5. Key: `GP2040_BOARDCONFIG` +6. Value: `Pico` (or your working folder name). + +When prompted, choose `GCC 10.3.1 ARM NONE EABI` for "Select a kit for GP2040-CE" + +From inside VSCode: + +1. Click the CMake icon on the left sidebar of VSCode. +2. You'll see three icons at the top-right corner of the CMake project outline. Click the "Configure All Projects" icon (looks like a page with an arrow). +3. Wait for the configuration process to complete. If progress isn't visible, open a new terminal in VSCode by clicking on the "Terminal" menu, then "New Terminal". A new terminal window will open at the bottom, navigate the "Output" tab. +4. Click "Build All Projects" in the CMake project outline. +5. The files should be in a new folder named "build" inside the GP2040-CE folder + + + + +Start in the GP2040-CE folder. **From a Developer Powershell or Developer Command Command Prompt**: + +:::note + +A new Powershell or Command Prompt session will be required after setting an environment variable. + +::: + +1. Ensure you have the `PICO_SDK_PATH` environment variable set to the path to your pico-sdk folder. +2. (optional) Set the `GP2040_BOARDCONFIG` environment variable to the folder name for your board configuration. + + - Default value is `Pico` + +3. Create a build directory, configure the build, and execute the build. + + ```console + mkdir build + cd build + cmake -G "NMake Makefiles" .. + nmake + ``` + +4. Your UF2 file should be in the build directory. + + + + +Start in the GP2040-CE folder + +1. Ensure you have the `PICO_SDK_PATH` environment variable set to the path to your pico-sdk folder. +2. (optional) Set the `GP2040_BOARDCONFIG` environment variable to the folder name for your board configuration. + - Default value is `Pico` +3. Create a build directory, configure the build, and execute the build. + + ```bash + mkdir build + cd build + cmake .. + make + ``` + +4. Your UF2 file should be in the build directory. + + + \ No newline at end of file diff --git a/sidebarsDevelopment.json b/sidebarsDevelopment.json index 37ea60b..5cdff91 100644 --- a/sidebarsDevelopment.json +++ b/sidebarsDevelopment.json @@ -3,9 +3,12 @@ "contribution-guide", { "type": "category", - "label": "Firmware", + "label": "Build and Compile", "collapsed": false, "items": [ + "build-environment", + "board-configuration", + "compile-firmware", { "type": "category", "label": "Add-ons",