Skip to content

Commit 3461d65

Browse files
authored
add some missing pico_config and pico_cmake_config entries (#2559)
1 parent e298fe6 commit 3461d65

File tree

18 files changed

+42
-24
lines changed

18 files changed

+42
-24
lines changed

bazel/config/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ label_flag(
247247
build_setting_default = "//bazel:generate_config_header",
248248
)
249249

250-
# PICO_BAZEL_CONFIG: PICO_CLIB, [Bazel only] The flavor of libc porting layer to use. auto infers the correct value to use from PICO_TOOLCHAIN, group=pico_standard_link
250+
# PICO_BAZEL_CONFIG: PICO_CLIB, The C library to use e.g. newlib/picolibc/llvm_libc, type=string, default=based on PICO_COMPILER, group=build, docref=cmake-toolchain-config
251251
string_flag(
252252
name = "PICO_CLIB",
253253
build_setting_default = "auto",

cmake/pico_pre_load_platform.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,28 @@ set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}")
1515

1616
# If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting
1717
if (NOT PICO_DEFAULT_BOARD_rp2040)
18+
# PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD when PICO_PLATFORM is rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config
1819
set(PICO_DEFAULT_BOARD_rp2040 "pico")
1920
endif()
2021
if (NOT PICO_DEFAULT_BOARD_rp2350)
22+
# PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD when PICO_PLATFORM is rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config
2123
set(PICO_DEFAULT_BOARD_rp2350 "pico2")
2224
endif()
2325
if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s)
26+
# PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD when PICO_PLATFORM is rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config
2427
set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2")
2528
endif()
2629
if (NOT PICO_DEFAULT_BOARD_rp2350-riscv)
30+
# PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD when PICO_PLATFORM is rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config
2731
set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2")
2832
endif()
2933
if (NOT PICO_DEFAULT_BOARD_host)
34+
# PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD when PICO_PLATFORM is host, type=string, default=none, group=build, docref=cmake-platform-board-config
3035
set(PICO_DEFAULT_BOARD_host "none")
3136
endif()
3237

3338
if (NOT PICO_DEFAULT_PLATFORM)
39+
# PICO_CMAKE_CONFIG: PICO_DEFAULT_PLATFORM, The default for PICO_PLATFORM if not specified, type=string, default=rp2040, group=build, docref=cmake-platform-board-config
3440
set(PICO_DEFAULT_PLATFORM "rp2040")
3541
endif()
3642

@@ -72,7 +78,7 @@ endif()
7278

7379
list(APPEND PICO_INCLUDE_DIRS ${PICO_SDK_PATH}/src/boards/include) # so boards/foo.h can be explicitly included
7480

75-
# PICO_CMAKE_CONFIG: PICO_DEFAULT_RP2350_PLATFORM, Default actual platform to build for if rp2350 is specified for PICO_PLATFORM e.g. rp2350-arm-s/rp2350-riscv, type=string, default=rp2350-arm-s, group=build
81+
# PICO_CMAKE_CONFIG: PICO_DEFAULT_RP2350_PLATFORM, Default actual platform to build for if rp2350 is specified for PICO_PLATFORM e.g. rp2350-arm-s/rp2350-riscv, type=string, default=rp2350-arm-s, group=build, docref=cmake-platform-board-config
7682
if (DEFINED ENV{PICO_DEFAULT_RP2350_PLATFORM} AND NOT PICO_DEFAULT_RP2350_PLATFORM)
7783
set(PICO_DEFAULT_RP2350_PLATFORM $ENV{PICO_DEFAULT_RP2350_PLATFORM})
7884
endif()

cmake/pico_pre_load_toolchain.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if (DEFINED PICO_COMPILER)
4848
if (NOT PICO_COMPILER STREQUAL ORIG_PICO_COMPILER)
4949
message("Accepting PICO_COMPILER value '${ORIG_PICO_COMPILER}' for compatibility, but using '${PICO_COMPILER}' instead")
5050
endif()
51+
# PICO_CMAKE_CONFIG: PICO_TOOLCHAIN_DIR, Path to search for toolchain CMake files, type=string, default=<sdk_path>/preload/toolchains, group=build, docref=cmake-toolchain-config
5152
if (NOT DEFINED PICO_TOOLCHAIN_DIR)
5253
set(PICO_TOOLCHAIN_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/toolchains")
5354
endif()

cmake/preload/toolchains/pico_arm_cortex_m33_gcc.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set(PICO_DEFAULT_GCC_TRIPLE arm-none-eabi)
33

44
set(PICO_COMMON_LANG_FLAGS " -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp")
55
set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mfloat-abi=softfp")
6+
# PICO_CMAKE_CONFIG: PICO_NO_CMSE, Disable CMSE compiler extensions, type=bool, default=0, group=build, docref=cmake-toolchain-config
67
if (NOT PICO_NO_CMSE)
78
set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mcmse")
89
endif()

cmake/preload/toolchains/util/set_flags.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# PICO_CMAKE_CONFIG: PICO_DEOPTIMIZED_DEBUG, Disable all compiler optimization in debug builds, type=bool, default=0, group=build, docref=cmake-toolchain-config
12
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
3+
# PICO_CMAKE_CONFIG: PICO_DEBUG_INFO_IN_RELEASE, Include debug information in release builds, type=bool, default=1, group=build, docref=cmake-toolchain-config
24
option(PICO_DEBUG_INFO_IN_RELEASE "Include debug info in release builds" 1)
35

46
get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)

src/rp2040/boot_stage2/include/boot_stage2/config.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
#include "pico.h"
1313

14-
// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2
14+
// PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider from clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2. This define applies to compilation of the boot stage 2 not the main application, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2
15+
16+
// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system. This define applies to compilation of the boot stage 2 not the main application, group=boot_stage2
1517
#ifdef PICO_BUILD_BOOT_STAGE2_NAME
1618
#define _BOOT_STAGE2_SELECTED
1719
#else
1820
// check that multiple boot stage 2 options haven't been set...
1921

20-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_IS25LP080, Select boot2_is25lp080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
22+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_IS25LP080, Select boot2_is25lp080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
2123
#ifndef PICO_BOOT_STAGE2_CHOOSE_IS25LP080
2224
#define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 0
2325
#elif PICO_BOOT_STAGE2_CHOOSE_IS25LP080
@@ -26,7 +28,7 @@
2628
#endif
2729
#define _BOOT_STAGE2_SELECTED
2830
#endif
29-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25Q080, Select boot2_w25q080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
31+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25Q080, Select boot2_w25q080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
3032
#ifndef PICO_BOOT_STAGE2_CHOOSE_W25Q080
3133
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 0
3234
#elif PICO_BOOT_STAGE2_CHOOSE_W25Q080
@@ -35,7 +37,7 @@
3537
#endif
3638
#define _BOOT_STAGE2_SELECTED
3739
#endif
38-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25X10CL, Select boot2_w25x10cl as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
40+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25X10CL, Select boot2_w25x10cl as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
3941
#ifndef PICO_BOOT_STAGE2_CHOOSE_W25X10CL
4042
#define PICO_BOOT_STAGE2_CHOOSE_W25X10CL 0
4143
#elif PICO_BOOT_STAGE2_CHOOSE_W25X10CL
@@ -44,7 +46,7 @@
4446
#endif
4547
#define _BOOT_STAGE2_SELECTED
4648
#endif
47-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_AT25SF128A, Select boot2_at25sf128a as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
49+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_AT25SF128A, Select boot2_at25sf128a as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
4850
#ifndef PICO_BOOT_STAGE2_CHOOSE_AT25SF128A
4951
#define PICO_BOOT_STAGE2_CHOOSE_AT25SF128A 0
5052
#elif PICO_BOOT_STAGE2_CHOOSE_AT25SF128A
@@ -54,7 +56,7 @@
5456
#define _BOOT_STAGE2_SELECTED
5557
#endif
5658

57-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H, Select boot2_generic_03h as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=1, group=boot_stage2
59+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H, Select boot2_generic_03h as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=1, group=boot_stage2
5860
#if defined(PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H) && PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H
5961
#ifdef _BOOT_STAGE2_SELECTED
6062
#error multiple boot stage 2 options chosen

src/rp2350/boot_stage2/include/boot_stage2/config.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111

1212
#include "pico.h"
1313

14-
// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2
14+
// PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider from clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2. This define applies to compilation of the boot stage 2 not the main application, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2
15+
// PICO_CONFIG: PICO_FLASH_SPI_RXDELAY, Receive delay in 1/2 clock cycles to use for serial flash communications in boot stage 2. This define applies to compilation of the boot stage 2 not the main application, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2
16+
17+
// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system. This define applies to compilation of the boot stage 2 not the main application, group=boot_stage2
1518
#ifdef PICO_BUILD_BOOT_STAGE2_NAME
1619
#define _BOOT_STAGE2_SELECTED
1720
#else
1821
// check that multiple boot stage 2 options haven't been set...
1922

20-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_IS25LP080, Select boot2_is25lp080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
23+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_IS25LP080, Select boot2_is25lp080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
2124
#ifndef PICO_BOOT_STAGE2_CHOOSE_IS25LP080
2225
#define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 0
2326
#elif PICO_BOOT_STAGE2_CHOOSE_IS25LP080
@@ -26,7 +29,7 @@
2629
#endif
2730
#define _BOOT_STAGE2_SELECTED
2831
#endif
29-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25Q080, Select boot2_w25q080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
32+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25Q080, Select boot2_w25q080 as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
3033
#ifndef PICO_BOOT_STAGE2_CHOOSE_W25Q080
3134
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 0
3235
#elif PICO_BOOT_STAGE2_CHOOSE_W25Q080
@@ -35,7 +38,7 @@
3538
#endif
3639
#define _BOOT_STAGE2_SELECTED
3740
#endif
38-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25X10CL, Select boot2_w25x10cl as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
41+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_W25X10CL, Select boot2_w25x10cl as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
3942
#ifndef PICO_BOOT_STAGE2_CHOOSE_W25X10CL
4043
#define PICO_BOOT_STAGE2_CHOOSE_W25X10CL 0
4144
#elif PICO_BOOT_STAGE2_CHOOSE_W25X10CL
@@ -44,7 +47,7 @@
4447
#endif
4548
#define _BOOT_STAGE2_SELECTED
4649
#endif
47-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_AT25SF128A, Select boot2_at25sf128a as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=0, group=boot_stage2
50+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_AT25SF128A, Select boot2_at25sf128a as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=0, group=boot_stage2
4851
#ifndef PICO_BOOT_STAGE2_CHOOSE_AT25SF128A
4952
#define PICO_BOOT_STAGE2_CHOOSE_AT25SF128A 0
5053
#elif PICO_BOOT_STAGE2_CHOOSE_AT25SF128A
@@ -54,7 +57,7 @@
5457
#define _BOOT_STAGE2_SELECTED
5558
#endif
5659

57-
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H, Select boot2_generic_03h as the boot stage 2 when no boot stage 2 selection is made by the CMake build, type=bool, default=1, group=boot_stage2
60+
// PICO_CONFIG: PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H, Select boot2_generic_03h as the boot stage 2 when no boot stage 2 selection is made by the CMake build. This define applies to compilation of the boot stage 2 not the main application, type=bool, default=1, group=boot_stage2
5861
#if defined(PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H) && PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H
5962
#ifdef _BOOT_STAGE2_SELECTED
6063
#error multiple boot stage 2 options chosen

src/rp2_common/pico_btstack/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PICO_CMAKE_CONFIG: PICO_BTSTACK_PATH, Path to an alternative version of btstack overriding the version in pico-sdk/lib/btstack. Can be passed to cmake or set in your environment, type=string, group=pico_btstack
1+
# PICO_CMAKE_CONFIG: PICO_BTSTACK_PATH, Path to BTstack. Can be passed to CMake or set in your environment if you do not wish to use the version included with the SDK, type=string, default=<PICO_SDK_PATH>/lib/btstack, group=pico_btstack
22
if (DEFINED ENV{PICO_BTSTACK_PATH} AND (NOT PICO_BTSTACK_PATH))
33
set(PICO_BTSTACK_PATH $ENV{PICO_BTSTACK_PATH})
44
message("Using PICO_BTSTACK_PATH from environment ('${PICO_BTSTACK_PATH}')")

src/rp2_common/pico_clib_interface/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ if (NOT TARGET pico_clib_interface)
3535
pico_mirrored_target_link_libraries(pico_llvm_libc_interface INTERFACE pico_stdio)
3636

3737
if (NOT PICO_CLIB)
38+
# PICO_CMAKE_CONFIG: PICO_CLIB, The C library to use e.g. newlib/picolibc/llvm_libc, type=string, default=based on PICO_COMPILER, group=build, docref=cmake-toolchain-config
3839
set(PICO_CLIB newlib)
3940
endif()
4041

src/rp2_common/pico_cyw43_driver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PICO_CMAKE_CONFIG: PICO_CYW43_DRIVER_PATH, Path to an alternative version of cyw43-driver overriding the version in pico-sdk/lib/cyw43-driver, type=string, group=pico_cyw43_driver
1+
# PICO_CMAKE_CONFIG: PICO_CYW43_DRIVER_PATH, Path to cyw43-driver. Can be passed to CMake or set in your environment if you do not wish to use the version included with the SDK, type=string, default=<PICO_SDK_PATH>/lib/cyw43-driver, group=pico_cyw43_driver
22
if (DEFINED ENV{PICO_CYW43_DRIVER_PATH} AND (NOT PICO_CYW43_DRIVER_PATH))
33
set(PICO_CYW43_DRIVER_PATH $ENV{PICO_CYW43_DRIVER_PATH})
44
message("Using PICO_CYW43_DRIVER_PATH from environment ('${PICO_CYW43_DRIVER_PATH}')")

0 commit comments

Comments
 (0)