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 defining
USBD_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 a
state where it is safe to write to flash (the default implementation disables interrupts on the current core, and if
necessary, makes sure the other core is running from RAM, and has interrupts disabled).flash_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
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
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 architecture
the user code must periodically poll via cyw43_arch_poll()
to perform background work. This architecture
matches the common use of lwIP on microcontrollers, and provides no multicore safetypico_cyw43_arch_lwip_threadsafe_background
- For using the RAW lwIP API (NO_SYS=1
mode) with multicore
safety, and automatic servicing of the cyw43_driver
and
lwIP in the background. User polling is not required with this architecture, but care should be taken as lwIP
callbacks happen in an IRQ context.pico_cyw43_arch_lwip_sys_freertos
- For using the full lwIP API including blocking sockets in OS mode
(NO_SYS=0
), along with multicore/task safety, and automatic servicing of the cyw43_driver
and the lwIP
stack in a separate task. This powerful architecture works with both SMP and non-SMP variants of the RP2040 port
of FreeRTOS-Kernel. Note you must set FREERTOS_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 wireless
chip connected GPIOs.See 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()
functions for claiming ownership of the user IRQs (the ones numbered 26-31 and not connected to any hardware).
Uses of the user IRQs have been updated to use these functions. For stdio_usb
, the PICO_STDIO_USB_LOW_PRIORITY_IRQ
define is still respected if specified, but otherwise an unclaimed one is
chosen.irq_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
which defaults to 1600
.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
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 fixedThis 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 setting
PICO_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 based
low level wait, notify and sleep/timeouts used by synchonization primitives in pico_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
Fixes issues with boot stage 2 selection
This fixes a number of bugs, and additionally adds support for a board configuration header to choose the boot_stage2
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)
can optionally be used to reset into BOOTSEL mode.pico-stdio_usb
i.e. stdio connected via USB CDC to host, an additional interface may be added
to give picotool control over resetting the device.Build 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.
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