Skip to content

Commit

Permalink
Merge branch 'develop' into best_effort_wfe
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham authored Sep 27, 2024
2 parents 52d93da + 9f56a47 commit efce51a
Show file tree
Hide file tree
Showing 158 changed files with 5,683 additions and 1,248 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
run: choco install .github/workflows/choco_packages.config

- name: Build Project
# bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
shell: bash
shell: pwsh
run: |
mkdir build
cd build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
.vscode
cmake-*
.cache
.DS_Store
build
build-*
Expand Down
12 changes: 11 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "pico-sdk",
version = "2.0.0",
version = "2.0.1-develop",
)

bazel_dep(name = "platforms", version = "0.0.9")
Expand All @@ -26,6 +26,14 @@ archive_override(

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "arm_gcc_linux-aarch64",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
sha256 = "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a",
strip_prefix = "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi",
url = "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz",
)

http_archive(
name = "arm_gcc_linux-x86_64",
build_file = "//bazel/toolchain:gcc_arm_none_eabi.BUILD",
Expand Down Expand Up @@ -128,6 +136,8 @@ http_archive(
)

register_toolchains(
"//bazel/toolchain:linux-aarch64-rp2040",
"//bazel/toolchain:linux-aarch64-rp2350",
"//bazel/toolchain:linux-x86_64-rp2040",
"//bazel/toolchain:linux-x86_64-rp2350",
"//bazel/toolchain:win-x86_64-rp2040",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ You can install the [Raspberry Pi Pico Visual Studio Code extension](https://mar
These instructions are extremely terse, and Linux-based only. For detailed steps,
instructions for other platforms, and just in general, we recommend you see [Raspberry Pi Pico-Series C/C++ SDK](https://rptl.io/pico-c-sdk)

1. Install CMake (at least version 3.13), and a GCC cross compiler
1. Install CMake (at least version 3.13), python 3, a native compiler, and a GCC cross compiler
```
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
sudo apt install cmake python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
```
1. Set up your project to point to use the Raspberry Pi Pico SDK

Expand Down Expand Up @@ -200,4 +200,4 @@ instructions for other platforms, and just in general, we recommend you see [Ras
# RISC-V support on RP2350
See [Raspberry Pi Pico-series C/C++ SDK](https://rptl.io/pico-c-sdk) for information on setting up a build environment for RISC-V on RP2350.
See [Raspberry Pi Pico-series C/C++ SDK](https://rptl.io/pico-c-sdk) for information on setting up a build environment for RISC-V on RP2350.
8 changes: 7 additions & 1 deletion bazel/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ bool_flag(
build_setting_default = True,
)

# PICO_BAZEL_CONFIG: PICO_DEFAULT_UART_BAUD_RATE, Define the default UART baudrate, type=int, max=921600, default=115200, group=hardware_uart
int_flag(
name = "PICO_DEFAULT_UART_BAUD_RATE",
build_setting_default = 115200,
)

# PICO_BAZEL_CONFIG: PICO_STDIO_USB, Option to globally enable stdio USB for all targets by default, type=bool, default=0, group=pico_stdlib
bool_flag(
name = "PICO_STDIO_USB",
Expand Down Expand Up @@ -151,7 +157,7 @@ bool_flag(
build_setting_default = True,
)

# PICO_BAZEL_CONFIG: PICO_CMSIS_PATH, Label of a cc_ibrary providing CMSIS core, default="included stub CORE only impl", group=build
# PICO_BAZEL_CONFIG: PICO_CMSIS_PATH, Label of a cc_ibrary providing CMSIS core, type=string, default="included stub CORE only impl", group=build
label_flag(
name = "PICO_CMSIS_PATH",
build_setting_default = "//src/rp2_common/cmsis:cmsis_core",
Expand Down
1 change: 1 addition & 0 deletions bazel/toolchain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ cc_feature(

HOSTS = (
("linux", "x86_64"),
("linux", "aarch64"),
("win", "x86_64"),
("mac", "x86_64"),
("mac", "aarch64"),
Expand Down
7 changes: 7 additions & 0 deletions bazel/util/transition.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,18 @@ rp2040_bootloader_binary = declare_transtion(
"_allowlist_function_transition": attr.label(
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
),
"_link_extra_libs": attr.label(default = "//bazel:empty_cc_lib"),
},
flag_overrides = {
# We don't want --custom_malloc to ever apply to the bootloader, so
# always explicitly override it here.
"//command_line_option:custom_malloc": "_malloc",

# Platforms will commonly depend on bootloader components in every
# binary via `link_extra_libs`, so we must drop these deps when
# building the bootloader binaries themselves in order to avoid a
# circular dependency.
"@bazel_tools//tools/cpp:link_extra_libs": "_link_extra_libs",
},
)

Expand Down
9 changes: 8 additions & 1 deletion cmake/Platform/PICO.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# this is included because toolchain file sets SYSTEM_NAME=PICO

set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
set(CMAKE_EXECUTABLE_SUFFIX .elf)
set(CMAKE_EXECUTABLE_SUFFIX .elf)

# include paths to find installed tools
if(CMAKE_HOST_WIN32)
include(Platform/WindowsPaths)
else()
include(Platform/UnixPaths)
endif()
4 changes: 2 additions & 2 deletions cmake/pico_pre_load_platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (DEFINED ENV{PICO_PLATFORM} AND NOT PICO_PLATFORM)
endif()
set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}")

# If PICO_PLATFORM is specified byt not PICO_BOARD, we'll make a stab at defaulting
# If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting
if (NOT PICO_DEFAULT_BOARD_rp2040)
set(PICO_DEFAULT_BOARD_rp2040 "pico")
endif()
Expand Down Expand Up @@ -84,7 +84,7 @@ if (NOT COMMAND pico_expand_pico_platform)
function(pico_expand_pico_platform FUNC DO_MESSAGE)
if (${FUNC} STREQUAL "rp2350")
if (DO_MESSAGE)
message("Auto-converting non-specific PICO_PLATFORM='rp2350' to 'rp2350-arm-s'")
message("Auto-converting non-specific PICO_PLATFORM='rp2350' to '${PICO_DEFAULT_RP2350_PLATFORM}'")
endif()
set(${FUNC} "${PICO_DEFAULT_RP2350_PLATFORM}" PARENT_SCOPE)
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/preload/toolchains/util/pico_arm_gcc_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
# include our Platform/PICO.cmake
set(CMAKE_SYSTEM_NAME PICO)

# PICO_CMAKE_CONFIG: PICO_GCC_TRIPLE, List of GCC_TRIPLES -- usually only one -- to try when searching for a compiler. This may be specified the user environment, type=int, default=PICO_DEFAULT_GCC_TRIPLE which is set based on PICO_COMPILER, group=pico_base, doxref=cmake-toolchain-config
# PICO_CMAKE_CONFIG: PICO_GCC_TRIPLE, List of GCC_TRIPLES -- usually only one -- to try when searching for a compiler. This may be specified the user environment, type=int, default=PICO_DEFAULT_GCC_TRIPLE which is set based on PICO_COMPILER, group=pico_base, docref=cmake-toolchain-config
if (NOT PICO_GCC_TRIPLE)
if (DEFINED ENV{_SAVED_PICO_GCC_TRIPLE})
# saved within the same cmake invocation
Expand Down
4 changes: 2 additions & 2 deletions pico_sdk_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set(PICO_SDK_VERSION_MAJOR 2)
set(PICO_SDK_VERSION_MINOR 0)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
set(PICO_SDK_VERSION_REVISION 0)
set(PICO_SDK_VERSION_REVISION 1)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
#set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)

# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base
Expand Down
5 changes: 5 additions & 0 deletions src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ alias(
"//src/common/hardware_claim:__pkg__",
"//src/common/pico_base_headers:__pkg__",
"//src/common/pico_binary_info:__pkg__",
# These libraries sometimes need the host version even though they live
# in rp2_common.
"//src/rp2_common/boot_bootrom_headers:__pkg__",
"//src/rp2_common/hardware_boot_lock:__pkg__",
"//src/rp2_common/pico_flash:__pkg__",
],
)

Expand Down
2 changes: 2 additions & 0 deletions src/boards/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BOARD_CHOICES = [
"0xcb_helios",
"adafruit_feather_rp2040_usb_host",
"adafruit_feather_rp2040",
"adafruit_feather_rp2350",
"adafruit_itsybitsy_rp2040",
"adafruit_kb2040",
"adafruit_macropad_rp2040",
Expand All @@ -18,6 +19,7 @@ BOARD_CHOICES = [
"arduino_nano_rp2040_connect",
"cytron_maker_pi_rp2040",
"datanoisetv_rp2040_dsp",
"datanoisetv_rp2350_dsp",
"defcon32_badge",
"eetree_gamekit_rp2040",
"garatronic_pybstick26_rp2040",
Expand Down
85 changes: 85 additions & 0 deletions src/boards/include/boards/adafruit_feather_rp2350.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2024 Scott Shawcroft for Adafruit Industries
*
* SPDX-License-Identifier: BSD-3-Clause
*/

// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------

// This header may be included by other board headers as "boards/adafruit_feather_rp2350.h"

// pico_cmake_set PICO_PLATFORM=rp2350

#ifndef _BOARDS_ADAFRUIT_FEATHER_RP2350_H
#define _BOARDS_ADAFRUIT_FEATHER_RP2350_H

// For board detection
#define ADAFRUIT_FEATHER_RP2350

// --- RP2350 VARIANT ---
#define PICO_RP2350A 1

// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif

// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 7
#endif

#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 21
#endif

// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 2
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 3
#endif

// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 22
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 23
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 20
#endif

// --- FLASH ---

#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif

// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif

#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif

#endif
2 changes: 2 additions & 0 deletions src/boards/include/boards/amethyst_fpga.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

// FIXME delete this file before release (board file for Amethyst FPGA platform)

// pico_cmake_set PICO_PLATFORM=rp2350

#ifndef _BOARDS_AMETHYST_FPGA_H
#define _BOARDS_AMETHYST_FPGA_H

Expand Down
63 changes: 63 additions & 0 deletions src/boards/include/boards/datanoisetv_rp2350_dsp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
//
//------------------------------------------------------------------------------------------
// Board definition for the DatanoiseTV RP2350 DSP Board
//
// This header may be included by other board headers as "boards/datanoisetv_rp2350_dsp.h"

// pico_cmake_set PICO_PLATFORM=rp2350

#ifndef _BOARDS_DATANOISETV_RP2350_DSP_H
#define _BOARDS_DATANOISETV_RP2350_DSP_H

// For board detection
#define DATANOISETV_RP2350_DSP

// --- RP2350 VARIANT ---
#define PICO_RP2350A 1

// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 24
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 25
#endif

// -- FLASH --
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1

#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif

// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (8 * 1024 * 1024)
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif

#ifndef PICO_RP2350_A2_SUPPORTED
#define PICO_RP2350_A2_SUPPORTED 1
#endif

// --- I2S ---
#ifndef PICO_AUDIO_I2S_DATA_PIN
#define PICO_AUDIO_I2S_DATA_PIN 16
#endif
#ifndef PICO_AUDIO_I2S_CLOCK_PIN_BASE
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE 17
#endif

#endif
Loading

0 comments on commit efce51a

Please sign in to comment.