Bot releases are visible (Hide)
This is a major release which adds support for the new RP2350 and for compiling RISC-V code in addition to Arm.
#defines
and CMake
build variables.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.
rp2350-arm-s
(Arm Secure) or rp2350-riscv
(RISC-V) as well as the previous rp2040
(default) and host
.PICO_BOARD=some_board
will now set PICO_PLATFORM
if one is specified in some_board.h
since most boards either use exclusively RP2040 or RP2350.PICO_PLATFORM
also supports rp2350
but this gets replaced with the value PICO_DEFAULT_RP2350_PLATFORM
which you can set in your environment or CMakeLists.txt
. Many of the boards for RP2350 - including pico2
- select rp2350
as the PICO_BOARD
to honour your preference.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
HAS_DOUBLE_COPROCESSOR
define indicates hardware supportHAS_POWMAN_TIMER
define indicates hardware support.HAS_REDUNDANCY_COPROCESSOR
define indicates hardware support.TICK_WATCHDOG
is used, which is backed by the hardware in the RP2040 WatchDog hardware.PICO_SPINLOCK_ID_ATOMIC
.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 in pico_runtime_init
.pico_runtime
by default.PICO_BOOTROM_LOCKING_ENABLED
which defaults to 1 on RP2350.pico_bootrom
call the functions in pico_boot_lock
around affects bootrom functions, and thus will take and release locks if PICO_BOOTROM_LOCKING_ENABLED=1
.NUM_BOOT_LOCKS
define indicates the number of boot locks (8 on 'RP2350', 0 on 'RP2040').pico_runtime
by default.pico_standard_link
to encapsulate the earliest startup code before the runtime initialisation, and shutdown code after the runtime.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.pico_runtime
by defaultpico_standard_link
to configure C++ options.pico_standard_link
by default.pico_platform
with the functions/macros related to the compiler.pico_platform
by default.pico_platform
with the panic function implementation.pico_platform
by default.pico_platform
with the section macros such as __not_in_flash_func
.pico_platform
by default.runtime_init()
was a monolithic function which also called some __preinit_array
initialisers, the new runtime_init library:PICO_RUNTIME_INIT_FOO
which is a "12345" line number ordering of the initialiser with respect to others.runtime_init_foo()
which is the actual initialiser.PICO_RUNTIME_SKIP_INIT_FOO
is not set, it adds the initialiser entry to call runtime_init_foo()
before main
(or per core initialisation).PICO_RUNTIME_NO_INIT_FOO
is not set, it adds the (weak) implementation of runtime_init_foo()
.pico_runtime
by default.pico_standard_link
that adds the "common" binary info items to the binary.pico_standard_link
by default.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/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.pico/types.h
, by popular demand, absolute_time_t
now always defaults to uint64_t
regardless of the type of build. You can set PICO_OPAQUE_ABSOLUTE_TIME_T=1
to make it a struct in all build types.PICO_BINARY_INFO_USE_PINS_64=1
- this is defaulted for you based on the number of GPIOs on the board.PARAM_ASSERTIONS_ENABLED_ADC
is renamed to PARAM_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.set_sys_clock_
functions are now in hardware/clocks.h
.PLL_COMMON_REFDIV
is deprecated in favour of PLL_SYS_REFDIV
and PLL_USB_REFDIV
.PLL_SYS_VCO_FREQ_HZ
is new and preferred over PLL_SYS_VCO_FREQ_KHZ
.PLL_USB_VCO_FREQ_HZ
is new and preferred over PLL_USB_VCO_FREQ_KHZ
.XOSC_HZ
, SYS_CLK_HZ
, USB_CLK_HZ
now added, and take preference over the still supported XOSC_KHZ
, SYS_CLK_KHZ
, and USB_CLK_KHZ
.set_sys_clock_hz()
and check_sys_clock_hz()
added.clock_configure_undivided()
and clock_configure_int_divider()
for no divisor or a whole integer divider as the code doesn't require 64-bit arithmetic and thus saves space.enum clock_index
no longer exists and has been replaced with clock_num_t
. However, all clock functions now take clock_handle_t
to allow for future enhancement. This is currently just an alias for clock_num_t
CMake
configuration for a particular clock setting.hardware_divider
functions are provided for RP2350.HAS_SIO_DIVIDER
define is now provided for you.PARAM_ASSERTIONS_ENABLED_DMA
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_DMA
- the old define is still supported as a fallback.dma_get_irq_num()
function and DMA_IRQ_NUM()
macro to return the process IRQ Number for the n th DMA IRQ.NUM_DMA_IRQS
define is provided for you.PARAM_ASSERTIONS_ENABLED_EXCEPTION
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_EXCEPTION
- the old define is still supported as a fallback.cause
numbers.exeception_[get|set]_priority()
are added for Arm.PARAM_ASSERTIONS_ENABLED_FLASH
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_FLASH
- the old define is still supported as a fallback.flash_flush_cache()
is added.PARAM_ASSERTIONS_ENABLED_GPIO
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_GPIO
- the old define is still supported as a fallback.enum gpio_function
no longer exists and has been replaced with gpio_function_t
.gpio_xxx_masked()
functions now have a gpio_xxx_masked64()
variant that takes a 64-bit mask of GPIO indexes.gpio_xxx_mask()
functions now have a gpio_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.PICO_USE_GPIO_COPROCESSOR
.HAS_GPIO_COPROCESSOR
define indicates hardware support.PARAM_ASSERTIONS_ENABLED_I2C
is renamed to PARAM_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-existing i2c_default
I2C_NUM()
, I2C_INSTANCE()
, I2C_DREQ_NUM()
macros to abstract differences between platforms.PARAM_ASSERTIONS_ENABLED_INTERP
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_INTERP
- the old define is still supported as a fallback.PARAM_ASSERTIONS_ENABLED_IRQ
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_IRQ
- the old define is still supported as a fallback.irq_xxx_mask_xxx()
functions now have a gpio_xxx_mask_n_xxx()
variant that affects the n th set of 32 IRQsruntime_init_per_core_irq_priorities()
functionirq_set_riscv_vector_handler()
function to replace code entries in the machine vector table.PARAM_ASSERTIONS_ENABLED_PIO
is renamed to PARAM_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.pio_sm_set_jmp_pin()
.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.pio_get_irq_num()
function to return the process IRQ Number for the n th PIO IRQ for a PIO instance.PIO_NUM()
, PIO_INSTANCE()
, PIO_IRQ_NUM()
, PIO_DREQ_NUM()
and PIO_FUNCSEL_NUM()
macros to abstract differences between platforms.sm_config_set_out_pin_base()
and sm_config_set_out_pin_count()
.sm_config_set_in_pin_base()
and sm_config_set_in_pin_count()
. Note the latter is only meaningful on PICO_PIO_VERSION=1
which supports a limit.sm_config_set_set_pin_base()
and sm_config_set_set_pin_count()
.sm_config_set_sideset_pin_base()
and sm_config_set_sideset_pin_count()
.PICO_PICO_VERSION=1
i.e. RP2350:pio_set_gpio_base()
and pio_get_gpio_base()
to assign the PIO instance to pins 0-31 or 16-47.pio_set_sm_multi_mask_enabled()
.pio_clkdiv_restart_sm_multi_mask()
.pio_enable_sm_multi_mask_in_sync()
.NUM_PIO_IRQS
define is now provided for you (2 on both RP2040 and RP2350).PICO_PLL_VCO_MIN_FREQ_HZ
is new and now preferred to PICO_PLL_VCO_MIN_FREQ_KHZ
or PICO_PLL_VCO_MIN_FREQ_MHZ
.PICO_PLL_VCO_MAX_FREQ_HZ
is new and now preferred to PICO_PLL_VCO_MAX_FREQ_KHZ
or PICO_PLL_VCO_MAX_FREQ_MHZ
.PLL_RESET_NUM()
macro added to abstract differences between platforms.PARAM_ASSERTIONS_ENABLED_PWM
is renamed to PARAM_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-existing pwm_default
.PWM_SLICE_NUM()
and PWM_DREQ_NUM()
macros to abstract differences between platforms.PWM_DEFAULT_IRQ_NUM()
since RP2350 supports 2 PWM IRQs to indicate which IRQ the pre-existing RP2040 functions use.pwm_set_irq0_enabled()
, pwm_set_irq1_enabled()
and pwm_irqn_set_slice_enabled()
to differentiate between the IRQs.pwm_set_irq0_mask_enabled()
, pwm_set_irq1_mask_enabled()
and pwm_irqn_set_mask_enabled()
to differentiate between the IRQs.pwm_get_irq0_status_mask()
, pwm_get_irq1_status_mask()
and pwm_irqn_get_status_mask()
to differentiate between the IRQs.pwm_pwm_force_irq0()
, pwm_force_irq1()
and pwm_irqn_force()
to differentiate between the IRQs.PARAM_ASSERTIONS_ENABLED_RESETS
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_RESETS
- the old define is still supported as a fallback.reset_block()
is renamed to reset_block_mask()
but the old name is still supported.unreset_block()
is renamed to unreset_block_mask()
but the old name is still supported.unreset_block_wait()
is renamed to unreset_block_mask_wait_blocking()
but the old name is still supported.reset_block_num()
, unreset_block_num()
, unreset_block_num_wait_blocking()
and reset_unreset_block_num_wait_blocking()
added to reset or unreset a single block by reset_num_t
index.hardware_powman
.pico_aon_timer
.HAS_RP2040_RTC
define is now provided for you.PARAM_ASSERTIONS_ENABLED_SPI
is renamed to PARAM_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-existing spi_default
.SPI_NUM()
, SPI_INSTANCE()
, SPI_DREQ_NUM()
macros to abstract differences between platforms.restore_interrupts_from_disabled()
is added as a variant for restore_interrupts()
which must be paired with a matching save_and_disable_interrupts()
. This is the common usage and produces smaller/faster code on RISC-V.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.spin_try_lock_unsafe()
function.PARAM_ASSERTIONS_ENABLED_TIMER
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_TIMER
- the old define is still supported as a fallback.PICO_DEFAULT_TIMER_INSTANCE()
macro added based on PICO_DEFAULT_TIMER
(0 on RP2040, 0/1 on RP2350).TIMER_NUM()
, TIMER_INSTANCE()
, TIMER_ALARM_NUM_FROM_IRQ()
and TIMER_ALARM_NUM_FROM_IRQ()
macros to abstract differences between platformshardware_alarm_get_irq_num()
to get the processor IRQ number for a particular alarm on a timer.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 to NUM_ALARMS
as that's what it was (4).NUM_GENERIC_TIMERS
has been added which is 1 on RP2040 and 2 on RP2350.PARAM_ASSERTIONS_ENABLED_UART
is renamed to PARAM_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-existing uart_default
.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 to uart_set_irqs_enabled()
but the old name is still supported.uart_get_dreq()
is renamed to uart_get_dreq_num()
but the old name is still supported.uart_get_reset_num()
is added.vreg_disable_voltage_limit()
added to allow full range of DVDD voltage selection on RP2350PARAM_ASSERTIONS_ENABLED_WATCHDOG
is renamed to PARAM_ASSERTIONS_ENABLED_HARDWARE_WATCHDOG
- the old define is still supported as a fallback.watchdog_disable()
.watchdog_get_count()
is renamed to watchdog_get_time_remaining_ms()
but the old name is still supported.XOSC_HZ
is new and now preferred to XOSC_KHZ
.enum irq_num_[rp2040|rp2350]
(typedef-ed as irq_num_t
) added with the constants from inctrl.h
. Note these remain as #defines when included from assembly.enum dreq_num_[rp2040|rp2350]
(typedef-ed as dreq_num_t
) added with the constants from dreq.h
. Note these remain as #defines when included from assembly.enum bus_ctrl_perf_counter_[rp2040|rp2350]
(typedef-ed as bus_ctrl_perf_counter_t
) added.enum clock_num_[rp2040|rp2350]
(typedef-ed as clock_num_t
) added.enum clock_dest_num_[rp2040|rp2350]
(typedef-ed as clock_dest_num_t
) added.enum gpio_function_[rp2040|rp2350]
(typedef-ed as gpio_function_t
) added.enum gpio_function1_[rp2040|rp2350]
(typedef-ed as gpio_function1_t
) added (for QSPI bank).enum reset_num_[rp2040|rp2350]
(typedef-ed as reset_num_t
) added.enum tick_gen_num_rp2350
(typedef-ed as reset_num_t
) added.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! but hardware_struct
headers now match hardware_regs
names at least!).boot_stage2
is not needed on RP2350, but one can be included via the define PICO_EMBED_XIP_SETUP=1
.RP2040.h
and RP2350.h
are generated, and now include basic hardware structures as per the latest SVDConv
defaults.rom_xxx()
inline function wrappers added for all xxx()
ROM functions.rom_get_boot_random()
and rom_add_flash_runtime_partition()
for RP2350 which use underlying bootrom functionality but aren't just wrapper functions.PARAM_ASSERTIONS_ENABLED_CYW43_ARCH
is renamed to PARAM_ASSERTIONS_ENABLED_PICO_CYW43_ARCH
- the old define is still supported as a fallback.cyw43_driver
updated to commit faf36381
.CYW43_PIO_CLOCK_DIV_INT
, CYW43_PIO_CLOCK_DIV_FRAC
and CYW43_PIO_CLOCK_DIV_DYNAMIC
.uint64_t
or int64_t
now return a divmod_result_t
- the signed-ness of the value before was meaningless anyway, and the compiler will still return it as a 64-bit value.pico/divider.h
now implemented for pico_set_divider_implemtation(compiler)
as well as for RP2350 which has no RP2040 hardware divider.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.pico
implementationint2double()
uint2double()
int642double()
uint642double()
double2uint()
double2uint64()
pico
implementation for Arm RP2350 onlyddiv_fast()
sqrt_fast()
mla()
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.pico
implementation.int2float()
uint2float()
int642float()
uint642float()
float2uint()
float2uint64()
float2uint_z()
float2uint64_z()
pico
implementation for Arm R2350 only.float2fix64_z()
fdiv_fast()
fsqrt_fast()
SIO_FIFO_IRQ_NUM()
to get the IRQ number for the FIFO IRQ on a particular core, since RP2040 and RP2350 are different.multicore_fifo_push_blocking_inline()
and multicore_fifo_pop_blocking_inline()
.multicore_doorbell_
functions for the new intercore Doorbells on RP2350.NUM_DOORBELLS
is provided which is 8 on RP2350, 0 on RP2040.HAS_RP2350_TRNG
indicates hardware support.main()
and having the C runtime work.runtime_run_initializers()
and runtime_run_per_core_initializers()
which run initializers from the __preinit_array
.runtime_init()
entrypoint has moved to pico_clib_interface
.pico_crt0
, pico_cxx_options
and pico_standard_binary_info
.pico_clib_interface
.PICO_STDIO_SHORT_CIRCUIT_CLIB_FUNCS
to control whether printf
, vprintf
, puts
, putchar
and getchar
go thru the C library (thus usually pulling in all the FILE handling APIs resulting in huge bloat - but more sensible behaviour when mixing say printf
with fprintf(stdout
etc.) This defaults to 0, i.e. "do short-circuit the c lib" which was the behaviour in the previous SDK version.stdio_flush()
for UART and USB CDC.stdio_deinit_all()
and individual stdio_deinit_xxx
functions.PICO_STDIO_USB_RESET_INTERFACE_SUPPORT_MS_OS_20_DESCRIPTOR
.PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE
and PICO_STDIO_USB_ENABLE_RESET_VIA_BAUD_RATE
are now both supported even if the user is using tinyusb_device
directly themselves.pico/stdlib.h
no longer declares set_sys_clock_
functions. You must include hardware/clocks.h
explicitly.remaining_alarm_time_ms()
, remaining_alarm_time_us()
, alarm_pool_remaining_alarm_time_ms()
and alarm_pool_remaining_alarm_time_us()
were added.fire_if_past
now always fires asynchronously in the same way as a normal timeout (rather than being called synchronously during the call). Thus alarm_pool_add_alarm_at_force_in_context
is now no different to alarm_pool_add_alarm_at
.pico_timer_adapter
abstraction added so pico_time
could be backed by other types of timer hardware in the future, and so pico_time
no longer depends directly on a hardware_timer
abstraction which simplifies PICO_PLATFORM=host
.alarm_pool_timer_t
abstraction added to represent the time "counter" backing the alarm pool.alarm_pool_t
now has an associated alarm_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 on RP2040
, 0/1 on RP2350
).PARAM_ASSERTIONS_ENABLED_TIME
is renamed to PARAM_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 the pico_time
implementation anyway.runtime_init_default_alarm_pool()
function.time_to_datetime()
, datetime_to_time()
and datetime_to_str()
functions relating to hardware_rtc
are now guarded by PICO_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()
, and ms_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()
and queue_peek_blocking()
now support passing NULL as the element out pointer if the caller doesn't care.42326428
(0.17.0 WIP)bsp/board.h
has been renamed by TinyUSB to bsp/board_api.h
the SDK adds a re-director header for you for now.pioasm
now supports the full RP2350 PIO (PICO_PIO_VERSION=1
) instruction setPICO_PIO_VERSION=1
as they are community provided.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 correct configNUMBER_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).
There are a handful of minor backwards incompatibilities, that hopefully should affect very few people.
boot_picbin
library is now called boot_picobin_headers
.boot picoboot
library is now called boot_picoboot_headers
.boot_uf2
library is now called boot_uf2_headers
.pico_base
library is now called pico_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 declares set_sys_clock_
functions. You must include hardware/clocks.h
explicitly.pico_time
check_timeout_fn
now takes two parameters. This was likely unused outside the pico_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). Thus alarm_pool_add_alarm_at_force_in_context
is now no different to alarm_pool_add_alarm_at
.hardware_clocks
enum clock_index
no longer exists and has been replaced with clock_num_t
. However, all clock functions now take clock_handle_t
to allow for future enhancement. This is currently just an alias for clock_num_t
.hardware_structs
enum bus_ctrl_perf_counter_[rp2040|rp2350]
(typedef-ed as bus_ctrl_perf_counter_t
) added.
enum clock_num_[rp2040|rp2350]
(typedef-ed as clock_num_t
) added.
enum clock_dest_num_[rp2040|rp2350]
(typedef-ed as clock_dest_num_t
) added.enum gpio_function_[rp2040|rp2350]
(typedef-ed as gpio_function_t
) added.
hardware_timer
NUM_TIMERS
has been renamed to NUM_ALARMS
as that's what it was (4).rp2350-arm-s
(Arm Secure) and rp2350-riscv
(RISC-V) as well as the previous rp2040
(default) and host
.PICO_BOARD=some_board
will now set PICO_PLATFORM
if one is specified in some_board.h
since most boards either use exclusively RP2040 or RP2350.PICO_PLATFORM
also supports rp2350
but this gets replaced with the value PICO_DEFAULT_RP2350_PLATFORM
which you can set in your environment or CMakeLists.txt
. Many of the boards for RP2350 - including pico2
- select rp2350
as the PICO_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-run cmake
.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 of picotool
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.docs
build target to build the HTML code documentation now builds a set of documentation peculiar to your particular PICO_PLATFORM
setting.PICO_PLATFORM=combined_docs
can be used (just for building docs) to build the combined documentation for both RP2040 and RP2350.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.
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 |
Published by kilograham over 1 year ago
This release is largely a bug fix release, however it also makes Bluetooth support official and adds some new libraries and functionality.
Highlights are listed below, or you can see the full list of individual commits here, and the full list of resolved issues here.
The following board has been added and may be specified via PICO_BOARD
:
pololu_3pi_2040_robot
The following board configurations have been modified:
adafruit_itsybitsy_rp2040
- corrected the mismatched PICO_DEFAULT_I2C
bus number (favors the breadboard pins not the stemma connector).sparkfun_thingplus
- added WS2812 pin config.dma_channel_cleanup()
function that can be used to clean up a dynamically claimed DMA channel after use, such that it won't be in a surprising state for the next user, making sure that any in-flight transfer is aborted, and no interrupts are left pending.spi_set_format
, spi_set_slave
, spi_set_baudrate
functions that modify the configuration of an SPI instance, now disable the SPI while changing the configuration as specified in the data sheet.user_data
member to async_when_pending_worker_t
to match async_at_time_worker_t
.cyw43_arch_disable_sta_mode()
function to complement cyw43_arch_enable_sta_mode()
.cyw43_arch_disable_ap_mode()
function to complement cyw43_arch_enable_ap_mode()
.USBD_PRODUCT
and USBD_MANUFACTURER
can now be extended by definingUSBD_DESC_STR_MAX
.PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS
is now supported in the build as well as compiler definitions; if it is set in the build, it is added to the compile definitions.PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER=1
.set_sys_clock_pll
and set_sys_clock_khz
methods now reference a pre-processor define PICO_CLOCK_AJDUST_PERI_CLOCK_WITH_SYS_CLOCK
. If set to 1
, the peripheral clock is updated to match the new system clock, otherwise the preexisting behavior (of setting the peripheral clock to a safe 48Mhz) is preserved.XOSC_KHZ
is used in preference to the preexisting XOSC_MHZ
to define the crystal oscillator frequency. This value is now also correctly plumbed through the various clock setup functions, such that they behave correctly with a crystal frequency other than 12Mhz. XOSC_MHZ
will be automatically defined for backwards compatibility if XOSC_KHZ
is an exact multiple of 1000 Khz. Note that either XOSC_MHZ
or XOSC_KHZ
may be specified by the user, but not both.PLL_COMMON_REFDIV
can be specified to override the default reference divider of 1.PLL_SYS_VCO_FREQ_KHZ
, PLL_SYS_POSTDIV1
and PLL_SYS_POSTDIV2
are used to configure the system clock PLL during runtime initialization. These are defaulted for you if SYS_CLK_KHZ=125000
, XOSC_KHZ=12000
and PLL_COMMON_REFDIV=1
. You can modify these values in your CMakeLists.txt
if you want to configure a different system clock during runtime initialization, or are using a non-standard crystal.PLL_USB_VCO_FREQ_KHZ
, PLL_USB_POSTDIV1
and PLL_USB_POSTDIV2
are used to configure the USB clock PLL during runtime initialization. These are defaulted for you if USB_CLK_KHZ=48000
, XOSC_KHZ=12000
and PLL_COMMON_REFDIV=1
. You can modify these values in your CMakeLists.txt
if you want to configure a different USB clock if you are using a non-standard crystal.PICO_PLL_VCO_MIN_FREQ_KHZ
is used in preference to the pre-existing PICO_PLL_VCO_MIN_FREQ_MHZ
, though specifying either is supported.PICO_PLL_VCO_MAX_FREQ_KHZ
is used in preference to the pre-existing PICO_PLL_VCO_MAX_FREQ_MHZ
, though specifying either is supported.hardware_flash
. It provides helper functions to facilitate getting into aflash_safe_execute()
function to execute a callback function while in the "safe" state.flash_safe_execute_core_init()
function which must be called from the "other core" when using pico_multicore
to enable the cooperative support for entering a "safe" state.get_flash_safety_helper()
function.unified
syntax.
pico_default_asm( ... )
and pico_default_asm_volatile( ... )
are provided that are equivalent to __asm
and __asm volatile
blocks, but with a .syntax unified
at the beginning.pico_default_asm_setup
is provided to configure the correct CPU and dialect.PICO_BOARD
and PICO_BOARD_HEADER_DIRS
now correctly use the latest environment variable value if present.
A CMake performance regression due to repeated calls to find_package
has been fixed.
Experimental support is provided for compiling with Clang. As an example, you can build with the
LLVM Embedded Toolchain for Arm, noting however that currently only version 14.0.0 works, as later versions use picolib
rather than newlib
.
mkdir clang_build
cd clang_build
cmake -DPICO_COMPILER=pico_arm_clang -DPICO_TOOLCHAIN_PATH=/path/to/arm-embedded-llvm-14.0.0 ..
make
The support is now official. Please find examples in pico-examples.
pico_btstack_ble
- Adds Bluetooth Low Energy (LE) support.pico_btstack_classic
- Adds Bluetooth Classic support.pico_btstack_sbc_encoder
- Adds Bluetooth Sub Band Coding (SBC) encoder support.pico_btstack_sbc_decoder
- Adds Bluetooth Sub Band Coding (SBC) decoder support.pico_btstack_bnep_lwip
- Adds Bluetooth Network Encapsulation Protocol (BNEP) support using LwIP.pico_btstack_bnep_lwip_sys_freertos
- Adds Bluetooth Network Encapsulation Protocol (BNEP) support using LwIP with FreeRTOS for NO_SYS=0
.pico_btstack_run_loop_async_context
- provides a common async_context
backed implementation of a BTstack "run loop" that can be used for all BTstack use with the pico-sdk
.pico_btstack_flash_bank
- provides a sample implementation for storing required Bluetooth state in flash.pico_btstack_cyw43
- integrates BTstack with the CYW43 driver.CMake
function pico_btstack_make_gatt_header
can be used to run the BTstack compile_gatt
tool to make a GATT header file from a BTstack GATT
file.pico_cyw43_driver
and cyw43_driver
now support HCI communication for Bluetooth.cyw43_driver_picow
now supports Pico W specific HCI communication for Bluetooth over SPI.cyw43_arch_init()
and cyw43_arch_deinit()
automatically handle Bluetooth support if CYW43_ENABLE_BLUETOOTH
is 1
(as it will be automatically if you depend on pico_btstack_cyw43
).Key changes since 1.5.0:
pico_btstack_flash_bank
can be specified at runtime by defining pico_flash_bank_get_storage_offset_func
to your own function to return the offset within flash.pico_btstack_flash_bank
is now safe for multicore / FreeRTOS SMP use, as it uses the new pico_flash
library to make sure the other core is not accessing flash during flash updates. If you are using pico_multicore
you must have called flash_safe_execute_core_init
from the "other" core (to the one Bluetooth is running on).cyw43_driver
and btstack
to the newest versions.Thanks to the following for their contributions:
2bndy5,
agento2,
Andrew Burge,
Andrew Scheller,
arjunak234,
David Thacher,
djazz,
Graham Sanderson,
hubiscode,
James Hughes,
Luke Wren,
Malte Thiesen,
Michael Busby,
Mr. Green's Workshop,
Paul Grayson,
Peter Harper
Published by kilograham over 1 year ago
This release contains new libraries and functionality, along with numerous bug fixes and documentation improvements.
Highlights are listed below, or you can see the full list of individual commits here, and the full list of resolved issues here.
Note, these release notes are long and may appear truncated in the "Releases" tab; you can see the full version here.
The following boards have been added and may be specified via PICO_BOARD
:
nullbits_bit_c_pro
waveshare_rp2040_lcd_1.28
waveshare_rp2040_one
clock_gpio_init()
now takes a float
for the clock divider value, rather than an int
.clock_gpio_init_int_frac()
function to allow initialization of integer and fractional part of the clock divider value, without using float
.--ref-min
option to vcocalc.py
to override the minimum reference frequency allowed.vcocalc.py
now additionally considers reference frequency dividers greater than 1.hw_divider_
functions.dma_sniffer_set_output_invert_enabled()
and dma_sniffer_set_output_reverse_enabled()
functions to configure the DMA sniffer.dma_sniffer_set_data_accumulator()
and dma_sniffer_get_data_accumulator()
functions to access the DMA sniffer accumulator.i2c_get_instance()
function for consistency with other hardware_
libraries.i2c_read_byte_raw()
, i2c_write_byte_raw()
functions to directly read and write the I2C data register for an I2C instance.hardware_alarm_claim_unused()
function to claim an unused hardware timer.cyw43_arch_wifi_connect_bssid_
variants of cyw43_arch_wifi_connect_
functions to allow connection to a specific access point.cyw43_arch_wifi_connect_
functions now continue trying to connect rather than failing immediately if the network is not found.cyw43_arch_wifi_connect_
functions now return consistent return codes (PICO_OK
, or PICO_ERROR_XXX
).pico_cyw43_arch
library has been completely rewritten on top of the new pico_async_context
library that generically abstracts the different types of asynchronous operation (poll
, threadsafe_background
and freertos
) previously handled in a bespoke fashion by pico_cyw43_arch
. Many edge case bugs have been fixed as a result of this. Note that this change should be entirely backwards compatible from the user point of view.cyw43_arch_init()
and cyw43_arch_deinit()
functions are now very thin layers which handle async_context
life-cycles, along with adding support for the cyw43_driver
, lwIP, BTstack etc. to that async_context
. Currently, these mechanisms remain the preferred documented way to initialize Pico W networking, however you are free to do similar initialization/de-initialization yourself.cyw43_arch_set_async_context()
function to specify a custom async_context
prior to calling cyw43_arch_init*()
cyw43_arch_async_context()
function to get the async_context
used by the CYW43 architecture support.cyw43_arch_init_default_async_context()
function to return the async_context
that cyw43_arch_init*()
would initialize if one has not been set by the user.cyw43_arch_wait_for_work_until()
function to block until there is networking work to be done. This is most useful for poll
style applications that have no other work to do and wish to sleep until cyw43_arch_poll()
needs to be called again.cyw43_driver
- the raw cyw43_driver code.cyw43_driver_picow
- additional support for communication with the Wi-Fi chip over SPI on Pico W.pico_cyw43_driver
- integration of the cyw43_driver with the pico-sdk
via async_context
CYW43_WIFI_NVRAM_INCLUDE_FILE
define to allow user to override the NVRAM file.panic_compact()
function that discards the message to save space in non-debug (NEBUG
defined) builds.newlib
system APIs: _gettimeofday()
, _times()
, _isatty()
, _getpid()
.gettimeofday()
, times()
and std::chrono
.settimeofday()
implementation such that gettimeofday()
can be meaningfully used.-1
) implementations of the remaining newlib
system APIs: _open()
, _close()
, _lseek()
, _fstat()
, _isatty()
, _kill()
, to prevent warnings on GCC 12.newlib
system API implementations weak so the user can override them.pico_stdio
allows for outputting from within an IRQ handler that creates the potential for deadlocks (especially with pico_stdio_usb
), and the intention is to not deadlock but instead discard output in any cases where a deadlock would otherwise occur. The code has been revamped to avoid more deadlock cases, and a new define PICO_STDIO_DEADLOCK_TIMEOUT_MS
has been added to catch remaining cases that might be caused by user level locking.stdio_set_chars_available_callback()
function to set a callback to be called when input is available. See also the new PICO_STDIO_USB_SUPPORT_CHARS_AVAILABLE_CALLBACK
and PICO_STDIO_UART_SUPPORT_CHARS_AVAILABLE_CALLBACK
defines which both default to 1
and control the availability of this new feature for USB and UART stdio respectively (at the cost of a little more code).stdio_semihosting
.stdio_usb
via USBD_VID
, USBD_PID
, USBD_PRODUCT
, PICO_STDIO_USB_CONNECTION_WITHOUT_DTR
and PICO_STDIO_USB_DEVICE_SELF_POWERED
critical_section_is_initialized()
function to test if a critical section has been initialized.mutex_try_enter_block_until()
function to wait only up to a certain time to acquire a mutex.from_us_since_boot()
function to convert a uint64_t
timestamp to an absolute_time_t
.absolute_time_min()
function to return the earlier of two absolute_time_t
values.alarm_pool_create_with_unused_hardware_alarm()
function to create an alarm pool using a hardware alarm number claimed using hardware_alarm_claim()
.alarm_pool_core_num()
function to determine what core an alarm pool runs on.alarm_pool_add_alarm_at_force_in_context()
function to add an alarm, and have it always run in the IRQ context even if the target time is in the past, or during the call. This may be simpler in some cases than dealing with the fire_if_past
parameters to existing functions, and avoids some callbacks happening from non IRQ context.pico_lwip_mqtt
library to expose the MQTT app functionality in lwIP.pico_lwip_mdns
library to expose the MDNS app functionality in lwIP.pico_lwip_freertos
library for NO_SYS=0
with FreeRTOS as a complement to pico_lwip_nosys
for NO_SYS=1
.dcd_rp2040
driver's TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX
variable to 1
as a workaround for errata RP2040-E15. This fix is required for correctness, but comes at the cost of some performance, so applications that won't ever be plugged into a Pi 4 or Pi 400 can optionally disable this by setting the value of TUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX
to 0
either via target_compile_definitions
in their CMakeLists.txt
or in their tusb_config.h
.pico_cyw43_arch
:
poll
- Not thread-safe; the user must call async_context_poll()
periodically from their main loop, but can call async_context_wait_for_work_until()
to block until work is required.threadsafe_background
- No polling is required; instead asynchronous work is performed in a low priority IRQ. Locking is provided such that IRQ/non-IRQ or multiple cores can interact safely.freertos
- Asynchronous work is performed in a separate FreeRTOS task.async_context
guarantees all callbacks happen on a single core.async_context
supports multiple instances for providing independent context which can execute concurrently with respect to each other.pico_mbedtls
library to provide MBed TLS support. You can depend on both pico_lwip_mbedtls
and pico_mbedtls
to use MBed TLS and lwIP together. See the tls_client example in pico-examples
for more details.pico_rand
generates random numbers at runtime utilizing a number of possible entropy sources, and uses those sources to modify the state of a 128-bit 'Pseudo Random Number Generator' implemented in software.get_rand_32()
, get_rand_64()
and get_rand_128()
functions to return largely unpredictable random numbers (which should be different on each board/run for example).hardware/structs/nvic.h
with a struct for the Arm Cortex M0+ NVIC available via the nvic_hw
pointer.PICO_CXX_DISABLE_ALLOCATION_OVERRIDES
which can be set to 1
if you do not want pico_standard_link
to include non-exceptional overrides of std::new
, std::new[]
, std::delete
and std::delete[]
when exceptions are disabled.elf2uf2
now correctly uses LMA
instead of VMA
of the entry point to determine binary type (flash/RAM). This is required to support some exotic binaries correctly.CMake
mechanism.elf2uf2
and pioasm
if found via an installed pico-sdk-tools
CMake
package. If it can do so, then no native compiler is required for the build!PICO_BOARD
in an existing CMake
build directory.ARCHIVE_OUTPUT_DIRECTORY
is now respected in build for UF2
output files.pico-sdk
xxx
in the pico-sdk
now support a xxx_headers
variant that just pulls in the libraries' headers. These xxx_headers
libraries correctly mirror the dependencies of the xxx
libraries, so you can use xxx_headers
instead of xxx
as your dependency if you do not want to pull in any implementation files (perhaps if you are making a STATIC
library). Actually the "all" is not quite true, non code libraries such as pico_standard_link
and pico_cxx_options
are an exception.The support is currently available as a beta. More details will be forthcoming with the actual release.
In the meantime, there are examples in pico-examples.
Key changes:
pico_btstack_ble
- Adds Bluetooth Low Energy (LE) support.pico_btstack_classic
- Adds Bluetooth Classic support.pico_btstack_sbc_encoder
- Adds Bluetooth Sub Band Coding (SBC) encoder support.pico_btstack_sbc_decoder
- Adds Bluetooth Sub Band Coding (SBC) decoder support.pico_btstack_bnep_lwip
- Adds Bluetooth Network Encapsulation Protocol (BNEP) support using LwIP.pico_btstack_bnep_lwip_sys_freertos
- Adds Bluetooth Network Encapsulation Protocol (BNEP) support using LwIP with FreeRTOS for NO_SYS=0
.pico_btstack_run_loop_async_context
- provides a common async_context
backed implementation of a BTstack "run loop" that can be used for all BTstack use with the pico-sdk
.pico_btstack_flash_bank
- provides a sample implementation for storing required Bluetooth state in flash.pico_btstack_cyw43
- integrates BTstack with the CYW43 driver.CMake
function pico_btstack_make_gatt_header
that can be used to run the BTstack compile_gatt
tool to make a GATT header file from a BTstack GATT
file.pico_cyw43_driver
and cyw43_driver
to support HCI communication for Bluetooth.cyw43_driver_picow
to support Pico W specific HCI communication for Bluetooth over SPI.cyw43_arch_init()
and cyw43_arch_deinit()
to additionally handle Bluetooth support if CYW43_ENABLE_BLUETOOTH
is 1
(as it will be automatically if you depend on pico_btstack_cyw43
).Thanks to the following for their contributions:
alastairpatrick,
Andrew Burge,
Andrew Scheller,
Attila Wagner,
bruelltuete,
Damien George,
Daniel Treffenstädt,
David Greaves,
DipSwitch,
Earle F. Philhower, III,
Engineer_Will,
envirocoder,
Flaviu Tamas,
Graham Sanderson,
James Peach,
Jan Niehusmann,
Jay Greco,
Jeremy Grosser,
Jonathan Bell,
Jonathan Reichelt Gjertsen,
KafCoppelia,
Koji KITAYAMA,
Liam Frasier,
Lord-Lucan,
Matthias Ringwald,
Mr. Green's Workshop,
Nicolas Pouillon,
Nikhil Dabas,
Patrick Plenefisch,
Pedro Tôrres,
Peter Harper,
Peter Pettersson,
Radoslav Gerganov,
ryanjsims,
Stargirl Flowers,
Thomas Roberts,
Timo Kokkonen
Published by kilograham over 2 years ago
This release adds wireless support for the Raspberry Pi Pico W, adds support for other new boards, and contains various
bug fixes, documentation improvements, and minor improvements/added functionality. You can see the full list of individual commits here.
The following boards have been added and may be specified via PICO_BOARD
:
pico_w
datanoisetv_rp2040_dsp
solderparty_rp2040_stamp_round_carrier
Support for the Raspberry Pi Pico W is now included with the SDK (PICO_BOARD=pico_w
). The Pico W uses a driver
for the wireless chip called cyw43_driver
which is included as a submodule of the SDK. You need to initialize
this submodule for Pico W wireless support to be available. Note that the LED on the Pico W board is only
accessible via the wireless chip and can be accessed via cyw43_arch_gpio_put()
and
cyw43_arch_gpio_get()
(part of the pico_cyw43_arch
library described below). As a result of the LED being on
the wireless chip, there is no PICO_DEFAULT_LED_PIN
setting and the default LED based examples in pico-examples
do not work with the Pico W.
IP support is provided by lwIP which is also included as a
submodule which you should initialize if you want to use it.
The following libraries exposing lwIP functionality are provided by the SDK:
pico_lwip_core
(included in pico_lwip
)pico_lwip_core4
(included in pico_lwip
)pico_lwip_core6
(included in pico_lwip
)pico_lwip_netif
(included in pico_lwip
)pico_lwip_sixlowpan
(included in pico_lwip
)pico_lwip_ppp
(included in pico_lwip
)pico_lwip_api
(this is a blocking API that may be used with FreeRTOS and is not included in pico_lwip
)As referenced above, the SDK provides a pico_lwip
which aggregates all of the commonly needed lwIP functionality.
You are of course free to use the substituent libraries explicitly instead.
The following libraries are provided that contain the equivalent lwIP application support:
pico_lwip_snmp
pico_lwip_http
pico_lwip_makefsdata
pico_lwip_iperf
pico_lwip_smtp
pico_lwip_sntp
pico_lwip_mdns
pico_lwip_netbios
pico_lwip_tftp
pico_lwip_mbedtls
Integration of the IP stack and the cyw43_driver
network driver into the user's code is handled by
pico_cyw43_arch
. Both the IP stack and the driver need to do work in response to network traffic, and
pico_cyw43_arch
provides a variety of strategies for servicing that work. Four architecture variants
are currently provided as libraries:
pico_cyw43_arch_lwip_poll
- For using the RAW lwIP API (NO_SYS=1
mode) with polling. With this architecturecyw43_arch_poll()
to perform background work. This architecturepico_cyw43_arch_lwip_threadsafe_background
- For using the RAW lwIP API (NO_SYS=1
mode) with multicorecyw43_driver
andpico_cyw43_arch_lwip_sys_freertos
- For using the full lwIP API including blocking sockets in OS modeNO_SYS=0
), along with multicore/task safety, and automatic servicing of the cyw43_driver
and the lwIPFREERTOS_KERNEL_PATH
in your build to use this variant.pico_cyw43_arch_none
- If you do not need the TCP/IP stack but wish to use the on-board LED or other wirelessSee the library documentation or the pico/cyw43_arch.h
header for more details.
dma_unclaim_mask()
function for un-claiming multiple DMA channels at once.channel_config_set_high_priority()
function to set the channel priority via a channel config object.Improved the documentation for the pre-existing gpio IRQ functions which use the "one callback per core" callback
mechanism,
and added a gpio_set_irq_callback()
function to explicitly set the callback independently of enabling per pin GPIO
IRQs.
Reduced the latency of calling the existing "one callback per core" GPIO IRQ callback.
Added new support for the user to add their own shared GPIO IRQ handler independent of the pre-existing
"one callback per core" callback mechanism, allowing for independent usage of GPIO IRQs without having to share one
handler.
See
the
documentation in hardware/irq.h
for full details of the functions added:
gpio_add_raw_irq_handler()
gpio_add_raw_irq_handler_masked()
gpio_add_raw_irq_handler_with_order_priority()
gpio_add_raw_irq_handler_with_order_priority_masked()
gpio_remove_raw_irq_handler()
gpio_remove_raw_irq_handler_masked()
Added a gpio_get_irq_event_mask()
utility function for use by the new "raw" IRQ handlers.
user_irq_claim()
, user_irq_unclaim()
, user_irq_claim_unused()
and user_irq_is_claimed()
stdio_usb
, the PICO_STDIO_USB_LOW_PRIORITY_IRQ
define is still respected if specified, but otherwise an unclaimed one isirq_is_shared_handler()
function to determine if a particular IRQ uses a shared handler.sem_try_acquire()
function, for non blocking acquisition of a semaphore.stderr
is now supported and goes to the same destination as stdout
.getchar_timeout_us()
are now correctly honored (previously they were a 1us minimum).tinyusb_device
yourself. If you have a CDC device in your device descriptors, you can use pico_enable_stdio_usb(TARGET 1)
in your CMakeLists.txt
PICO_DISABLE_SHARED_IRQ_HANDLERS=1
get_core_num()
has been moved to pico/platform.h
from hardware/sync.h
.realloc()
is now multicore safe too.PICO_PLL_VCO_MIN_FREQ_MHZ
back to 400
. There is also a new PICO_PLL_VCO_MAX_FREQ_MHZ
1600
.Published by kilograham over 2 years ago
This release contains numerous bug fixes and documentation improvements which are not all listed here; you can see the full list of individual commits here.
The following boards have been added and may be specified via PICO_BOARD
:
adafruit_kb2040
adafruit_macropad_rp2040
eetree_gamekit_rp2040
garatronic_pybstick26_rp2040
(renamed from pybstick26_rp2040
)pimoroni_badger2040
pimoroni_motor2040
pimoroni_servo2040
pimoroni_tiny2040_2mb
seeed_xiao_rp2040
solderparty_rp2040_stamp_carrier
solderparty_rp2040_stamp
wiznet_w5100s_evb_pico
dma_channel_abort()
function describing errata RP2040-E13, and how to work around it.pwm_config_set_clkdiv_int_frac()
method to complement pwm_config_set_clkdiv_int()
and pwm_config_set_clkdiv()
.pio_set_irqn_source_mask_enabled()
method which previously affected the wrong IRQ.rtc_set_datetime()
documentation that the new value may not be visible to a rtc_get_datetime()
very soon after, due to crossing of clock domains.busy_wait_at_least_cycles()
method as a convenience method for a short tight-loop counter-based delay.stdio_set_driver_eabled()
can now be used freely to dynamically enable and disable drivers during runtime.is_at_the_end_of_time()
method to check if a given time matches the SDK's maximum time value.__ctzdi2()
aka __builtin_ctz(uint64_t)
was fixed.PIOASM_EXTRA_SOURCE_FILES
is now actually respected.Note the 1.3.0 release of the SDK incorrectly squashed the history of the changes. A new merge commit has been added to restore the full history, and the 1.3.0 tag has been updated
Published by kilograham almost 3 years ago
This release contains numerous bug fixes and documentation improvements. Additionally, it contains the following notable changes/improvements:
lib/tinyusb
submodule has been updated from 0.10.1 to 0.12.0. See https://github.com/hathach/tinyusb/releases/tag/0.11.0 and https://github.com/hathach/tinyusb/releases/tag/0.12.0 for release notes.-Werror
. Warnings have been fixed in rp2040 specific TinyUSB code, and in TinyUSB headers, and a new cmake function suppress_tinyusb_warnings()
has been added, that you may call from your CMakeLists.txt
to suppress warnings in other TinyUSB C files.The following boards have been added and may be specified via PICO_BOARD
:
adafruit_trinkey_qt2040
melopero_shake_rp2040
pimoroni_interstate75
pimoroni_plasma2040
pybstick26_rp2040
waveshare_rp2040_lcd_0.96
waveshare_rp2040_plus_4mb
waveshare_rp2040_plus_16mb
waveshare_rp2040_zero
hardware_regs
, hardware_structs
The RP2040 SVD has been updated, fixing some register access types and adding new documentation.
The hardware_regs
headers have been updated accordingly.
The hardware_structs
headers which were previously hand coded, are now generated from the SVD, and retain select documentation from the SVD, including register descriptions and register bit-field tables.
e.g. what was once
typedef struct {
io_rw_32 ctrl;
io_ro_32 fstat;
...
becomes:
// Reference to datasheet: https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf#tab-registerlist_pio
//
// The _REG_ macro is intended to help make the register navigable in your IDE (for example, using the "Go to Definition" feature)
// _REG_(x) will link to the corresponding register in hardware/regs/pio.h.
//
// Bit-field descriptions are of the form:
// BITMASK [BITRANGE]: FIELDNAME (RESETVALUE): DESCRIPTION
typedef struct {
_REG_(PIO_CTRL_OFFSET) // PIO_CTRL
// PIO control register
// 0x00000f00 [11:8] : CLKDIV_RESTART (0): Restart a state machine's clock divider from an initial phase of 0
// 0x000000f0 [7:4] : SM_RESTART (0): Write 1 to instantly clear internal SM state which may be otherwise difficult...
// 0x0000000f [3:0] : SM_ENABLE (0): Enable/disable each of the four state machines by writing 1/0 to each of these four bits
io_rw_32 ctrl;
_REG_(PIO_FSTAT_OFFSET) // PIO_FSTAT
// FIFO status register
// 0x0f000000 [27:24] : TXEMPTY (0xf): State machine TX FIFO is empty
// 0x000f0000 [19:16] : TXFULL (0): State machine TX FIFO is full
// 0x00000f00 [11:8] : RXEMPTY (0xf): State machine RX FIFO is empty
// 0x0000000f [3:0] : RXFULL (0): State machine RX FIFO is full
io_ro_32 fstat;
...
There were some behavioral changes in this release:
SDK 1.2.0 previously added recursive mutex support using the existing (previously non-recursive) mutex_
functions. This caused a performance regression, and the only clean way to fix the problem was to return the mutex_
functions to their pre-SDK 1.2.0 behavior, and split the recursive mutex functionality out into separate recursive_mutex_
functions with a separate recursive_mutex_
type.
Code using the SDK 1.2.0 recursive mutex functionality will need to be changed to use the new type and functions, however as a convenience, the pre-processor define PICO_MUTEX_ENABLE_SDK120_COMPATIBILITY
may be set to 1 to retain the SDK 1.2.0 behavior at the cost of an additional performance penalty. The ability to use this pre-processor define will be removed in a subsequent SDK version.
pico.h
and its dependencies have been slightly refactored so it can be included by assembler code as well as C/C++ code. Thie ensures that assembler code and C/C++ code follow the same board configuration/override order and see the same configuration defines. This should not break any existing code, but is notable enough to mention.pico/platform.h
is now fully documented.-Wl,max-page-size=4096
is now passed to the linker, which is beneficial to certain users and should have no discernible impact on the rest.
xip_noalloc_alias(addr)
, xip_nocache_alias(addr)
, xip_nocache_noalloc_alias(addr)
macros for converting a flash address between XIP aliases (similar to the hw_xxx_alias(addr)
macros).dma_timer_claim()
, dma_timer_unclaim()
, dma_claim_unused_timer()
and dma_timer_is_claimed()
to manage ownership of DMA timers.dma_timer_set_fraction()
and dma_get_timer_dreq()
to facilitate pacing DMA transfers using DMA timers.i2c_get_dreq()
function to facilitate configuring DMA transfers to/from an I2C instance.irq_get_priority()
.PICO_DISABLE_SHARED_IRQ_HANDLERS=1
is specified, and allowed irq_add_shared_handler
to be used in this case (as long as there is only one handler - i.e. it behaves exactly like irq_set_exclusive_handler
),pio_encode_
functions in hardware/pico_instructions.h
are now documented.pwm_get_dreq()
function to facilitate configuring DMA transfers to a PWM slice.spi_get_dreq()
function to facilitate configuring DMA transfers to/from an SPI instance.uart_get_dreq()
function to facilitate configuring DMA transfers to/from a UART instance.watchdog_enable_caused_reboot()
to distinguish a watchdog reboot caused by a watchdog timeout after calling watchdog_enable()
from other watchdog reboots (e.g. that are performed when a UF2 is dragged onto a device in BOOTSEL mode).pico/bootrom.h
to facilitate calling bootrom functions directly.pico/multicore.h
; particularly, multicore_lockout_
functions are newly documented.PICO_RP2040
is now defined to 1 in PICO_PLATFORM=rp2040
(i.e. normal) builds.puts_raw()
and putchar_raw()
to skip CR/LF translation if enabled.stdio_usb_connected()
to detect CDC connection when using stdio_usb
.PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS
define that can be set to wait for a CDC connection to be established during initialization of stdio_usb
. Note: value -1 means indefinite. This can be used to prevent initial program output being lost, at the cost of requiring an active CDC connection.semihosting_putc
which was completely broken.pico/usb_reset_interface.h
split out from stdio_usb
to facilitate inclusion in external projects.OUTPUT_NAME
target property is now respected when generating supplemental files (.BIN
, .HEX
, .MAP
, .UF2
)*
, /
, -
, +
have been fixedPublished by kilograham over 3 years ago
This release contains numerous bug fixes and documentation improvements. Additionally it contains the following improvements/notable changes:
The lib/tinyusb
submodule has been updated from 0.8.0 and now tracks upstream https://github.com/hathach/tinyusb.git. It is worth making sure you do a
git submodule sync
git submodule update
to make sure you are correctly tracking upstream TinyUSB if you are not checking out a clean pico-sdk repository.
Note also that moving ffrom TinyUSB 0.8.0 to TinyUSB 0.10.1 may require some minor changes to your USB code.
arduino_nano_rp240_connect
, pimoroni_picolipo_4mb
and pimoroni_picolipo_16mb
#defines
for default SPI and I2C pins have been addedCMSIS core headers (e.g. core_cm0plus.h
and RP2040.h
) are made available via cmsis_core
INTERFACE library. Additionally, CMSIS standard exception naming is available via PICO_CMSIS_RENAME_EXCEPTIONS=1
recursive_mutex_init()
and auto_init_recursive_mutex()
mutex_enter_timeout_us()
critical_section_deinit()
sem_acquire_timeout_ms()
and sem_acquire_block_until()
adc_get_selected_input()
clock_get_hz()
now returns actual achieved frequency rather than desired frequencydma_channel_is_claimed()
dma_irqn_set_channel_enabled()
, dma_irqn_set_channel_mask_enabled()
, dma_irqn_get_channel_status()
, dma_irqn_acknowledge_channel()
etc.New library for setting ARM exception handlers:
exception_set_exclusive_handler()
, exception_restore_handler()
, exception_get_vtable_handler()
flash_do_cmd()
for low level flash command executiongpio_set_input_hysteresis_enabled()
, gpio_is_input_hysteresis_enabled()
, gpio_set_slew_rate()
, gpio_get_slew_rate()
, gpio_set_drive_strength()
, gpio_get_drive_strength()
. gpio_get_out_level()
, gpio_set_irqover()
interp_lane_is_claimed()
, interp_unclaim_lane_mask()
PICO_LOWEST/HIGHEST_IRQ_PRIORITY
values which were backwards!pio_set_irqn_source_enabled()
,pio_set_irqn_source_mask_enabled()
, pio_interrupt_get()
, pio_interrupt_clear()
etc.)pio_sm_is_claimed()
spi_get_baudrate()
spi_init()
to return the set/achieved baud rate rather than voidspi_is_writable()
to return bool not size_t (it was always 1/0)spin_lock_is_claimed()
busy_wait_ms()
to match busy_wait_us()
hardware_alarm_is_claimed()
PICO_INT64_OPS_IN_RAM
flag to move code into RAM to avoid veneers when calling code is in RAMPICO_PANIC_FUNCTION=foo
to the use foo
as the implementation, or settingPICO_PANIC_FUNCITON=
to simply breakpoint, saving some code spacepico_get_unique_board_id_string()
.const
to method parameters#pragma once
to C/C++ outputImprovements designed to make porting RTOSes either based on the SDK or supporting SDK code easier.
PICO_DIVIDER_DISABLE_INTERRUPTS
flag to optionally configure all uses of the hardware divider to be guarded by disabling interrupts, rather than requiring on the RTOS to save/restore the divider state on context switchpico/lock_core.h
to allow an RTOS to inject replacement code for SDK basedpico_sync
and for sleep_
methods. If an RTOS implements these few simple methods, then all SDK semaphore, mutex, queue, sleep methods can be safely used both within/to/from RTOS tasks, but also to communicate with non RTOS task aware code, whether it be existing libraries and IRQ handlers or code running perhaps (though not necessarily) on the other coreSubstantive changes have been made to the CMake build, so if you are using a hand crafted non-CMake build, you will need to update your compile/link flags. Additionally changed some possibly confusing status messages from CMake build generation to be debug only
AT25SF128A
Published by kilograham over 3 years ago
Fixes issues with boot stage 2 selection
Published by kilograham over 3 years ago
This fixes a number of bugs, and additionally adds support for a board configuration header to choose the boot_stage2
Published by kilograham over 3 years ago
New Feature Highlights
Added board headers for Adafruit, Pimoroni & SparkFun boards
adafruit_feather_rp2040
, adafruit_itsybitsy_rp2040
, adafruit_qtpy_rp2040
,pimoroni_keybow2040
, pimoroni_picosystem
, pimoroni_tiny2040
, sparkfun_micromod
,sparkfun_promicro
, sparkfun_thingplus
, in addition to the existing pico
and vgaboard
.New reset options
pico_bootsel_via_double_reset
library to allow reset to BOOTSEL mode via double press of a RESET buttonpico_stdio_usb
i.e. stdio connected via USB CDC to host, setting baud rate to 1200 (by default)pico-stdio_usb
i.e. stdio connected via USB CDC to host, an additional interface may be addedBuild improvement for non SDK or existing library builds
This release also contains many bug fixes, documentation updates and minor improvements.
Note: there are some nominally backwards incompatible changes not worthy of a major version bump:
- PICO_DEFAULT_UART_
defines now default to undefined if there is no default rather than -1 previously
- The broken multicore_sleep_core1()
API has been removed; multicore_reset_core1
is already available to put core 1 into a deep sleep.
Published by kilograham over 3 years ago
pico_get_unique_id
method to return a unique identifier for a Pico board using the identifier of the external flashcmake -G ninja .. ; ninja
)Additionally, a low level change was made to the way flash binaries start executing after boot_stage2
. This was at the request of folks implementing other language runtimes. It is not generally of concern to end users, however it did require a change to the linker scripts so if you have cloned those to make modifications then you need to port across the relevant changes. If you are porting a different language runtime using the SDK boot_stage2 implementations then you should be aware that you should now have a vector table (rather than executable code) - at 0x10000100