Skip to content

Commit ebae9e4

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop-ci
2 parents b28a582 + 564aa64 commit ebae9e4

File tree

49 files changed

+2311
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2311
-192
lines changed

cmake/preload/toolchains/pico_arm_clang_arm.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# NOTE: THIS IS A WIP ONLY PICO_ARM_GCC IS CURRENTLY SUPPORTED
2-
# todo there is probably a more "cmake" way of doing this going thru the standard path with our "PICO" platform
31
# i.e. CMake<Lang>Information and whatnot
42
include(${CMAKE_CURRENT_LIST_DIR}/util/find_compiler.cmake)
53

cmake/preload/toolchains/pico_arm_cortex_m33_clang.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
44
set(PICO_CLANG_RUNTIMES armv8m.main_soft_nofp armv8m.main-unknown-none-eabi)
55

66
set(PICO_COMMON_LANG_FLAGS "-mcpu=cortex-m33 --target=armv8m.main-none-eabi -mfloat-abi=softfp -march=armv8m.main+fp+dsp")
7-
7+
set(PICO_DISASM_OBJDUMP_ARGS --mcpu=cortex-m33 --arch=armv8m.main+fp+dsp)
88
include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_clang_common.cmake)

external/pico_sdk_import.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
# This can be dropped into an external project to help locate this SDK
44
# It should be include()ed prior to project()
55

6+
# Copyright 2020 (c) 2020 Raspberry Pi (Trading) Ltd.
7+
#
8+
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
9+
# following conditions are met:
10+
#
11+
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
12+
# disclaimer.
13+
#
14+
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
15+
# disclaimer in the documentation and/or other materials provided with the distribution.
16+
#
17+
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
18+
# derived from this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21+
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25+
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
628
if (DEFINED ENV{PICO_SDK_PATH} AND (NOT PICO_SDK_PATH))
729
set(PICO_SDK_PATH $ENV{PICO_SDK_PATH})
830
message("Using PICO_SDK_PATH from environment ('${PICO_SDK_PATH}')")

src/boards/include/boards/adafruit_feather_rp2350.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
#ifndef _BOARDS_ADAFRUIT_FEATHER_RP2350_H
1717
#define _BOARDS_ADAFRUIT_FEATHER_RP2350_H
1818

19+
// On some samples, the xosc can take longer to stabilize than is usual
20+
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
21+
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
22+
#endif
23+
1924
// For board detection
2025
#define ADAFRUIT_FEATHER_RP2350
2126

src/cmake/on_device.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ function(pico_add_dis_output TARGET)
3737
set(EXTRA_COMMAND COMMAND picotool coprodis --quiet ${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis ${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis)
3838
endif()
3939
endif()
40-
4140
add_custom_command(TARGET ${TARGET} POST_BUILD
4241
COMMAND ${CMAKE_OBJDUMP} -h $<TARGET_FILE:${TARGET}> > ${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis
43-
COMMAND ${CMAKE_OBJDUMP} -d $<TARGET_FILE:${TARGET}> >> ${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis
42+
COMMAND ${CMAKE_OBJDUMP} -d ${PICO_DISASM_OBJDUMP_ARGS} $<TARGET_FILE:${TARGET}> >> ${output_path}$<IF:$<BOOL:$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>>,$<TARGET_PROPERTY:${TARGET},OUTPUT_NAME>,$<TARGET_PROPERTY:${TARGET},NAME>>.dis
4443
${EXTRA_COMMAND}
4544
VERBATIM
4645
)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777

7878
#ifndef __ASSEMBLER__
7979

80+
#ifdef __cplusplus
81+
extern "C" {
82+
#endif
83+
8084
/*! \brief No-op function for the body of tight loops
8185
* \ingroup pico_platform
8286
*
@@ -210,6 +214,10 @@ return a;
210214
(__builtin_popcount(b) >= 2 ? __mul_instruction(a,b) : (a)*(b)), \
211215
(a)*(b))
212216

217+
#ifdef __cplusplus
218+
}
219+
#endif
220+
213221
#endif // __ASSEMBLER__
214222

215223
#endif

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070

7171
#ifndef __ASSEMBLER__
7272

73+
#ifdef __cplusplus
74+
extern "C" {
75+
#endif
76+
7377
/*! \brief No-op function for the body of tight loops
7478
* \ingroup pico_platform
7579
*
@@ -281,6 +285,10 @@ __force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
281285
(__builtin_popcount(b) >= 2 ? __mul_instruction(a,b) : (a)*(b)), \
282286
(a)*(b))
283287

288+
#ifdef __cplusplus
289+
}
290+
#endif
291+
284292
#endif // __ASSEMBLER__
285293

286294
#endif

src/rp2_common/hardware_clocks/clocks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ bool clock_configure(clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32
102102
return false;
103103

104104
uint32_t div = (uint32_t)((((uint64_t) src_freq) << CLOCKS_CLK_GPOUT0_DIV_INT_LSB) / freq);
105+
// only clock divider of 1, or >= 2 are supported
106+
if (div < (2u << CLOCKS_CLK_GPOUT0_DIV_INT_LSB)) {
107+
div = (1u << CLOCKS_CLK_GPOUT0_DIV_INT_LSB);
108+
}
105109
uint32_t actual_freq = (uint32_t) ((((uint64_t) src_freq) << CLOCKS_CLK_GPOUT0_DIV_INT_LSB) / div);
106110

107111
clock_configure_internal(clock, src, auxsrc, actual_freq, div);

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,18 @@ extern "C" {
262262

263263
typedef clock_num_t clock_handle_t;
264264

265-
/*! \brief Configure the specified clock
265+
/*! \brief Configure the specified clock with automatic clock divisor setup
266266
* \ingroup hardware_clocks
267267
*
268+
* This method allows both the src_frequency of the input clock source AND the desired
269+
* frequency to be specified, and will set the clock divider to achieve the exact or higher frequency
270+
* achievable, with the maximum being the src_freq.
271+
*
272+
* Note: That the clock hardware only support divisors of exactly 1 or 2.0->65535.0
273+
*
268274
* See the tables in the description for details on the possible values for clock sources.
269275
*
276+
*
270277
* \param clock The clock to configure
271278
* \param src The main clock source, can be 0.
272279
* \param auxsrc The auxiliary clock source, which depends on which clock is being set. Can be 0
@@ -275,7 +282,7 @@ typedef clock_num_t clock_handle_t;
275282
*/
276283
bool clock_configure(clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32_t src_freq, uint32_t freq);
277284

278-
/*! \brief Configure the specified clock to use the undividded input source
285+
/*! \brief Configure the specified clock to use the undivided input source
279286
* \ingroup hardware_clocks
280287
*
281288
* See the tables in the description for details on the possible values for clock sources.
@@ -287,7 +294,7 @@ bool clock_configure(clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32
287294
*/
288295
void clock_configure_undivided(clock_handle_t clock, uint32_t src, uint32_t auxsrc, uint32_t src_freq);
289296

290-
/*! \brief Configure the specified clock to use the undividded input source
297+
/*! \brief Configure the specified clock to use the undivided input source
291298
* \ingroup hardware_clocks
292299
*
293300
* See the tables in the description for details on the possible values for clock sources.

src/rp2_common/hardware_dma/include/hardware/dma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ static inline void dma_channel_start(uint channel) {
535535
*\endcode
536536
*
537537
* \if rp2350_specific
538-
* RP2350 only: Due to errata RP12350-E5 (see the RP2350 datasheet for further detail), it is necessary to clear the enable bit of
538+
* RP2350 only: Due to errata RP2350-E5 (see the RP2350 datasheet for further detail), it is necessary to clear the enable bit of
539539
* the aborted channel and any chained channels prior to the abort to prevent re-triggering.
540540
* \endif
541541
*

0 commit comments

Comments
 (0)