From 99d3cef4e31fa6cae02c2c56a9bd71d4bbaad37c Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Wed, 2 Jul 2025 11:39:11 -0500 Subject: [PATCH 01/13] add some missing pico_config and pico_cmake_config entries --- cmake/pico_pre_load_platform.cmake | 8 +++++++- cmake/pico_pre_load_toolchain.cmake | 1 + cmake/preload/toolchains/pico_arm_cortex_m33_gcc.cmake | 1 + cmake/preload/toolchains/util/set_flags.cmake | 2 ++ src/rp2040/boot_stage2/include/boot_stage2/config.h | 3 +++ src/rp2_common/pico_btstack/CMakeLists.txt | 2 +- src/rp2_common/pico_clib_interface/CMakeLists.txt | 1 + src/rp2_common/pico_cyw43_driver/CMakeLists.txt | 2 +- src/rp2_common/pico_float/include/pico/float.h | 2 ++ src/rp2_common/pico_lwip/CMakeLists.txt | 2 +- src/rp2_common/pico_mbedtls/CMakeLists.txt | 2 +- src/rp2_common/tinyusb/CMakeLists.txt | 2 +- 12 files changed, 22 insertions(+), 6 deletions(-) diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake index ea1127574..df511ecef 100644 --- a/cmake/pico_pre_load_platform.cmake +++ b/cmake/pico_pre_load_platform.cmake @@ -15,22 +15,28 @@ set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}") # If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting if (NOT PICO_DEFAULT_BOARD_rp2040) + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM=rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2040 "pico") endif() if (NOT PICO_DEFAULT_BOARD_rp2350) + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM=rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350 "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s) + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM=rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-riscv) + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM=rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2") endif() if (NOT PICO_DEFAULT_BOARD_host) + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM=host, type=string, default=none, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_host "none") endif() if (NOT PICO_DEFAULT_PLATFORM) + # PICO_CMAKE_CONFIG: PICO_DEFAULT_PLATFORM, The default for PICO_PLATFORM if not specified, type=string, default=pico, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_PLATFORM "rp2040") endif() @@ -72,7 +78,7 @@ endif() list(APPEND PICO_INCLUDE_DIRS ${PICO_SDK_PATH}/src/boards/include) # so boards/foo.h can be explicitly included -# 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 +# 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 if (DEFINED ENV{PICO_DEFAULT_RP2350_PLATFORM} AND NOT PICO_DEFAULT_RP2350_PLATFORM) set(PICO_DEFAULT_RP2350_PLATFORM $ENV{PICO_DEFAULT_RP2350_PLATFORM}) endif() diff --git a/cmake/pico_pre_load_toolchain.cmake b/cmake/pico_pre_load_toolchain.cmake index b41b386cf..7dd391914 100644 --- a/cmake/pico_pre_load_toolchain.cmake +++ b/cmake/pico_pre_load_toolchain.cmake @@ -48,6 +48,7 @@ if (DEFINED PICO_COMPILER) if (NOT PICO_COMPILER STREQUAL ORIG_PICO_COMPILER) message("Accepting PICO_COMPILER value '${ORIG_PICO_COMPILER}' for compatibility, but using '${PICO_COMPILER}' instead") endif() + # PICO_CMAKE_CONFIG: PICO_TOOLCHAIN_DIR, Path to search for toolchain CMake files, type=string, default=/preload/toolchains, group=build, docref=cmake-toolchain-config if (NOT DEFINED PICO_TOOLCHAIN_DIR) set(PICO_TOOLCHAIN_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/toolchains") endif() diff --git a/cmake/preload/toolchains/pico_arm_cortex_m33_gcc.cmake b/cmake/preload/toolchains/pico_arm_cortex_m33_gcc.cmake index 0ba3351f4..013efc9c7 100644 --- a/cmake/preload/toolchains/pico_arm_cortex_m33_gcc.cmake +++ b/cmake/preload/toolchains/pico_arm_cortex_m33_gcc.cmake @@ -3,6 +3,7 @@ set(PICO_DEFAULT_GCC_TRIPLE arm-none-eabi) set(PICO_COMMON_LANG_FLAGS " -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp") set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mfloat-abi=softfp") +# PICO_CMAKE_CONFIG: PICO_NO_CMSE, Disable CMSE compiler extensions, type=bool, default=0, group=build, docref=cmake-toolchain-config if (NOT PICO_NO_CMSE) set(PICO_COMMON_LANG_FLAGS "${PICO_COMMON_LANG_FLAGS} -mcmse") endif() diff --git a/cmake/preload/toolchains/util/set_flags.cmake b/cmake/preload/toolchains/util/set_flags.cmake index 5a7067012..ca1a27d15 100644 --- a/cmake/preload/toolchains/util/set_flags.cmake +++ b/cmake/preload/toolchains/util/set_flags.cmake @@ -1,4 +1,6 @@ +# PICO_CMAKE_CONFIG: PICO_DEOPTIMIZED_DEBUG, Disable all compiler optimization in debug builds, type=bool, default=0, group=build, docref=cmake-toolchain-config option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0) +# PICO_CMAKE_CONFIG: PICO_DEBUG_INFO_IN_RELEASE, Include debug information in release builds, type=bool, default=1, group=build, docref=cmake-toolchain-config option(PICO_DEBUG_INFO_IN_RELEASE "Include debug info in release builds" 1) get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) diff --git a/src/rp2040/boot_stage2/include/boot_stage2/config.h b/src/rp2040/boot_stage2/include/boot_stage2/config.h index ba9bb1f8b..270c5d18f 100644 --- a/src/rp2040/boot_stage2/include/boot_stage2/config.h +++ b/src/rp2040/boot_stage2/include/boot_stage2/config.h @@ -11,6 +11,9 @@ #include "pico.h" +// PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider fron clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 +// PICO_CONFIG: PICO_FLASH_SPI_RXDELAY, Receive delay in 1/2 clock cycles to use for serial flash communications in boot stage 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 + // PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2 #ifdef PICO_BUILD_BOOT_STAGE2_NAME #define _BOOT_STAGE2_SELECTED diff --git a/src/rp2_common/pico_btstack/CMakeLists.txt b/src/rp2_common/pico_btstack/CMakeLists.txt index 593b666ff..d384da5db 100644 --- a/src/rp2_common/pico_btstack/CMakeLists.txt +++ b/src/rp2_common/pico_btstack/CMakeLists.txt @@ -1,4 +1,4 @@ -# 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 +# 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=/lib/btstack, group=pico_btstack if (DEFINED ENV{PICO_BTSTACK_PATH} AND (NOT PICO_BTSTACK_PATH)) set(PICO_BTSTACK_PATH $ENV{PICO_BTSTACK_PATH}) message("Using PICO_BTSTACK_PATH from environment ('${PICO_BTSTACK_PATH}')") diff --git a/src/rp2_common/pico_clib_interface/CMakeLists.txt b/src/rp2_common/pico_clib_interface/CMakeLists.txt index 17af8ba56..1c9492303 100644 --- a/src/rp2_common/pico_clib_interface/CMakeLists.txt +++ b/src/rp2_common/pico_clib_interface/CMakeLists.txt @@ -35,6 +35,7 @@ if (NOT TARGET pico_clib_interface) pico_mirrored_target_link_libraries(pico_llvm_libc_interface INTERFACE pico_stdio) if (NOT PICO_CLIB) + # 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=docref=cmake-toolchain-config set(PICO_CLIB newlib) endif() diff --git a/src/rp2_common/pico_cyw43_driver/CMakeLists.txt b/src/rp2_common/pico_cyw43_driver/CMakeLists.txt index a7570a294..5b9cd5f24 100644 --- a/src/rp2_common/pico_cyw43_driver/CMakeLists.txt +++ b/src/rp2_common/pico_cyw43_driver/CMakeLists.txt @@ -1,4 +1,4 @@ -# 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 +# 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=/lib/cyw43-driver, group=pico_cyw43_driver if (DEFINED ENV{PICO_CYW43_DRIVER_PATH} AND (NOT PICO_CYW43_DRIVER_PATH)) set(PICO_CYW43_DRIVER_PATH $ENV{PICO_CYW43_DRIVER_PATH}) message("Using PICO_CYW43_DRIVER_PATH from environment ('${PICO_CYW43_DRIVER_PATH}')") diff --git a/src/rp2_common/pico_float/include/pico/float.h b/src/rp2_common/pico_float/include/pico/float.h index ef95e1ecd..31bea4687 100644 --- a/src/rp2_common/pico_float/include/pico/float.h +++ b/src/rp2_common/pico_float/include/pico/float.h @@ -149,6 +149,8 @@ extern "C" { * __addsf3, __subsf3, __mulsf3 * \endif */ + +// PICO_CONFIG: PICO_FLOAT_IN_RAM, Force placement of SDK provided single-precision floating point into RAM, type=bool, default=0, group=pico_float #if !defined(__riscv) || PICO_COMBINED_DOCS #if PICO_COMBINED_DOCS || !LIB_PICO_FLOAT_COMPILER diff --git a/src/rp2_common/pico_lwip/CMakeLists.txt b/src/rp2_common/pico_lwip/CMakeLists.txt index 7897754e6..a055ec398 100644 --- a/src/rp2_common/pico_lwip/CMakeLists.txt +++ b/src/rp2_common/pico_lwip/CMakeLists.txt @@ -1,4 +1,4 @@ -# PICO_CMAKE_CONFIG: PICO_LWIP_PATH, Path to an alternative version of lwip overriding the version in pico-sdk/lib/lwip. Can be passed to cmake or set in your environment, type=string, group=pico_lwip +# PICO_CMAKE_CONFIG: PICO_LWIP_PATH, Path to lwIP. 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=/lib/lwip, group=pico_lwip if (DEFINED ENV{PICO_LWIP_PATH} AND (NOT PICO_LWIP_PATH)) set(PICO_LWIP_PATH $ENV{PICO_LWIP_PATH}) message("Using PICO_LWIP_PATH from environment ('${PICO_LWIP_PATH}')") diff --git a/src/rp2_common/pico_mbedtls/CMakeLists.txt b/src/rp2_common/pico_mbedtls/CMakeLists.txt index 19fe47822..cca0cb260 100644 --- a/src/rp2_common/pico_mbedtls/CMakeLists.txt +++ b/src/rp2_common/pico_mbedtls/CMakeLists.txt @@ -1,4 +1,4 @@ -# PICO_CMAKE_CONFIG: PICO_MBEDTLS_PATH, Path to an alternative version of mbedtls overriding the version in pico-sdk/lib/mbedtls. Can be passed to cmake or set in your environment, type=string, group=pico_mbedtls +# PICO_CMAKE_CONFIG: PICO_MBEDTLS_PATH, Path to MBED Tls. 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=/lib/mbedtls, group=pico_mbedtls if (DEFINED ENV{PICO_MBEDTLS_PATH} AND (NOT PICO_MBEDTLS_PATH)) set(PICO_MBEDTLS_PATH $ENV{PICO_MBEDTLS_PATH}) message("Using PICO_MBEDTLS_PATH from environment ('${PICO_MBEDTLS_PATH}')") diff --git a/src/rp2_common/tinyusb/CMakeLists.txt b/src/rp2_common/tinyusb/CMakeLists.txt index 3e12439c0..84f446334 100644 --- a/src/rp2_common/tinyusb/CMakeLists.txt +++ b/src/rp2_common/tinyusb/CMakeLists.txt @@ -1,4 +1,4 @@ -# PICO_CMAKE_CONFIG: PICO_TINYUSB_PATH, Path to an alternative version of tinyusb overriding the version in pico-sdk/lib/tinyusb. Can be passed to cmake or set in your environment, type=string, group=tinyusb_device +# PICO_CMAKE_CONFIG: PICO_TINYUSB_PATH, Path to TinyUSB. 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=/lib/tinyusb, group=tinyusb_device if (DEFINED ENV{PICO_TINYUSB_PATH} AND (NOT PICO_TINYUSB_PATH)) set(PICO_TINYUSB_PATH $ENV{PICO_TINYUSB_PATH}) message("Using PICO_TINYUSB_PATH from environment ('${PICO_TINYUSB_PATH}')") From b296cf0c13326d55eb05907a88061850f9f27d3a Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Mon, 14 Jul 2025 18:37:35 -0500 Subject: [PATCH 02/13] fixup bazel config --- bazel/config/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/config/BUILD.bazel b/bazel/config/BUILD.bazel index b27cbdd54..0dd349a05 100644 --- a/bazel/config/BUILD.bazel +++ b/bazel/config/BUILD.bazel @@ -247,7 +247,7 @@ label_flag( build_setting_default = "//bazel:generate_config_header", ) -# 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 +# PICO_BAZEL_CONFIG: PICO_CLIB, The C library to use e.g. newlib/picolibc/llvm_libc, type=string, default=based on PICO_COMPILER, group=pico_standard_link string_flag( name = "PICO_CLIB", build_setting_default = "auto", From 4dc3953e815ac66f45bd6bf1629f4670e6396c20 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Mon, 14 Jul 2025 18:58:27 -0500 Subject: [PATCH 03/13] try again --- bazel/config/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/config/BUILD.bazel b/bazel/config/BUILD.bazel index 0dd349a05..9f782ad43 100644 --- a/bazel/config/BUILD.bazel +++ b/bazel/config/BUILD.bazel @@ -247,7 +247,7 @@ label_flag( build_setting_default = "//bazel:generate_config_header", ) -# PICO_BAZEL_CONFIG: PICO_CLIB, The C library to use e.g. newlib/picolibc/llvm_libc, type=string, default=based on PICO_COMPILER, group=pico_standard_link +# 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=docref=cmake-toolchain-config string_flag( name = "PICO_CLIB", build_setting_default = "auto", From fd9b4517eb1cf3a8227318ef848f0f6c18c39a7e Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Mon, 14 Jul 2025 18:58:59 -0500 Subject: [PATCH 04/13] oops --- bazel/config/BUILD.bazel | 2 +- src/rp2_common/pico_clib_interface/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bazel/config/BUILD.bazel b/bazel/config/BUILD.bazel index 9f782ad43..84eac746e 100644 --- a/bazel/config/BUILD.bazel +++ b/bazel/config/BUILD.bazel @@ -247,7 +247,7 @@ label_flag( build_setting_default = "//bazel:generate_config_header", ) -# 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=docref=cmake-toolchain-config +# 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 string_flag( name = "PICO_CLIB", build_setting_default = "auto", diff --git a/src/rp2_common/pico_clib_interface/CMakeLists.txt b/src/rp2_common/pico_clib_interface/CMakeLists.txt index 1c9492303..84d3faf62 100644 --- a/src/rp2_common/pico_clib_interface/CMakeLists.txt +++ b/src/rp2_common/pico_clib_interface/CMakeLists.txt @@ -35,7 +35,7 @@ if (NOT TARGET pico_clib_interface) pico_mirrored_target_link_libraries(pico_llvm_libc_interface INTERFACE pico_stdio) if (NOT PICO_CLIB) - # 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=docref=cmake-toolchain-config + # 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 set(PICO_CLIB newlib) endif() From c5da7301cfc12eace56cc82c4e0509308739c94e Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Wed, 16 Jul 2025 08:39:14 -0500 Subject: [PATCH 05/13] move new config into RP2350 as it seems specific to that --- src/rp2040/boot_stage2/include/boot_stage2/config.h | 1 - src/rp2350/boot_stage2/include/boot_stage2/config.h | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rp2040/boot_stage2/include/boot_stage2/config.h b/src/rp2040/boot_stage2/include/boot_stage2/config.h index 270c5d18f..aaa3faf19 100644 --- a/src/rp2040/boot_stage2/include/boot_stage2/config.h +++ b/src/rp2040/boot_stage2/include/boot_stage2/config.h @@ -12,7 +12,6 @@ #include "pico.h" // PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider fron clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 -// PICO_CONFIG: PICO_FLASH_SPI_RXDELAY, Receive delay in 1/2 clock cycles to use for serial flash communications in boot stage 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 // PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2 #ifdef PICO_BUILD_BOOT_STAGE2_NAME diff --git a/src/rp2350/boot_stage2/include/boot_stage2/config.h b/src/rp2350/boot_stage2/include/boot_stage2/config.h index a73778af6..b18bad4f1 100644 --- a/src/rp2350/boot_stage2/include/boot_stage2/config.h +++ b/src/rp2350/boot_stage2/include/boot_stage2/config.h @@ -11,6 +11,9 @@ #include "pico.h" +// PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider fron clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 +// PICO_CONFIG: PICO_FLASH_SPI_RXDELAY, Receive delay in 1/2 clock cycles to use for serial flash communications in boot stage 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 + // PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2 #ifdef PICO_BUILD_BOOT_STAGE2_NAME #define _BOOT_STAGE2_SELECTED From 6024f4cd31dacec388589bd59549d4a30bf19632 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Wed, 16 Jul 2025 08:58:29 -0500 Subject: [PATCH 06/13] fixup to pass extra_cmake_configs.py - make that accept '-' in a variable name which is valid for CMake --- cmake/pico_pre_load_platform.cmake | 10 +++++----- tools/extract_build_defines.py | 2 +- tools/extract_cmake_configs.py | 4 ++-- tools/extract_configs.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake index df511ecef..e5c569746 100644 --- a/cmake/pico_pre_load_platform.cmake +++ b/cmake/pico_pre_load_platform.cmake @@ -15,23 +15,23 @@ set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}") # If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting if (NOT PICO_DEFAULT_BOARD_rp2040) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM=rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM==rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2040 "pico") endif() if (NOT PICO_DEFAULT_BOARD_rp2350) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM=rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM==rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350 "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM=rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM==rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-riscv) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM=rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM==rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2") endif() if (NOT PICO_DEFAULT_BOARD_host) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM=host, type=string, default=none, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM==host, type=string, default=none, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_host "none") endif() diff --git a/tools/extract_build_defines.py b/tools/extract_build_defines.py index 8df16ee88..8f09da59a 100755 --- a/tools/extract_build_defines.py +++ b/tools/extract_build_defines.py @@ -160,7 +160,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum): # allow commas to appear inside brackets by converting them to and from NULL chars _attrs = re.sub(r'(\(.+\))', lambda m: m.group(1).replace(',', '\0'), _attrs) - if '=' in config_description: + if '=' in config_description and not '==' in config_description: errors.append(Exception("For {} at {}:{} the description was set to '{}' - has the description field been omitted?".format(config_name, file_path, linenum, config_description))) all_descriptions = chips_all_descriptions[applicable] if config_description in all_descriptions: diff --git a/tools/extract_cmake_configs.py b/tools/extract_cmake_configs.py index b86df28dc..cf930386c 100755 --- a/tools/extract_cmake_configs.py +++ b/tools/extract_cmake_configs.py @@ -44,7 +44,7 @@ def __init__(self, message, errors): BASE_BUILD_DEFINE_NAME = 'PICO_BUILD_DEFINE' BASE_BUILD_DEFINE_RE = re.compile(r'\b{}\b'.format(BASE_BUILD_DEFINE_NAME)) -CMAKE_CONFIG_RE = re.compile(r'#\s+{}:\s+(\w+),\s+([^,]+)(?:,\s+(.*))?$'.format(BASE_CMAKE_CONFIG_NAME)) +CMAKE_CONFIG_RE = re.compile(r'#\s+{}:\s+([\w-]+),\s+([^,]+)(?:,\s+(.*))?$'.format(BASE_CMAKE_CONFIG_NAME)) ALLOWED_CONFIG_PROPERTIES = set(['type', 'default', 'min', 'max', 'group', 'advanced', 'docref']) @@ -159,7 +159,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum): # allow commas to appear inside brackets by converting them to and from NULL chars _attrs = re.sub(r'(\(.+\))', lambda m: m.group(1).replace(',', '\0'), _attrs) - if '=' in config_description: + if '=' in config_description and not '==' in config_description: errors.append(Exception("For {} at {}:{} the description was set to '{}' - has the description field been omitted?".format(config_name, file_path, linenum, config_description))) all_descriptions = chips_all_descriptions[applicable] if config_description in all_descriptions: diff --git a/tools/extract_configs.py b/tools/extract_configs.py index a95870c6a..ad2cc2489 100755 --- a/tools/extract_configs.py +++ b/tools/extract_configs.py @@ -178,7 +178,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum): # allow commas to appear inside brackets by converting them to and from NULL chars _attrs = re.sub(r'(\(.+\))', lambda m: m.group(1).replace(',', '\0'), _attrs) - if '=' in config_description: + if '=' in config_description and not '==' in config_description: errors.append(Exception("For {} at {}:{} the description was set to '{}' - has the description field been omitted?".format(config_name, file_path, linenum, config_description))) all_descriptions = chips_all_descriptions[applicable] if config_description in all_descriptions: From 3d9178681e2d2f474d154084a0622d232c4d05dd Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Thu, 17 Jul 2025 11:32:07 -0500 Subject: [PATCH 07/13] Apply suggestions from code review @will-v-pi changes Co-authored-by: will-v-pi <108662275+will-v-pi@users.noreply.github.com> --- cmake/pico_pre_load_platform.cmake | 2 +- src/rp2040/boot_stage2/include/boot_stage2/config.h | 2 +- src/rp2350/boot_stage2/include/boot_stage2/config.h | 2 +- src/rp2_common/pico_mbedtls/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake index e5c569746..6018c649c 100644 --- a/cmake/pico_pre_load_platform.cmake +++ b/cmake/pico_pre_load_platform.cmake @@ -36,7 +36,7 @@ if (NOT PICO_DEFAULT_BOARD_host) endif() if (NOT PICO_DEFAULT_PLATFORM) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_PLATFORM, The default for PICO_PLATFORM if not specified, type=string, default=pico, group=build, docref=cmake-platform-board-config + # 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 set(PICO_DEFAULT_PLATFORM "rp2040") endif() diff --git a/src/rp2040/boot_stage2/include/boot_stage2/config.h b/src/rp2040/boot_stage2/include/boot_stage2/config.h index aaa3faf19..52ee427c3 100644 --- a/src/rp2040/boot_stage2/include/boot_stage2/config.h +++ b/src/rp2040/boot_stage2/include/boot_stage2/config.h @@ -11,7 +11,7 @@ #include "pico.h" -// PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider fron clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 +// 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, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 // PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2 #ifdef PICO_BUILD_BOOT_STAGE2_NAME diff --git a/src/rp2350/boot_stage2/include/boot_stage2/config.h b/src/rp2350/boot_stage2/include/boot_stage2/config.h index b18bad4f1..75daed0c4 100644 --- a/src/rp2350/boot_stage2/include/boot_stage2/config.h +++ b/src/rp2350/boot_stage2/include/boot_stage2/config.h @@ -11,7 +11,7 @@ #include "pico.h" -// PICO_CONFIG: PICO_FLASH_SPI_CLKDIV, Clock divider fron clk_sys to use for serial flash communications in boot stage 2. On RP2040 this must be a multiple of 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 +// 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, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 // PICO_CONFIG: PICO_FLASH_SPI_RXDELAY, Receive delay in 1/2 clock cycles to use for serial flash communications in boot stage 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 // PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2 diff --git a/src/rp2_common/pico_mbedtls/CMakeLists.txt b/src/rp2_common/pico_mbedtls/CMakeLists.txt index cca0cb260..60ca799f8 100644 --- a/src/rp2_common/pico_mbedtls/CMakeLists.txt +++ b/src/rp2_common/pico_mbedtls/CMakeLists.txt @@ -1,4 +1,4 @@ -# PICO_CMAKE_CONFIG: PICO_MBEDTLS_PATH, Path to MBED Tls. 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=/lib/mbedtls, group=pico_mbedtls +# PICO_CMAKE_CONFIG: PICO_MBEDTLS_PATH, Path to Mbed TLS. 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=/lib/mbedtls, group=pico_mbedtls if (DEFINED ENV{PICO_MBEDTLS_PATH} AND (NOT PICO_MBEDTLS_PATH)) set(PICO_MBEDTLS_PATH $ENV{PICO_MBEDTLS_PATH}) message("Using PICO_MBEDTLS_PATH from environment ('${PICO_MBEDTLS_PATH}')") From 600023b71b66a84496c886f478e9708bc99a8546 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Tue, 22 Jul 2025 16:53:02 -0500 Subject: [PATCH 08/13] == -> is; i still left the support for == in the python script --- cmake/pico_pre_load_platform.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake index 6018c649c..248c6736c 100644 --- a/cmake/pico_pre_load_platform.cmake +++ b/cmake/pico_pre_load_platform.cmake @@ -15,23 +15,23 @@ set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}") # If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting if (NOT PICO_DEFAULT_BOARD_rp2040) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM==rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM is rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2040 "pico") endif() if (NOT PICO_DEFAULT_BOARD_rp2350) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM==rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM is rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350 "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM==rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM is rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-riscv) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM==rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM is rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2") endif() if (NOT PICO_DEFAULT_BOARD_host) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM==host, type=string, default=none, group=build, docref=cmake-platform-board-config + # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM is host, type=string, default=none, group=build, docref=cmake-platform-board-config set(PICO_DEFAULT_BOARD_host "none") endif() From 5c660b05c0deb211d231470b48e5f50ef8c721c6 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Wed, 23 Jul 2025 09:16:53 -0500 Subject: [PATCH 09/13] oops; fix grammar --- cmake/pico_pre_load_platform.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake index 248c6736c..9fb1f768b 100644 --- a/cmake/pico_pre_load_platform.cmake +++ b/cmake/pico_pre_load_platform.cmake @@ -15,23 +15,23 @@ set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}") # If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting if (NOT PICO_DEFAULT_BOARD_rp2040) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2040, The default PICO_BOARD for PICO_PLATFORM is rp2040, type=string, default=pico, group=build, docref=cmake-platform-board-config + # 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 set(PICO_DEFAULT_BOARD_rp2040 "pico") endif() if (NOT PICO_DEFAULT_BOARD_rp2350) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350, The default PICO_BOARD for PICO_PLATFORM is rp2350, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # 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 set(PICO_DEFAULT_BOARD_rp2350 "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-arm-s, The default PICO_BOARD for PICO_PLATFORM is rp2350-arm-s, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # 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 set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-riscv) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_rp2350-riscv, The default PICO_BOARD for PICO_PLATFORM is rp2350-riscv, type=string, default=pico2, group=build, docref=cmake-platform-board-config + # 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 set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2") endif() if (NOT PICO_DEFAULT_BOARD_host) - # PICO_CMAKE_CONFIG: PICO_DEFAULT_BOARD_host, The default PICO_BOARD for PICO_PLATFORM is host, type=string, default=none, group=build, docref=cmake-platform-board-config + # 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 set(PICO_DEFAULT_BOARD_host "none") endif() From 3a56e1af0e877e103f6c75a0a5b64c23afe447c2 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Wed, 23 Jul 2025 15:08:00 -0500 Subject: [PATCH 10/13] passing fix --- src/rp2_common/pico_stdio_usb/include/pico/stdio_usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rp2_common/pico_stdio_usb/include/pico/stdio_usb.h b/src/rp2_common/pico_stdio_usb/include/pico/stdio_usb.h index 9e6575a30..5cf2e1f66 100644 --- a/src/rp2_common/pico_stdio_usb/include/pico/stdio_usb.h +++ b/src/rp2_common/pico_stdio_usb/include/pico/stdio_usb.h @@ -138,7 +138,7 @@ #define PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS 100 #endif -// PICO_CONFIG: PICO_STDIO_USB_USE_DEFAULT_DESCRIPTORS, Defines the default USB descriptors needed for USB communication, type=bool, default=1 if the application is not using tinyUSB directly, group=pico_stdio_usb +// PICO_CONFIG: PICO_STDIO_USB_USE_DEFAULT_DESCRIPTORS, Whether `pico_stdio_usb` provides the USB descriptors needed for USB communication, type=bool, default=1 if the application is not using tinyUSB directly, group=pico_stdio_usb #ifndef PICO_STDIO_USB_USE_DEFAULT_DESCRIPTORS #if !LIB_TINYUSB_HOST && !LIB_TINYUSB_DEVICE #define PICO_STDIO_USB_USE_DEFAULT_DESCRIPTORS 1 From 90e533127a6702051501a02402a91d44a22949e9 Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Fri, 25 Jul 2025 09:03:19 -0500 Subject: [PATCH 11/13] Apply suggestions from code review Co-authored-by: Andrew Scheller --- cmake/pico_pre_load_platform.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/pico_pre_load_platform.cmake b/cmake/pico_pre_load_platform.cmake index 9fb1f768b..936e2f99c 100644 --- a/cmake/pico_pre_load_platform.cmake +++ b/cmake/pico_pre_load_platform.cmake @@ -15,23 +15,23 @@ set(PICO_SAVED_PLATFORM "${PICO_PLATFORM}") # If PICO_PLATFORM is specified but not PICO_BOARD, we'll make a stab at defaulting if (NOT PICO_DEFAULT_BOARD_rp2040) - # 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 + # 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 set(PICO_DEFAULT_BOARD_rp2040 "pico") endif() if (NOT PICO_DEFAULT_BOARD_rp2350) - # 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 + # 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 set(PICO_DEFAULT_BOARD_rp2350 "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-arm-s) - # 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 + # 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 set(PICO_DEFAULT_BOARD_rp2350-arm-s "pico2") endif() if (NOT PICO_DEFAULT_BOARD_rp2350-riscv) - # 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 + # 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 set(PICO_DEFAULT_BOARD_rp2350-riscv "pico2") endif() if (NOT PICO_DEFAULT_BOARD_host) - # 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 + # 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 set(PICO_DEFAULT_BOARD_host "none") endif() From e996058af42416d6a1bcaf10aa3899e29cb136f9 Mon Sep 17 00:00:00 2001 From: Graham Sanderson Date: Fri, 25 Jul 2025 09:09:54 -0500 Subject: [PATCH 12/13] Add note to boot_stage2 defines --- .../boot_stage2/include/boot_stage2/config.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rp2040/boot_stage2/include/boot_stage2/config.h b/src/rp2040/boot_stage2/include/boot_stage2/config.h index 52ee427c3..568aca1ef 100644 --- a/src/rp2040/boot_stage2/include/boot_stage2/config.h +++ b/src/rp2040/boot_stage2/include/boot_stage2/config.h @@ -11,15 +11,15 @@ #include "pico.h" -// 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, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 +// 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 -// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2 +// 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 #ifdef PICO_BUILD_BOOT_STAGE2_NAME #define _BOOT_STAGE2_SELECTED #else // check that multiple boot stage 2 options haven't been set... -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_IS25LP080 #define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 0 #elif PICO_BOOT_STAGE2_CHOOSE_IS25LP080 @@ -28,7 +28,7 @@ #endif #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_W25Q080 #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 0 #elif PICO_BOOT_STAGE2_CHOOSE_W25Q080 @@ -37,7 +37,7 @@ #endif #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_W25X10CL #define PICO_BOOT_STAGE2_CHOOSE_W25X10CL 0 #elif PICO_BOOT_STAGE2_CHOOSE_W25X10CL @@ -46,7 +46,7 @@ #endif #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_AT25SF128A #define PICO_BOOT_STAGE2_CHOOSE_AT25SF128A 0 #elif PICO_BOOT_STAGE2_CHOOSE_AT25SF128A @@ -56,7 +56,7 @@ #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #if defined(PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H) && PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H #ifdef _BOOT_STAGE2_SELECTED #error multiple boot stage 2 options chosen From 071573436fedd1e4d19383cbb9fab80b92945f33 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Fri, 25 Jul 2025 09:18:57 -0500 Subject: [PATCH 13/13] matchup rp2040/rp2350 defines changed in previous commit --- .../boot_stage2/include/boot_stage2/config.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rp2350/boot_stage2/include/boot_stage2/config.h b/src/rp2350/boot_stage2/include/boot_stage2/config.h index 75daed0c4..6a951a237 100644 --- a/src/rp2350/boot_stage2/include/boot_stage2/config.h +++ b/src/rp2350/boot_stage2/include/boot_stage2/config.h @@ -11,16 +11,16 @@ #include "pico.h" -// 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, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 -// PICO_CONFIG: PICO_FLASH_SPI_RXDELAY, Receive delay in 1/2 clock cycles to use for serial flash communications in boot stage 2, type=int, default=varies; often specified in board header, advanced=true, group=boot_stage2 +// 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 +// 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 -// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2 +// 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 #ifdef PICO_BUILD_BOOT_STAGE2_NAME #define _BOOT_STAGE2_SELECTED #else // check that multiple boot stage 2 options haven't been set... -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_IS25LP080 #define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 0 #elif PICO_BOOT_STAGE2_CHOOSE_IS25LP080 @@ -29,7 +29,7 @@ #endif #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_W25Q080 #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 0 #elif PICO_BOOT_STAGE2_CHOOSE_W25Q080 @@ -38,7 +38,7 @@ #endif #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_W25X10CL #define PICO_BOOT_STAGE2_CHOOSE_W25X10CL 0 #elif PICO_BOOT_STAGE2_CHOOSE_W25X10CL @@ -47,7 +47,7 @@ #endif #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #ifndef PICO_BOOT_STAGE2_CHOOSE_AT25SF128A #define PICO_BOOT_STAGE2_CHOOSE_AT25SF128A 0 #elif PICO_BOOT_STAGE2_CHOOSE_AT25SF128A @@ -57,7 +57,7 @@ #define _BOOT_STAGE2_SELECTED #endif -// 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 +// 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 #if defined(PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H) && PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H #ifdef _BOOT_STAGE2_SELECTED #error multiple boot stage 2 options chosen