2.0.0
版本发布时间: 2024-08-08 22:59:22
raspberrypi/pico-sdk最新发布版本:2.0.0(2024-08-08 22:59:22)
This is a major release which adds support for the new RP2350 and for compiling RISC-V code in addition to Arm.
- There is a lot of new functionality in the RP2350 microcontroller, it is recommended that you read the RP2350 Datasheet
- There is a lot of new functionality in the SDK, it is also worth reading the Raspberry Pi Pico C/C++ SDK book. This also includes documentation for RP2040 and RP2350 APIs, along with much more complete documentation of SDK
#defines
andCMake
build variables.
Notices
- You should delete/recreate all build directories when upgrading from previous versions of the Raspberry Pi Pico SDK
Major New Features
Support for RP2350
Many programs you have written for RP2040 (say a Raspberry Pi Pico) should work unmodified on RP2350 (say a Raspberry Pi Pico 2) even when compiled for RISC-V.
- You can now specify
rp2350-arm-s
(Arm Secure) orrp2350-riscv
(RISC-V) as well as the previousrp2040
(default) andhost
. - Setting
PICO_BOARD=some_board
will now setPICO_PLATFORM
if one is specified insome_board.h
since most boards either use exclusively RP2040 or RP2350. -
PICO_PLATFORM
also supportsrp2350
but this gets replaced with the valuePICO_DEFAULT_RP2350_PLATFORM
which you can set in your environment orCMakeLists.txt
. Many of the boards for RP2350 - includingpico2
- selectrp2350
as thePICO_BOARD
to honour your preference. - NOTE: This release of the SDK does not support writing Arm Non-Secure binaries to run under the wing of an Arm Secure binary. This support will be added in a subsequent release.
Security and Code Signing
- The RP2350 bootrom contains support for signed images and a variety of other security features. The SDK supports building signed images etc. as part of the CMake build. For further information, please read RP2350 Datasheet "Bootrom Concepts" section, and also the Raspberry Pi Pico C/C++ SDK book for details on configuring your build to sign code. Note that signed code is only applicable to chips that have been locked down for security, but you can also hash your image for integrity checking.
Board Support
The following boards have been added and may be specified via PICO_BOARD
:
-
defcon32_badge
-
gen4_rp2350_24
-
gen4_rp2350_24ct
-
gen4_rp2350_24t
-
gen4_rp2350_28
-
gen4_rp2350_28ct
-
gen4_rp2350_28t
-
gen4_rp2350_32
-
gen4_rp2350_32ct
-
gen4_rp2350_32t
-
gen4_rp2350_35
-
gen4_rp2350_35ct
-
gen4_rp2350_35t
-
hellbender_2350A_devboard
-
ilabs_challenger_rp2350_bconnect
-
ilabs_challenger_rp2350_wifi_ble
-
melopero_perpetuo_rp2350_lora
-
phyx_rick_tny_rp2350
-
pico2
-
pimoroni_pga2350
-
pimoroni_pico_plus2_rp2350
-
pimoroni_plasma2350
-
pimoroni_tiny2350
-
seeed_xiao_rp2350
-
solderparty_rp2350_stamp
-
solderparty_rp2350_stamp_xl
-
sparkfun_promicro_rp2350
-
switchscience_picossci2_conta_base
-
switchscience_picossci2_dev_board
-
switchscience_picossci2_micro
-
switchscience_picossci2_rp2350_breakout
-
switchscience_picossci2_tiny
-
tinycircuits_thumby_color_rp2350
New Libraries
hardware_boot_lock (RP2350)
- New library for accessing the BOOT locks from secure code.
hardware_dcp (RP2350 Arm)
- Contains assembler macros for individual DCP (Double Co-Processor) instructions
- Contains assembler macros for canned instruction sequences for higher-level operations
-
HAS_DOUBLE_COPROCESSOR
define indicates hardware support
hardware_hazard3 (RP2350 RISC-V)
- Assembler macros and inline functions for accessing Hazard3 extensions
hardware_powman (RP2350)
- Hardware APIs for the Power Management hardware.
-
HAS_POWMAN_TIMER
define indicates hardware support.
hardware_rcp (RP2350 Arm)
- Contains inline functions and assembler macros for the RCP (Redundancy Co-Processor) instructions.
-
HAS_REDUNDANCY_COPROCESSOR
define indicates hardware support.
hardware_riscv_platform_timer (RP2350)
- Hardware APIs for the RISC-V Platform Timer (which is also made available on Arm).
hardware_sha256 (RP2350)
- Hardware APIs for the SHA256 hashing hardware.
hardware_ticks
- Hardware APIs for the RP2350 tick generators.
- On RP2040 the same API is used, but only one tick generator
TICK_WATCHDOG
is used, which is backed by the hardware in the RP2040 WatchDog hardware.
pico_aon_timer
- Abstraction for a hardware timer that is "Always-On", and can wake the processor up even from a low power state at a given time.
- On RP2040 this uses the RTC.
- On RP2350 this uses the Powman Timer.
pico_atomic
- Additional support for C11 atomic functions using spin lock number
PICO_SPINLOCK_ID_ATOMIC
. - On RP2040, all functions are implemented via spinlock.
- On RP2350, only 64-bit or arbitrary-sized atomics are implemented via spin lock; the reset user processor exclusive/atomic instructions.
- Note on
ACTLR.EXTEXCLALL
must be set to 1 on each processor for the exclusive instructions to work. This is done automatically in the SDK by one of the per-core initializers inpico_runtime_init
.
- Note on
- Included by
pico_runtime
by default.
pico_boot_lock (RP2350)
- Support for acquiring and releasing locks to prevent concurrent use of hardware resources used by bootrom functions.
- Enabled via
PICO_BOOTROM_LOCKING_ENABLED
which defaults to 1 on RP2350. - Some bootrom functions use shared resources such as the single SHA256 or put hardware such as the OTP or XIP interface into a state that cannot execute concurrently with certain other code. The bootrom supports checking that the resource is owned, and this library turns that checking on.
- The bootrom function wrappers in
pico_bootrom
call the functions inpico_boot_lock
around affects bootrom functions, and thus will take and release locks ifPICO_BOOTROM_LOCKING_ENABLED=1
. -
NUM_BOOT_LOCKS
define indicates the number of boot locks (8 on 'RP2350', 0 on 'RP2040').
pico_clib_interface
- New library to encapsulate the interface between the SDK and the C library.
- Supports
- newlib (full).
- picolibc (preview).
- llvm-libc(preview).
- Included by
pico_runtime
by default.
pico_crt0
- New library split out of
pico_standard_link
to encapsulate the earliest startup code before the runtime initialisation, and shutdown code after the runtime. - Repository for the default RP2040 and RP2350 linker scripts.
- The flash size specified in the board header is now used when linking which is handy if you have >2M of flash and >2M of code/data.
-
Note: The linker scripts have changed since the previous release of the SDK. If you have custom linker scripts, it is recommended that you update them to match.
- In particular the new linker scripts include an "embedded block" which is required for a binary to boot on RP2350.
- __HeapLimit is now defined to be the end of RAM rather than the end of a
PICO_HEAP_SIZE
chunk, to better match the standard behaviour.PICO_HEAP_SIZE
is the minimum heap size required, and space is required for it at link time.sbrk
in the previous SDK ignored it anyway and used the end of RAM so there is no functional change there.
- Included by
pico_runtime
by default
pico_cxx_options
- New library split out of
pico_standard_link
to configure C++ options. - Included by
pico_standard_link
by default.
pico_platform_compiler
- New library split out of
pico_platform
with the functions/macros related to the compiler. - Included by
pico_platform
by default.
pico_platform_panic
- New library split out of
pico_platform
with the panic function implementation. - Included by
pico_platform
by default.
pico_platform_sections
- New library split out of
pico_platform
with the section macros such as__not_in_flash_func
. - Included by
pico_platform
by default.
pico_runtime_init
- Contains the standard initialisers that should get run before main, or per core.
- Unlike in the previous SDK version where
runtime_init()
was a monolithic function which also called some__preinit_array
initialisers, the new runtime_init library: - Separates each initialiser out individually, for say initialiser "foo".
- Defines
PICO_RUNTIME_INIT_FOO
which is a "12345" line number ordering of the initialiser with respect to others. - Declares
runtime_init_foo()
which is the actual initialiser. - If
PICO_RUNTIME_SKIP_INIT_FOO
is not set, it adds the initialiser entry to callruntime_init_foo()
beforemain
(or per core initialisation). - If
PICO_RUNTIME_NO_INIT_FOO
is not set, it adds the (weak) implementation ofruntime_init_foo()
.
- Defines
- This gives the user full control to customise runtime initialisation, either skipping or replacing parts.
- Included by
pico_runtime
by default.
pico_sha256
- High level APIs for generating SHA256 hashes both synchronously and asynchronously
pico_standard_binary_info
- New library split out of
pico_standard_link
that adds the "common" binary info items to the binary. - Included by
pico_standard_link
by default.
Library Changes / Improvements
Note that all hardware libraries now support the increased number of GPIOs on RP2350B in APIs that take a GPIO number; this is not noted for every library.
pico_base
- More error return codes were added to
pico/error.h
, mostly because these are the same values returned by RP2350 bootrom API functions, but also a number of new SDK APIs also return meaningful errors. - In
pico/types.h
, by popular demand,absolute_time_t
now always defaults touint64_t
regardless of the type of build. You can setPICO_OPAQUE_ABSOLUTE_TIME_T=1
to make it a struct in all build types.
pico_binary_info
- Now supports > 32 GPIO pins when
PICO_BINARY_INFO_USE_PINS_64=1
- this is defaulted for you based on the number of GPIOs on the board.
hardware_adc
-
PARAM_ASSERTIONS_ENABLED_ADC
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_ADC
- the old define is still supported as a fallback. -
ADC_TEMPERATURE_CHANNEL_NUM
added since this value varies between RP2040 and RP2350.
hardware_clocks
-
set_sys_clock_
functions are now inhardware/clocks.h
. - Clock configuration.
-
PLL_COMMON_REFDIV
is deprecated in favour ofPLL_SYS_REFDIV
andPLL_USB_REFDIV
. -
PLL_SYS_VCO_FREQ_HZ
is new and preferred overPLL_SYS_VCO_FREQ_KHZ
. -
PLL_USB_VCO_FREQ_HZ
is new and preferred overPLL_USB_VCO_FREQ_KHZ
. -
XOSC_HZ
,SYS_CLK_HZ
,USB_CLK_HZ
now added, and take preference over the still supportedXOSC_KHZ
,SYS_CLK_KHZ
, andUSB_CLK_KHZ
. -
set_sys_clock_hz()
andcheck_sys_clock_hz()
added. -
clock_configure_undivided()
andclock_configure_int_divider()
for no divisor or a whole integer divider as the code doesn't require 64-bit arithmetic and thus saves space. - The
enum clock_index
no longer exists and has been replaced withclock_num_t
. However, all clock functions now takeclock_handle_t
to allow for future enhancement. This is currently just an alias forclock_num_t
-
vcocalc.py can now be used to generate the
CMake
configuration for a particular clock setting. - The default system clock on RP2350 is 150Mhz.
hardware_divider
- Since the RP2350 processors have efficient divider instructions, RP2350 has no SIO HW Divider. Software versions of the
hardware_divider
functions are provided for RP2350. -
HAS_SIO_DIVIDER
define is now provided for you.
hardware_dma
-
PARAM_ASSERTIONS_ENABLED_DMA
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_DMA
- the old define is still supported as a fallback. - Added
dma_get_irq_num()
function andDMA_IRQ_NUM()
macro to return the process IRQ Number for the n th DMA IRQ. -
NUM_DMA_IRQS
define is provided for you. - it is 2 on RP2040 and 4 on RP2350.
hardware_exception
-
PARAM_ASSERTIONS_ENABLED_EXCEPTION
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_EXCEPTION
- the old define is still supported as a fallback. - Added RISC-V support.
- exception numbers are processor exception
cause
numbers. -
exeception_[get|set]_priority()
are added for Arm.
hardware_flash
-
PARAM_ASSERTIONS_ENABLED_FLASH
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_FLASH
- the old define is still supported as a fallback. -
flash_flush_cache()
is added.
hardware_gpio
-
PARAM_ASSERTIONS_ENABLED_GPIO
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_GPIO
- the old define is still supported as a fallback. - The
enum gpio_function
no longer exists and has been replaced withgpio_function_t
. -
gpio_xxx_masked()
functions now have agpio_xxx_masked64()
variant that takes a 64-bit mask of GPIO indexes. -
gpio_xxx_mask()
functions now have agpio_xxx_mask64()
variant that takes a 64-bit mask of GPIO indexes. -
gpio_get_all64()
added to read the state of >32 pins. -
gpio_put_all64()
added to write the state of >32 pins. - On Arm RP2350 GPIO Co-Processor instructions are used by default. This is controlled via
PICO_USE_GPIO_COPROCESSOR
. -
HAS_GPIO_COPROCESSOR
define indicates hardware support.
hardware_i2c
-
PARAM_ASSERTIONS_ENABLED_I2C
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_I2C
- the old define is still supported as a fallback. -
PICO_DEFAULT_I2C_INSTANCE()
macro added which is equivalent to the pre-existingi2c_default
- Added
I2C_NUM()
,I2C_INSTANCE()
,I2C_DREQ_NUM()
macros to abstract differences between platforms. - Fixed per-character timeouts.
hardware_interp
-
PARAM_ASSERTIONS_ENABLED_INTERP
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_INTERP
- the old define is still supported as a fallback.
hardware_irq
-
PARAM_ASSERTIONS_ENABLED_IRQ
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_IRQ
- the old define is still supported as a fallback. -
irq_xxx_mask_xxx()
functions now have agpio_xxx_mask_n_xxx()
variant that affects the n th set of 32 IRQs - Expose
runtime_init_per_core_irq_priorities()
function - Added
irq_set_riscv_vector_handler()
function to replace code entries in the machine vector table.
hardware_pio
-
PARAM_ASSERTIONS_ENABLED_PIO
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_PIO
- the old define is still supported as a fallback. -
PICO_PIO_VERSION
is used to determine whether new RP2350 functionality (PICO_PIO_VERSION=1
) is supported. This is defaulted based on the platform. -
PICO_PIO_USE_GPIO_BASE
is used to determine whether support is enabled for GPIOs above 32. TThe default value is set based on the chip package. - Added
pio_sm_set_jmp_pin()
. - Added
pio_claim_free_sm_and_add_program()
,pio_claim_free_sm_and_add_program_for_gpio_range()
and `pio_remove_program_and_unclaim_sm() to simplify finding and claiming a free PIO instance and state machine and installing programs. - Added
pio_get_irq_num()
function to return the process IRQ Number for the n th PIO IRQ for a PIO instance. - Added
PIO_NUM()
,PIO_INSTANCE()
,PIO_IRQ_NUM()
,PIO_DREQ_NUM()
andPIO_FUNCSEL_NUM()
macros to abstract differences between platforms. - Added
sm_config_set_out_pin_base()
andsm_config_set_out_pin_count()
. - Added
sm_config_set_in_pin_base()
andsm_config_set_in_pin_count()
. Note the latter is only meaningful onPICO_PIO_VERSION=1
which supports a limit. - Added
sm_config_set_set_pin_base()
andsm_config_set_set_pin_count()
. - Added
sm_config_set_sideset_pin_base()
andsm_config_set_sideset_pin_count()
. - For
PICO_PICO_VERSION=1
i.e. RP2350: - Added
pio_set_gpio_base()
andpio_get_gpio_base()
to assign the PIO instance to pins 0-31 or 16-47. - Added
pio_set_sm_multi_mask_enabled()
. - Added
pio_clkdiv_restart_sm_multi_mask()
. - Added
pio_enable_sm_multi_mask_in_sync()
. -
NUM_PIO_IRQS
define is now provided for you (2 on both RP2040 and RP2350).
hardware_pll
-
PICO_PLL_VCO_MIN_FREQ_HZ
is new and now preferred toPICO_PLL_VCO_MIN_FREQ_KHZ
orPICO_PLL_VCO_MIN_FREQ_MHZ
. -
PICO_PLL_VCO_MAX_FREQ_HZ
is new and now preferred toPICO_PLL_VCO_MAX_FREQ_KHZ
orPICO_PLL_VCO_MAX_FREQ_MHZ
. -
PLL_RESET_NUM()
macro added to abstract differences between platforms.
hardware_pwm
-
PARAM_ASSERTIONS_ENABLED_PWM
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_PWM
- the old define is still supported as a fallback. -
PICO_DEFAULT_PWM_INSTANCE()
macro added which is equivalent to the pre-existingpwm_default
. - Added
PWM_SLICE_NUM()
andPWM_DREQ_NUM()
macros to abstract differences between platforms. - Added
PWM_DEFAULT_IRQ_NUM()
since RP2350 supports 2 PWM IRQs to indicate which IRQ the pre-existing RP2040 functions use. - Added
pwm_set_irq0_enabled()
,pwm_set_irq1_enabled()
andpwm_irqn_set_slice_enabled()
to differentiate between the IRQs. - Added
pwm_set_irq0_mask_enabled()
,pwm_set_irq1_mask_enabled()
andpwm_irqn_set_mask_enabled()
to differentiate between the IRQs. - Added
pwm_get_irq0_status_mask()
,pwm_get_irq1_status_mask()
andpwm_irqn_get_status_mask()
to differentiate between the IRQs. - Added
pwm_pwm_force_irq0()
,pwm_force_irq1()
andpwm_irqn_force()
to differentiate between the IRQs.
hardware_resets
-
PARAM_ASSERTIONS_ENABLED_RESETS
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS
- the old define is still supported as a fallback. -
reset_block()
is renamed toreset_block_mask()
but the old name is still supported. -
unreset_block()
is renamed tounreset_block_mask()
but the old name is still supported. -
unreset_block_wait()
is renamed tounreset_block_mask_wait_blocking()
but the old name is still supported. -
reset_block_num()
,unreset_block_num()
,unreset_block_num_wait_blocking()
andreset_unreset_block_num_wait_blocking()
added to reset or unreset a single block byreset_num_t
index.
hardware_rtc
- Note this library is only available on RP2040, since the RP2350 lacks the RTC hardware.
- There is a similar always-on timer in
hardware_powman
. - A common API for both RP2040 and RP2350 is provided in
pico_aon_timer
. -
HAS_RP2040_RTC
define is now provided for you.
hardware_spi
-
PARAM_ASSERTIONS_ENABLED_SPI
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_SPI
- the old define is still supported as a fallback. -
PICO_DEFAULT_SPI_INSTANCE()
macro added which is equivalent to the pre-existingspi_default
. - Added
SPI_NUM()
,SPI_INSTANCE()
,SPI_DREQ_NUM()
macros to abstract differences between platforms. - Fixed per-character timeouts.
hardware_sync
-
restore_interrupts_from_disabled()
is added as a variant forrestore_interrupts()
which must be paired with a matchingsave_and_disable_interrupts()
. This is the common usage and produces smaller/faster code on RISC-V. - Spinlock functionality has been delegated to a separate hardware_sync_spinlock library, which is included for you.
- hardware_sync_spin_lock.
- Whilst RP2350 has the same SIO spin locks as RP2040, due to Errata RP2350-E2, these are not used by default.
- Instead, a software implementation using atomic instructions is used.
- You can set
PICO_USE_SW_SPIN_LOCKS=0
to disable this if you know you aren't affected by RP2350-E2 and want to use the h/w spin locks instead.
- Added
spin_try_lock_unsafe()
function.
hardware_timer
-
PARAM_ASSERTIONS_ENABLED_TIMER
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_TIMER
- the old define is still supported as a fallback. - RP2350 supports two timer instances.
-
PICO_DEFAULT_TIMER_INSTANCE()
macro added based onPICO_DEFAULT_TIMER
(0 on RP2040, 0/1 on RP2350). - Added
TIMER_NUM()
,TIMER_INSTANCE()
,TIMER_ALARM_NUM_FROM_IRQ()
andTIMER_ALARM_NUM_FROM_IRQ()
macros to abstract differences between platforms - Added
hardware_alarm_get_irq_num()
to get the processor IRQ number for a particular alarm on a timer. - New versions of all functions added with a
timer_
prefix and a timer instance passed as the first argument. The pre-existing functions call these with the default timer instance. -
NUM_TIMERS
has been renamed toNUM_ALARMS
as that's what it was (4). -
NUM_GENERIC_TIMERS
has been added which is 1 on RP2040 and 2 on RP2350.
hardware_uart
-
PARAM_ASSERTIONS_ENABLED_UART
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_UART
- the old define is still supported as a fallback. -
PICO_DEFAULT_UART_INSTANCE()
macro added which is equivalent to the pre-existinguart_default
. - Added
UART_NUM()
,UART_INSTANCE()
,UART_DREQ_NUM()
,UART_IRQ_NUM()
,UART_CLOCK_NUM()
,UART_RESET_NUM()
macros to abstract differences between platforms. -
uart_set_irq_enables()
is renamed touart_set_irqs_enabled()
but the old name is still supported. -
uart_get_dreq()
is renamed touart_get_dreq_num()
but the old name is still supported. -
uart_get_reset_num()
is added. - Incorrect baud setting for certain frequencies was fixed.
hardware_vreg
-
vreg_disable_voltage_limit()
added to allow full range of DVDD voltage selection on RP2350
hardware_watchdog
-
PARAM_ASSERTIONS_ENABLED_WATCHDOG
is renamed toPARAM_ASSERTIONS_ENABLED_HARDWARE_WATCHDOG
- the old define is still supported as a fallback. - Added
watchdog_disable()
. -
watchdog_get_count()
is renamed towatchdog_get_time_remaining_ms()
but the old name is still supported.
hardware_xosc
-
XOSC_HZ
is new and now preferred toXOSC_KHZ
.
hardware_regs
-
enum irq_num_[rp2040|rp2350]
(typedef-ed asirq_num_t
) added with the constants frominctrl.h
. Note these remain as #defines when included from assembly. -
enum dreq_num_[rp2040|rp2350]
(typedef-ed asdreq_num_t
) added with the constants fromdreq.h
. Note these remain as #defines when included from assembly.
hardware_structs
-
enum bus_ctrl_perf_counter_[rp2040|rp2350]
(typedef-ed asbus_ctrl_perf_counter_t
) added. - Note enum bus_ctrl_per_counter no longer exists.
-
enum clock_num_[rp2040|rp2350]
(typedef-ed asclock_num_t
) added. - Note enum clock_index no longer exists.
-
enum clock_dest_num_[rp2040|rp2350]
(typedef-ed asclock_dest_num_t
) added. -
enum gpio_function_[rp2040|rp2350]
(typedef-ed asgpio_function_t
) added. - Note enum gpio_function no longer exists.
-
enum gpio_function1_[rp2040|rp2350]
(typedef-ed asgpio_function1_t
) added (for QSPI bank). -
enum reset_num_[rp2040|rp2350]
(typedef-ed asreset_num_t
) added. -
enum tick_gen_num_rp2350
(typedef-ed asreset_num_t
) added. - Various naming consistencies have been fixed.
-
iobank0.h
->io_bank00.h
,iobank0_hw
->io_bank0_hw
- shims are provided for the old versions. -
ioqspi.h
->io_qspi0.h
,ioqspi_hw
->io_qspi_hw
- shims are provided for the old versions. -
padsbank0.h
->pads_bank0.h
,padsbank0_hw
->pads_bank0_hw
- shims are provided for the old versions. -
padsqspi.h
->pads_qspi.h
,padsqspi_hw
->pads_qspi_hw
- shims are provided for the old versions. -
bus_ctrl.h
->busctrl.h
,bus_ctrl_hw
->busctrl_hw
(don't ask! buthardware_struct
headers now matchhardware_regs
names at least!).
boot_stage2
- There are now separate implementations for RP2040 and RP2350.
- A
boot_stage2
is not needed on RP2350, but one can be included via the definePICO_EMBED_XIP_SETUP=1
.
cmsis
- CMSIS headers are updated to CMSIS 6.1
- Device headers
RP2040.h
andRP2350.h
are generated, and now include basic hardware structures as per the latestSVDConv
defaults.
pico_bootrom
- New RP2350 bootrom APIs added.
-
rom_xxx()
inline function wrappers added for allxxx()
ROM functions. - Additional
rom_get_boot_random()
androm_add_flash_runtime_partition()
for RP2350 which use underlying bootrom functionality but aren't just wrapper functions.
pico_bt_stack
- BTStack updated to 1.6.1 from 1.5.6
- Lots of additions, fixes and changes, for the full list see the change log
pico_cyw43_arch
-
PARAM_ASSERTIONS_ENABLED_CYW43_ARCH
is renamed toPARAM_ASSERTIONS_ENABLED_PICO_CYW43_ARCH
- the old define is still supported as a fallback. - lib/cyw43-driver has been updated to the latest version
- Mostly bug fixes.
- Adds WPA3 support for Pico W. To use this, use CYW43_AUTH_WPA3_SAE_AES_PSK or CYW43_AUTH_WPA3_WPA2_AES_PSK instead of CYW43_AUTH_WPA2_AES_PSK when connecting to wifi with cyw43_arch_wifi_connect_timeout_ms or cyw43_arch_enable_ap_mode.
pico_cyw43_driver
-
cyw43_driver
updated to commitfaf36381
. - Added support for changing the clock speed of the SPI connection to the Wi-Fi chip. See
CYW43_PIO_CLOCK_DIV_INT
,CYW43_PIO_CLOCK_DIV_FRAC
andCYW43_PIO_CLOCK_DIV_DYNAMIC
.
pico_divider
- Functions that returned a quotient and divider in a
uint64_t
orint64_t
now return adivmod_result_t
- the signed-ness of the value before was meaningless anyway, and the compiler will still return it as a 64-bit value. - Extra functions in
pico/divider.h
now implemented forpico_set_divider_implemtation(compiler)
as well as for RP2350 which has no RP2040 hardware divider.
pico_double
-
pico_set_double_implementation(pico)
(the default) now uses the Double Co-Processor (DCP) for double-precision floating-point arithmetic on Arm RP2350, and highly optimised Arm VFP implementations of the double-precision scientific functions, for much improved performance over the C library versions. - Extra functions exposed from
pico
implementation -
int2double()
-
uint2double()
-
int642double()
-
uint642double()
-
double2uint()
-
double2uint64()
- Extra functions exposed from
pico
implementation for Arm RP2350 only -
ddiv_fast()
-
sqrt_fast()
-
mla()
pico_float
-
pico_set_float_implementation(pico)
(the default) now uses the compiler for single-precision floating point arithmetic on Arm RP2350 since the processor has VFP instructions, but includes custom optimised scientific functions also using the VFP. -
pico_set_diouble_implementation(pico_dcp)
uses the Double Co-Processor (DCP) for single-precision floating point arithmetic on Arm RP2350, and highly optimised Arm M33 implementations of the single-precision scientific functions, for much improved performance over the C library versions. This library is intended for those situations where you cannot (or don't want to) use the VFP instructions. - Extra functions exposed from
pico
implementation. -
int2float()
-
uint2float()
-
int642float()
-
uint642float()
-
float2uint()
-
float2uint64()
-
float2uint_z()
-
float2uint64_z()
- Extra functions exposed from
pico
implementation for Arm R2350 only. -
float2fix64_z()
-
fdiv_fast()
-
fsqrt_fast()
pico_lwip
- Update lib/lwip to 2.2.0
- There have been some bugs fixed, and some new features were added (most notably full Address Conflict Detection support).
pico_mbedtls
- Update to lib/mbedtls to 2.28.8 from 2.28.1
- This release of Mbed TLS provides bug fixes and minor enhancements. This release includes fixes for security issues.
- Added support for hardware SHA256 calculation on RP2350
- To use this in mbedtls you need to define MBEDTLS_SHA256_ALT in your mbedtls_config.h. Use LIB_PICO_SHA256 to check if hardware SHA256 is supported and fallback to defining MBEDTLS_SHA256_C for the software SHA256 calculation.
pico_multicore
- Added
SIO_FIFO_IRQ_NUM()
to get the IRQ number for the FIFO IRQ on a particular core, since RP2040 and RP2350 are different. - note that RP2350 uses the same IRQ number on both cores, so if you have IRQ handlers for both cores, you should share the same function and check the core number in the IRQ handler. This strategy of course works on RP2040 too.
- Added
multicore_fifo_push_blocking_inline()
andmulticore_fifo_pop_blocking_inline()
. - Added
multicore_doorbell_
functions for the new intercore Doorbells on RP2350. -
NUM_DOORBELLS
is provided which is 8 on RP2350, 0 on RP2040.
pico_rand
- Added the hardware TRNG as an additional entropy source on RP2350.
-
HAS_RP2350_TRNG
indicates hardware support. - Many, but not all, of the pre-existing entropy sources are disabled on RP2350 in favour of using the TRNG.
pico_runtime
- A shadow of its former self, it now just:
- aggregates other default libraries required for getting to
main()
and having the C runtime work. - provides low level
runtime_run_initializers()
andruntime_run_per_core_initializers()
which run initializers from the__preinit_array
. - The
runtime_init()
entrypoint has moved topico_clib_interface
.
pico_standard_link
- Much previously included functionality has been split out into
pico_crt0
,pico_cxx_options
andpico_standard_binary_info
. - What remains is entirely focused on setting up the linker configuration.
- Finally fixed a bug where changes to the linker script did not cause a relink.
pico_stdio
- Some internal reorganisation to separate functionality between here and
pico_clib_interface
. - Added
PICO_STDIO_SHORT_CIRCUIT_CLIB_FUNCS
to control whetherprintf
,vprintf
,puts
,putchar
andgetchar
go thru the C library (thus usually pulling in all the FILE handling APIs resulting in huge bloat - but more sensible behaviour when mixing sayprintf
withfprintf(stdout
etc.) This defaults to 0, i.e. "do short-circuit the c lib" which was the behaviour in the previous SDK version. - Add support for Segger RTT stdio.
- Implemented
stdio_flush()
for UART and USB CDC. - Added
stdio_deinit_all()
and individualstdio_deinit_xxx
functions.
pico_stdio_usb
- Now supports MS OS2 descriptors by default. See
PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR
. -
PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE
andPICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE
are now both supported even if the user is usingtinyusb_device
directly themselves. - Bug that could cause deadlock with FreeRTOS SMP and printing from IRQs fixed.
pico_stdlib
-
pico/stdlib.h
no longer declaresset_sys_clock_
functions. You must includehardware/clocks.h
explicitly.
pico_time
-
remaining_alarm_time_ms()
,remaining_alarm_time_us()
,alarm_pool_remaining_alarm_time_ms()
andalarm_pool_remaining_alarm_time_us()
were added. - Implementation of alarm pools completely rewritten for much lower overhead, jitter and higher throughput in the majority of cases. The pairing heap has been replaced with a linked list which is faster and uses less memory in most normal use cases too.
-
NOTE
fire_if_past
now always fires asynchronously in the same way as a normal timeout (rather than being called synchronously during the call). Thusalarm_pool_add_alarm_at_force_in_context
is now no different toalarm_pool_add_alarm_at
. - New
pico_timer_adapter
abstraction added sopico_time
could be backed by other types of timer hardware in the future, and sopico_time
no longer depends directly on ahardware_timer
abstraction which simplifiesPICO_PLATFORM=host
. - Support for two hardware timer blocks on RP2350.
-
alarm_pool_timer_t
abstraction added to represent the time "counter" backing the alarm pool. -
alarm_pool_t
now has an associatedalarm_pool_timer_t
instance. -
alarm_pool_create_on_timer()
is added to create an alarm pool on a specific alarm pool timer. -
alarm_pool_get_default_timer()
is added which is used when not explicitly passing an alarm pool timer.PICO_DEFAULT_TIMER
selects which timer instance is the default (0 onRP2040
, 0/1 onRP2350
). -
PARAM_ASSERTIONS_ENABLED_TIME
is renamed toPARAM_ASSERTIONS_ENABLED_PICO_TIME
- the old define is still supported as a fallback. -
check_timeout_fn
now takes two parameters. This was likely unused outside thepico_time
implementation anyway. - Expose
runtime_init_default_alarm_pool()
function.
pico_util
-
time_to_datetime()
,datetime_to_time()
anddatetime_to_str()
functions relating tohardware_rtc
are now guarded byPICO_INCLUDE_RTC_DATETIME
which defaults to 0 on RP2350, since RP2350 does not include the RP2040 RTC hardware. -
timespec_to_ms()
,timespec_to_us()
,ms_to_timespec()
, andms_to_timespec()
added to convert between C-library high-resolution time offset and millisecond or microsecond precision offsets. -
queue_try_remove()
,queue_try_remove()
,queue_remove_blocking()
andqueue_peek_blocking()
now support passing NULL as the element out pointer if the caller doesn't care.
tinyusb
- TinyUSB moved from release 0.15.0 to commit
42326428
(0.17.0 WIP) - Note that
bsp/board.h
has been renamed by TinyUSB tobsp/board_api.h
the SDK adds a re-director header for you for now. - Support added for RP2350. Requires a custom memcpy implementation in the rp2040 tinusb driver, as unaligned 32 bit access to device memory causes a hard fault on the Cortex M33.
- See the [TinyUSB changelog]https://github.com/hathach/tinyusb/blob/master/docs/info/changelog.rst) for full details.
pioasm
-
pioasm
now supports the full RP2350 PIO (PICO_PIO_VERSION=1
) instruction set - Additionally, it supports many new directives. See the RP2350 Datasheet for full details.
-
Note that currently not all output formats support
PICO_PIO_VERSION=1
as they are community provided.
FreeRTOS integration
-
You should use this repo for the current FreeRTOS-Kernel supporting RP2040 and RP2350: https://github.com/raspberrypi/FreeRTOS-Kernel
-
Dropped legacy support for
configNUM_CORES
for the correctconfigNUMBER_OF_CORES
, which is 2 for SMP support and 1 for non-SMP support. -
RP2350_ARM_NTZ (non-trust-zone), and RP2350_RISC-V are available as well as an updated RP2040 version; the former two basically give you the same "single privilege/security domain" experience as on RP2040.
-
SMP and non-SMP support (along with running FreeRTOS on either core) are available for all.
-
A nasty, but rare pre-existing RP2040 deadlock (especially with TinyUSB printf from IRQs) has been fixed on all three versions; If you were setting configSUPPORT_PICO_SYNC_INTEROP=0 as a workaround, you should no longer do so. Generally, if you are using printf (or anything else using SDK locking primitives) then you do really want configSUPPORT_PICO_SYNC_INTEROP=1 for the best concurrency
-
FreeRTOS on RISC-V does not currently support IRQ preemption (which is a Hazard3 only feature anyway).
Backwards Incompatibilities
There are a handful of minor backwards incompatibilities, that hopefully should affect very few people.
-
boot_picbin
library is now calledboot_picobin_headers
. -
boot picoboot
library is now calledboot_picoboot_headers
. -
boot_uf2
library is now calledboot_uf2_headers
. -
pico_base
library is now calledpico_base_headers
. -
pico/error.h
-PICO_ERROR_GENERIC
is now-1
because there were pre-existing APIs that returned -1 for any error.PICO_ERROR_TIMEOUT
is now-2
(they are swapped from their previous values). -
pico_stdlib
-
pico/stdlib.h
no longer declaresset_sys_clock_
functions. You must includehardware/clocks.h
explicitly. -
pico_time
-
check_timeout_fn
now takes two parameters. This was likely unused outside thepico_time
implementation anyway. -
fire_if_past
now always fires asynchronously in the same way as a normal timeout (rather than being called synchronously during the call). Thusalarm_pool_add_alarm_at_force_in_context
is now no different toalarm_pool_add_alarm_at
. -
hardware_clocks
- The
enum clock_index
no longer exists and has been replaced withclock_num_t
. However, all clock functions now takeclock_handle_t
to allow for future enhancement. This is currently just an alias forclock_num_t
. -
hardware_structs
-
enum bus_ctrl_perf_counter_[rp2040|rp2350]
(typedef-ed asbus_ctrl_perf_counter_t
) added.- Note enum bus_ctrl_per_counter no longer exists.
-
enum clock_num_[rp2040|rp2350]
(typedef-ed asclock_num_t
) added.- Note enum clock_index no longer exists.
-
enum clock_dest_num_[rp2040|rp2350]
(typedef-ed asclock_dest_num_t
) added. -
enum gpio_function_[rp2040|rp2350]
(typedef-ed asgpio_function_t
) added.- Note enum gpio_function no longer exists.
-
hardware_timer
-
NUM_TIMERS
has been renamed toNUM_ALARMS
as that's what it was (4).
Build
- There are major CMake build changes. If you are maintaining your own non-CMake build, you will have to make extensive changes by looking at the differences yourself.
- All SDK headers are now "system" includes.
- You can now specify
rp2350-arm-s
(Arm Secure) andrp2350-riscv
(RISC-V) as well as the previousrp2040
(default) andhost
. - Setting
PICO_BOARD=some_board
will now setPICO_PLATFORM
if one is specified insome_board.h
since most boards either use exclusively RP2040 or RP2350. -
PICO_PLATFORM
also supportsrp2350
but this gets replaced with the valuePICO_DEFAULT_RP2350_PLATFORM
which you can set in your environment orCMakeLists.txt
. Many of the boards for RP2350 - includingpico2
- selectrp2350
as thePICO_BOARD
to honour your preference. -
PICO_PLATFORM
,PICO_BOARD
and other variables will be taken from your environment if not otherwise defined now retain their value after the first CMake invocation. i.e. a pre-existing CMake build configuration directory will not change based on your environment if you re-runcmake
. -
PICO_BOARD=pico_w
is no longer an odd child out requiring a CMake board file; support for CYW43 Wi-Fi can now be specified in the board header. -
ELF2UF2
is now replaced by use ofpicotool
which will be built as part of your build if not installed on the system. See the picotool GitHub repository for more details on building and installing it locally. -
PICO_GCC_TRIPLE
can now be a ';' separated list as well as a single value. - NOTE: This release of the SDK does not support writing Arm Non-Secure binaries to run under the wing of an Arm Secure binary. This support will be added in a subsequent release.
- Compiler support is widening - we always recommend a recent version.)
- All recent GCCs are supported on Arm. (GCC 14 has not yet been tested for full support though).
- Very recent GCCs are required on RISC-V due to the bleeding-edge nature of some of the processor instructions.
- Recent LLVM Embedded Toolchain for ArmRM versions are supported on Arm.
- Pigweed LLVM is supported for Arm.
- For further details see the Raspberry Pi Pico C/C++ SDK book.
- Bazel may be used to build the SDK on Arm. See the README. Note that the Bazel build is community-provided and maintained.
Building Documentation
- The
docs
build target to build the HTML code documentation now builds a set of documentation peculiar to your particularPICO_PLATFORM
setting. -
PICO_PLATFORM=combined_docs
can be used (just for building docs) to build the combined documentation for both RP2040 and RP2350.
Fixed Issues
You can see a list of individual commits here, and a list of resolved issues here.
Note these only include public changes made since version 1.5.1. The majority of new code and collateral fixes for the previously unannounced RP2350 were developed and committed in private and delivered as a single "squashed" commit.
New Examples
There are in the pico_examples repository.
Example | Description |
---|---|
enc_bootloader | A bootloader which decrypts binaries from flash into SRAM. |
hello_dcp | Use the double-precision coprocessor directly in assembler. |
dvi_out_hstx_encoder RP2350 |
Use the HSTX to output a DVI signal with 3:3:2 RGB |
runtime_flash_permissions | Demonstrates adding partitions at runtime to change the flash permissions |
hello_freertos | Examples that demonstrate how run FreeRTOS and tasks on 1 or 2 cores. |
multicore_doorbell | Claims two doorbells for signaling between the cores. Counts how many doorbell IRQs occur on the second core and uses doorbells to coordinate exit. |
hello_otp | Demonstrate reading and writing from the OTP on RP2350, along with some of the features of OTP (error correction and page locking). |
picow_httpd | Runs a LWIP HTTP server test app |
picow_freertos_ntp_client_socket | Connects to an NTP server using the LwIP Socket API with FreeRTOS in NO_SYS=0 (i.e. full FreeRTOS integration) mode. |
pico_freertos_httpd_nosys | Runs a LWIP HTTP server test app under FreeRTOS in NO_SYS=1 mode. |
pico_freertos_httpd_sys | Runs a LWIP HTTP server test app under FreeRTOS in NO_SYS=0 (i.e. full FreeRTOS integration) mode. |
squarewave_div_sync | Generates a square wave on three GPIOs and synchronises the divider on all the state machines |
quadrature_encoder_substep | High resolution speed measurement using a standard quadrature encoder |
hello_sha256 | Demonstrates how to use the pico_sha256 library to calculate a checksum using the hardware in rp2350 |
mbedtls_sha256 | Demonstrates using the SHA-256 hardware acceleration in mbedtls |
boot_info | Demonstrate how to read and interpret sys info boot info. |
rand | Demonstrate how to use the pico random number functions. |
hello_universal | The obligatory Hello World program for Pico (USB and serial output). On RP2350 it will reboot to the other architecture after every 10 prints. |
nuke_universal | Same as the nuke binary, but universal. On RP2350 runs as a packaged SRAM binary, so is written to flash and copied to SRAM by the bootloader |
1、 pico-sdk-2.0.0.tar.gz 2.24MB