Skip to content

Commit d639292

Browse files
authored
Update extract configs (#1845)
* Update config-extraction scripts to work with multiple chips * Standardise wording between common options * Various config-related fixes * Update pico_rand to use correct busctrl_hw struct-name * Don't start config descriptions with "The ..."
1 parent a700b77 commit d639292

File tree

20 files changed

+474
-237
lines changed

20 files changed

+474
-237
lines changed

cmake/preload/toolchains/util/pico_arm_gcc_common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/find_compiler.cmake)
33
# include our Platform/PICO.cmake
44
set(CMAKE_SYSTEM_NAME PICO)
55

6-
# 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
6+
# 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
77
if (NOT PICO_GCC_TRIPLE)
88
if (DEFINED ENV{_SAVED_PICO_GCC_TRIPLE})
99
# saved within the same cmake invocation

src/cmake/on_device.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function(pico_add_extra_outputs TARGET)
6363
pico_add_map_output(${TARGET})
6464

6565
# PICO_CMAKE_CONFIG: PICO_NO_TARGET_NAME, Don't define PICO_TARGET_NAME, type=bool, default=0, group=build
66-
# PICO_BUILD_DEFINE: PICO_TARGET_NAME, The name of the build target being compiled (unless PICO_NO_TARGET_NAME set in build), type=string, default=target name, group=build
66+
# PICO_BUILD_DEFINE: PICO_TARGET_NAME, Name of the build target being compiled (unless PICO_NO_TARGET_NAME set in build), type=string, default=target name, group=build
6767
if (NOT PICO_NO_TARGET_NAME)
6868
target_compile_definitions(${TARGET} PRIVATE
6969
PICO_TARGET_NAME="${TARGET}"
@@ -94,4 +94,4 @@ set(PICO_NO_HARDWARE "0" CACHE INTERNAL "")
9494
set(PICO_ON_DEVICE "1" CACHE INTERNAL "")
9595

9696
set(CMAKE_EXECUTABLE_SUFFIX .elf)
97-
set(CMAKE_EXECUTABLE_SUFFIX "${CMAKE_EXECUTABLE_SUFFIX}" PARENT_SCOPE)
97+
set(CMAKE_EXECUTABLE_SUFFIX "${CMAKE_EXECUTABLE_SUFFIX}" PARENT_SCOPE)

src/host/hardware_irq/include/hardware/irq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define PICO_DISABLE_SHARED_IRQ_HANDLERS 0
1919
#endif
2020

21-
// PICO_CONFIG: PICO_VTABLE_PER_CORE, user is using separate vector tables per core, type=bool, default=0, group=hardware_irq
21+
// PICO_CONFIG: PICO_VTABLE_PER_CORE, User is using separate vector tables per core, type=bool, default=0, group=hardware_irq
2222
#ifndef PICO_VTABLE_PER_CORE
2323
#define PICO_VTABLE_PER_CORE 0
2424
#endif

src/host/hardware_sync/include/hardware/sync.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,52 +26,52 @@ static inline void atomic_thread_fence(uint x) {}
2626

2727
#endif
2828

29-
/// PICO_CONFIG: PICO_SPINLOCK_ID_ATOMIC, Spinlock ID for atomic protection, min=0, max=31, default=8, group=hardware_sync
29+
// PICO_CONFIG: PICO_SPINLOCK_ID_ATOMIC, Spinlock ID for atomics, min=0, max=31, default=8, group=hardware_sync
3030
#ifndef PICO_SPINLOCK_ID_ATOMIC
3131
#define PICO_SPINLOCK_ID_ATOMIC 8
3232
#endif
3333

34-
/// PICO_CONFIG: PICO_SPINLOCK_ID_IRQ, Spinlock ID for IRQ protection, min=0, max=31, default=9, group=hardware_sync
34+
// PICO_CONFIG: PICO_SPINLOCK_ID_IRQ, Spinlock ID for IRQ protection, min=0, max=31, default=9, group=hardware_sync
3535
#ifndef PICO_SPINLOCK_ID_IRQ
3636
#define PICO_SPINLOCK_ID_IRQ 9
3737
#endif
3838

39-
/// PICO_CONFIG: PICO_SPINLOCK_ID_TIMER, Spinlock ID for Timer protection, min=0, max=31, default=10, group=hardware_sync
39+
// PICO_CONFIG: PICO_SPINLOCK_ID_TIMER, Spinlock ID for Timer protection, min=0, max=31, default=10, group=hardware_sync
4040
#ifndef PICO_SPINLOCK_ID_TIMER
4141
#define PICO_SPINLOCK_ID_TIMER 10
4242
#endif
4343

44-
/// PICO_CONFIG: PICO_SPINLOCK_ID_HARDWARE_CLAIM, Spinlock ID for Hardware claim protection, min=0, max=31, default=11, group=hardware_sync
44+
// PICO_CONFIG: PICO_SPINLOCK_ID_HARDWARE_CLAIM, Spinlock ID for Hardware claim protection, min=0, max=31, default=11, group=hardware_sync
4545
#ifndef PICO_SPINLOCK_ID_HARDWARE_CLAIM
4646
#define PICO_SPINLOCK_ID_HARDWARE_CLAIM 11
4747
#endif
4848

49-
/// PICO_CONFIG: PICO_SPINLOCK_ID_RAND, Spinlock ID for Random Number Generator, min=0, max=31, default=12, group=hardware_sync
49+
// PICO_CONFIG: PICO_SPINLOCK_ID_RAND, Spinlock ID for Random Number Generator, min=0, max=31, default=12, group=hardware_sync
5050
#ifndef PICO_SPINLOCK_ID_RAND
5151
#define PICO_SPINLOCK_ID_RAND 12
5252
#endif
5353

54-
/// PICO_CONFIG: PICO_SPINLOCK_ID_OS1, First Spinlock ID reserved for use by low level OS style software, min=0, max=31, default=14, group=hardware_sync
54+
// PICO_CONFIG: PICO_SPINLOCK_ID_OS1, First Spinlock ID reserved for use by low level OS style software, min=0, max=31, default=14, group=hardware_sync
5555
#ifndef PICO_SPINLOCK_ID_OS1
5656
#define PICO_SPINLOCK_ID_OS1 14
5757
#endif
5858

59-
/// PICO_CONFIG: PICO_SPINLOCK_ID_OS2, Second Spinlock ID reserved for use by low level OS style software, min=0, max=31, default=15, group=hardware_sync
59+
// PICO_CONFIG: PICO_SPINLOCK_ID_OS2, Second Spinlock ID reserved for use by low level OS style software, min=0, max=31, default=15, group=hardware_sync
6060
#ifndef PICO_SPINLOCK_ID_OS2
6161
#define PICO_SPINLOCK_ID_OS2 15
6262
#endif
6363

64-
/// PICO_CONFIG: PICO_SPINLOCK_ID_STRIPED_FIRST, Lowest Spinlock ID in the 'striped' range, min=0, max=31, default=16, group=hardware_sync
64+
// PICO_CONFIG: PICO_SPINLOCK_ID_STRIPED_FIRST, Lowest Spinlock ID in the 'striped' range, min=0, max=31, default=16, group=hardware_sync
6565
#ifndef PICO_SPINLOCK_ID_STRIPED_FIRST
6666
#define PICO_SPINLOCK_ID_STRIPED_FIRST 16
6767
#endif
6868

69-
/// PICO_CONFIG: PICO_SPINLOCK_ID_STRIPED_LAST, Highest Spinlock ID in the 'striped' range, min=0, max=31, default=23, group=hardware_sync
69+
// PICO_CONFIG: PICO_SPINLOCK_ID_STRIPED_LAST, Highest Spinlock ID in the 'striped' range, min=0, max=31, default=23, group=hardware_sync
7070
#ifndef PICO_SPINLOCK_ID_STRIPED_LAST
7171
#define PICO_SPINLOCK_ID_STRIPED_LAST 23
7272
#endif
7373

74-
/// PICO_CONFIG: PICO_SPINLOCK_ID_CLAIM_FREE_FIRST, Lowest Spinlock ID in the 'claim free' range, min=0, max=31, default=24, group=hardware_sync
74+
// PICO_CONFIG: PICO_SPINLOCK_ID_CLAIM_FREE_FIRST, Lowest Spinlock ID in the 'claim free' range, min=0, max=31, default=24, group=hardware_sync
7575
#ifndef PICO_SPINLOCK_ID_CLAIM_FREE_FIRST
7676
#define PICO_SPINLOCK_ID_CLAIM_FREE_FIRST 24
7777
#endif
@@ -80,7 +80,7 @@ static inline void atomic_thread_fence(uint x) {}
8080
#warning PICO_SPINLOCK_ID_CLAIM_FREE_END has been renamed to PICO_SPINLOCK_ID_CLAIM_FREE_LAST
8181
#endif
8282

83-
/// PICO_CONFIG: PICO_SPINLOCK_ID_CLAIM_FREE_LAST, Highest Spinlock ID in the 'claim free' range, min=0, max=31, default=31, group=hardware_sync
83+
// PICO_CONFIG: PICO_SPINLOCK_ID_CLAIM_FREE_LAST, Highest Spinlock ID in the 'claim free' range, min=0, max=31, default=31, group=hardware_sync
8484
#ifndef PICO_SPINLOCK_ID_CLAIM_FREE_LAST
8585
#define PICO_SPINLOCK_ID_CLAIM_FREE_LAST 31
8686
#endif

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "pico.h"
1313

14-
// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, The name of the boot stage 2 if selected by the build, group=boot_stage2
14+
// PICO_CONFIG: PICO_BUILD_BOOT_STAGE2_NAME, Name of the boot stage 2 if selected in the build system, group=boot_stage2
1515
#ifdef PICO_BUILD_BOOT_STAGE2_NAME
1616
#define _BOOT_STAGE2_SELECTED
1717
#else

src/rp2040/pico_platform/include/pico/platform.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@
6666
#define PICO_RP2040_B2_SUPPORTED 1
6767
#endif
6868

69-
// PICO_CONFIG: PICO_RP2350_A2_SUPPORTED, Whether to include any specific software support for RP2350 A2 revision, type=bool, default=1, advanced=true, group=pico_platform
70-
#ifndef PICO_RP2350_A2_SUPPORTED
71-
#define PICO_RP2350_A2_SUPPORTED 1
72-
#endif
73-
7469
#ifndef PICO_RAM_VECTOR_TABLE_SIZE
7570
#define PICO_RAM_VECTOR_TABLE_SIZE (VTABLE_FIRST_IRQ + NUM_IRQS)
7671
#endif
@@ -212,4 +207,4 @@ return a;
212207

213208
#endif // __ASSEMBLER__
214209

215-
#endif
210+
#endif

src/rp2350/hardware_regs/include/hardware/platform_defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
#define HAS_RP2350_TRNG 1
7575
#define HAS_HSTX 1
7676

77-
// PICO_CONFIG: XOSC_HZ, The crystal oscillator frequency in Hz, type=int, default=12000000, advanced=true, group=hardware_base
77+
// PICO_CONFIG: XOSC_HZ, Crystal oscillator frequency in Hz, type=int, default=12000000, advanced=true, group=hardware_base
7878
// NOTE: The system and USB clocks are generated from the frequency using two PLLs.
7979
// If you override this define, or SYS_CLK_HZ/USB_CLK_HZ below, you will *also* need to add your own adjusted PLL set-up defines to
8080
// override the defaults which live in src/rp2_common/hardware_clocks/include/hardware/clocks.h
@@ -89,7 +89,7 @@
8989
#endif
9090
#endif
9191

92-
// PICO_CONFIG: SYS_CLK_HZ, The system operating frequency in Hz, type=int, default=150000000, advanced=true, group=hardware_base
92+
// PICO_CONFIG: SYS_CLK_HZ, System operating frequency in Hz, type=int, default=150000000, advanced=true, group=hardware_base
9393
#ifndef SYS_CLK_HZ
9494
#ifdef SYS_CLK_KHZ
9595
#define SYS_CLK_HZ ((SYS_CLK_KHZ) * _u(1000))

src/rp2350/pico_platform/include/pico/platform.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
#endif
3131

3232
// PICO_CONFIG: PICO_RP2350A, Whether the current board has an RP2350 in an A (30 GPIO) package, type=bool, default=Usually provided via board header, group=pico_platform
33+
#if 0 // make tooling checks happy
34+
#define PICO_RP2350A 0
35+
#endif
36+
37+
// PICO_CONFIG: PICO_RP2350_A2_SUPPORTED, Whether to include any specific software support for RP2350 A2 revision, type=bool, default=1, advanced=true, group=pico_platform
38+
#ifndef PICO_RP2350_A2_SUPPORTED
39+
#define PICO_RP2350_A2_SUPPORTED 1
40+
#endif
3341

3442
// PICO_CONFIG: PICO_STACK_SIZE, Minimum amount of stack space reserved in the linker script for each core. See also PICO_CORE1_STACK_SIZE, min=0x100, default=0x800, advanced=true, group=pico_platform
3543
#ifndef PICO_STACK_SIZE
@@ -99,12 +107,10 @@ static inline void busy_wait_at_least_cycles(uint32_t minimum_cycles) {
99107
);
100108
}
101109

102-
// PICO_CONFIG: PICO_NO_FPGA_CHECK, Remove the FPGA platform check for small code size reduction, type=bool, default=platform dependent, advanced=true, group=pico_runtime
110+
// PICO_CONFIG: PICO_NO_FPGA_CHECK, Remove the FPGA platform check for small code size reduction, type=bool, default=1, advanced=true, group=pico_runtime
103111
#ifndef PICO_NO_FPGA_CHECK
104-
#if !PICO_RP2040
105112
#define PICO_NO_FPGA_CHECK 1
106113
#endif
107-
#endif
108114

109115
// PICO_CONFIG: PICO_NO_SIM_CHECK, Remove the SIM platform check for small code size reduction, type=bool, default=1, advanced=true, group=pico_runtime
110116
#ifndef PICO_NO_SIM_CHECK

src/rp2_common/cmsis/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Deferring this config until we decide how to include other CMSIS libraries... it is likely that we always want to use the stub version of the core
22
# at least if the vendor/device is RaspberryPi/RP2040...
33

4-
## PICO_CMAKE_CONFIG: PICO_CMSIS_PATH, directory to locate CMSIS installation, default="included stub CORE only impl", group=build
4+
## PICO_CMAKE_CONFIG: PICO_CMSIS_PATH, Directory to locate CMSIS installation, type=string, default="included stub CORE only impl", group=build
55
#if (DEFINED PICO_CMSIS_PATH)
66
# set(PICO_CMSIS_PATH "${PICO_CMSIS_PATH}" CACHE PATH "Path to the CMSIS tree to use with Raspberry Pi Pico SDK")
77
# message("Using specified PICO_CMSIS_PATH for CMSIS ('${PICO_CMSIS_PATH}')")
@@ -10,7 +10,7 @@
1010
# message("Using PICO_CMSIS_PATH from environment for CMSIS ('${PICO_CMSIS_PATH}')")
1111
#endif()
1212
#
13-
## PICO_CMAKE_CONFIG: PICO_CMSIS_VENDOR, vendor name for CMSIS, default="RaspberryPi", group=build
13+
## PICO_CMAKE_CONFIG: PICO_CMSIS_VENDOR, Vendor name for CMSIS, type=string, default="RaspberryPi", group=build
1414
#if (DEFINED PICO_CMSIS_VENDOR)
1515
# set(PICO_CMSIS_VENDOR "${PICO_CMSIS_VENDOR}" CACHE STRING "CMSIS vendor name to use")
1616
# message("Using specified PICO_CMSIS_VENDOR for CMSIS ('${PICO_CMSIS_VENDOR}')")
@@ -21,7 +21,7 @@
2121
# set(PICO_CMSIS_VENDOR RaspberryPi)
2222
#endif()
2323
#
24-
## PICO_CMAKE_CONFIG: PICO_CMSIS_DEVICE, device name for CMSIS, default="RP2040", group=build
24+
## PICO_CMAKE_CONFIG: PICO_CMSIS_DEVICE, Device name for CMSIS, type=string, default="RP2040", group=build
2525
#if (DEFINED PICO_CMSIS_DEVICE)
2626
# set(PICO_CMSIS_DEVICE "${PICO_CMSIS_DEVICE}" CACHE STRING "CMSIS device name to use")
2727
# message("Using specified PICO_CMSIS_DEVICE for CMSIS ('${PICO_CMSIS_DEVICE}')")

src/rp2_common/hardware_clocks/include/hardware/clocks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ extern "C" {
192192
#ifndef PLL_SYS_VCO_FREQ_HZ
193193
#define PLL_SYS_VCO_FREQ_HZ (1500 * MHZ)
194194
#endif
195-
// PICO_CONFIG: PLL_SYS_POSTDIV1, System clock PLL post divider 1 setting, type=int, default=6 on RP2040 5 or on RP2350, advanced=true, group=hardware_clocks
195+
// PICO_CONFIG: PLL_SYS_POSTDIV1, System clock PLL post divider 1 setting, type=int, default=6 on RP2040 or 5 on RP2350, advanced=true, group=hardware_clocks
196196
#ifndef PLL_SYS_POSTDIV1
197197
#if SYS_CLK_HZ == 125 * MHZ
198198
#define PLL_SYS_POSTDIV1 6

0 commit comments

Comments
 (0)