SDK 1.5.0
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.
New Board Support
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
Library Changes/Improvements
hardware_clocks
clock_gpio_init()
now takes afloat
for the clock divider value, rather than anint
.- Added
clock_gpio_init_int_frac()
function to allow initialization of integer and fractional part of the clock divider value, without usingfloat
. - Added
--ref-min
option tovcocalc.py
to override the minimum reference frequency allowed. vcocalc.py
now additionally considers reference frequency dividers greater than 1.
hardware_divider
- Improved the performance of
hw_divider_
functions.
hardware_dma
- Added
dma_sniffer_set_output_invert_enabled()
anddma_sniffer_set_output_reverse_enabled()
functions to configure the DMA sniffer. - Added
dma_sniffer_set_data_accumulator()
anddma_sniffer_get_data_accumulator()
functions to access the DMA sniffer accumulator.
hardware_i2c
- Added
i2c_get_instance()
function for consistency with otherhardware_
libraries. - Added
i2c_read_byte_raw()
,i2c_write_byte_raw()
functions to directly read and write the I2C data register for an I2C instance.
hardware_timer
- Added
hardware_alarm_claim_unused()
function to claim an unused hardware timer.
pico_cyw43_arch
- Added
cyw43_arch_wifi_connect_bssid_
variants ofcyw43_arch_wifi_connect_
functions to allow connection to a specific access point. - Blocking
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
, orPICO_ERROR_XXX
).- The
pico_cyw43_arch
library has been completely rewritten on top of the newpico_async_context
library that generically abstracts the different types of asynchronous operation (poll
,threadsafe_background
andfreertos
) previously handled in a bespoke fashion bypico_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()
andcyw43_arch_deinit()
functions are now very thin layers which handleasync_context
life-cycles, along with adding support for thecyw43_driver
, lwIP, BTstack etc. to thatasync_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.- Added
cyw43_arch_set_async_context()
function to specify a customasync_context
prior to callingcyw43_arch_init*()
- Added
cyw43_arch_async_context()
function to get theasync_context
used by the CYW43 architecture support. - Added
cyw43_arch_init_default_async_context()
function to return theasync_context
thatcyw43_arch_init*()
would initialize if one has not been set by the user. - Added
cyw43_arch_wait_for_work_until()
function to block until there is networking work to be done. This is most useful forpoll
style applications that have no other work to do and wish to sleep untilcyw43_arch_poll()
needs to be called again.
pico_cyw43_driver
- The functionality has been clarified into 3 separate libraries:
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 thepico-sdk
viaasync_context
- Added
CYW43_WIFI_NVRAM_INCLUDE_FILE
define to allow user to override the NVRAM file.
pico_divider
- Improved the performance of 64-bit divider functions.
pico_platform
- Add
panic_compact()
function that discards the message to save space in non-debug (NEBUG
defined) builds.
pico_runtime
- Added proper implementation of certain missing
newlib
system APIs:_gettimeofday()
,_times()
,_isatty()
,_getpid()
. - The above changes enable certain additional C/C++ library functionality such as
gettimeofday()
,times()
andstd::chrono
. - Added
settimeofday()
implementation such thatgettimeofday()
can be meaningfully used. - Added default (return
-1
) implementations of the remainingnewlib
system APIs:_open()
,_close()
,_lseek()
,_fstat()
,_isatty()
,_kill()
, to prevent warnings on GCC 12. - Made all
newlib
system API implementations weak so the user can override them.
pico_stdio
pico_stdio
allows for outputting from within an IRQ handler that creates the potential for deadlocks (especially withpico_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 definePICO_STDIO_DEADLOCK_TIMEOUT_MS
has been added to catch remaining cases that might be caused by user level locking.- Added
stdio_set_chars_available_callback()
function to set a callback to be called when input is available. See also the newPICO_STDIO_USB_SUPPORT_CHARS_AVAILABLE_CALLBACK
andPICO_STDIO_UART_SUPPORT_CHARS_AVAILABLE_CALLBACK
defines which both default to1
and control the availability of this new feature for USB and UART stdio respectively (at the cost of a little more code). - Improved performance of
stdio_semihosting
. - Give the user more control over the USB descriptors of
stdio_usb
viaUSBD_VID
,USBD_PID
,USBD_PRODUCT
,PICO_STDIO_USB_CONNECTION_WITHOUT_DTR
andPICO_STDIO_USB_DEVICE_SELF_POWERED
pico_sync
- Added
critical_section_is_initialized()
function to test if a critical section has been initialized. - Added
mutex_try_enter_block_until()
function to wait only up to a certain time to acquire a mutex.
pico_time
- Added
from_us_since_boot()
function to convert auint64_t
timestamp to anabsolute_time_t
. - Added
absolute_time_min()
function to return the earlier of twoabsolute_time_t
values. - Added
alarm_pool_create_with_unused_hardware_alarm()
function to create an alarm pool using a hardware alarm number claimed usinghardware_alarm_claim()
. - Added
alarm_pool_core_num()
function to determine what core an alarm pool runs on. - Added
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 thefire_if_past
parameters to existing functions, and avoids some callbacks happening from non IRQ context.
pico_lwip
- Added
pico_lwip_mqtt
library to expose the MQTT app functionality in lwIP. - Added
pico_lwip_mdns
library to expose the MDNS app functionality in lwIP. - Added
pico_lwip_freertos
library forNO_SYS=0
with FreeRTOS as a complement topico_lwip_nosys
forNO_SYS=1
.
TinyUSB
- TinyUSB has upgraded from 0.12.0 to 0.15.0. See TinyUSB release notes here for details.
- Particularly host support should be massively improved.
- Defaulted new TinyUSB
dcd_rp2040
driver'sTUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX
variable to1
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 ofTUD_OPT_RP2040_USB_DEVICE_UFRAME_FIX
to0
either viatarget_compile_definitions
in theirCMakeLists.txt
or in theirtusb_config.h
.
New Libraries
pico_async_context
- Provides support for asynchronous events (timers/IRQ notifications) to be handled in a safe context without concurrent execution (as required by many asynchronous 3rd party libraries).
- Provides implementations matching those previously implemented in
pico_cyw43_arch
:poll
- Not thread-safe; the user must callasync_context_poll()
periodically from their main loop, but can callasync_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_i2c_slave
- A (slightly modified) pico_i2c_slave library from https://github.com/vmilea/pico_i2c_slave
- Adds a callback style event API for handling I2C slave requests.
pico_mbedtls
- Added
pico_mbedtls
library to provide MBed TLS support. You can depend on bothpico_lwip_mbedtls
andpico_mbedtls
to use MBed TLS and lwIP together. See the tls_client example inpico-examples
for more details.
pico_rand
- Implements a new Random Number Generator API.
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.- Adds
get_rand_32()
,get_rand_64()
andget_rand_128()
functions to return largely unpredictable random numbers (which should be different on each board/run for example).
Miscellaneous
- Added a new header
hardware/structs/nvic.h
with a struct for the Arm Cortex M0+ NVIC available via thenvic_hw
pointer. - Added new
PICO_CXX_DISABLE_ALLOCATION_OVERRIDES
which can be set to1
if you do not wantpico_standard_link
to include non-exceptional overrides ofstd::new
,std::new[]
,std::delete
andstd::delete[]
when exceptions are disabled. elf2uf2
now correctly usesLMA
instead ofVMA
of the entry point to determine binary type (flash/RAM). This is required to support some exotic binaries correctly.
Build
- The build will now check for a functional compiler via the standard
CMake
mechanism. - The build will pick up pre-installed
elf2uf2
andpioasm
if found via an installedpico-sdk-tools
CMake
package. If it can do so, then no native compiler is required for the build! - It is now possible to switch the board type
PICO_BOARD
in an existingCMake
build directory. ARCHIVE_OUTPUT_DIRECTORY
is now respected in build forUF2
output files.- Spaces are now supported in the path to the
pico-sdk
- All libraries
xxx
in thepico-sdk
now support axxx_headers
variant that just pulls in the libraries' headers. Thesexxx_headers
libraries correctly mirror the dependencies of thexxx
libraries, so you can usexxx_headers
instead ofxxx
as your dependency if you do not want to pull in any implementation files (perhaps if you are making aSTATIC
library). Actually the "all" is not quite true, non code libraries such aspico_standard_link
andpico_cxx_options
are an exception.
Bluetooth Support for Pico W (BETA)
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:
- The Bluetooth API is provided by BTstack.
- The following new libraries are provided that expose core BTstack functionality:
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 forNO_SYS=0
.
- The following integration libraries are also provided:
pico_btstack_run_loop_async_context
- provides a commonasync_context
backed implementation of a BTstack "run loop" that can be used for all BTstack use with thepico-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.
- Added
CMake
functionpico_btstack_make_gatt_header
that can be used to run the BTstackcompile_gatt
tool to make a GATT header file from a BTstackGATT
file. - Updated
pico_cyw43_driver
andcyw43_driver
to support HCI communication for Bluetooth. - Updated
cyw43_driver_picow
to support Pico W specific HCI communication for Bluetooth over SPI. - Updated
cyw43_arch_init()
andcyw43_arch_deinit()
to additionally handle Bluetooth support ifCYW43_ENABLE_BLUETOOTH
is1
(as it will be automatically if you depend onpico_btstack_cyw43
).
Authors
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