Skip to content

Commit 0504250

Browse files
authored
Merge branch 'raspberrypi:master' into master
2 parents c35a1e3 + b6ac07f commit 0504250

Some content is hidden

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

59 files changed

+1518
-221
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="gcc-arm-embedded" version="10.2.1" />
4-
<package id="cmake" version="3.25.2" installArguments="ADD_CMAKE_TO_PATH=System" />
4+
<package id="cmake" version="3.31.0" installArguments="ADD_CMAKE_TO_PATH=System" />
55
<package id="mingw" version="12.2.0" />
66
<package id="ninja" version="1.11.1" />
77
</packages>

.github/workflows/cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
mkdir -p "${{ github.workspace }}"
1919
2020
- name: Checkout pico-examples
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222
with:
2323
path: pico-examples
2424

2525
- name: Checkout pico-sdk/develop
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2727
with:
2828
repository: raspberrypi/pico-sdk
2929
ref: develop

.github/workflows/macOS.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: macos-12
12+
runs-on: macos-latest
1313
steps:
1414
- name: Clean workspace
1515
run: |
@@ -18,12 +18,12 @@ jobs:
1818
mkdir -p "${{ github.workspace }}"
1919
2020
- name: Checkout pico-examples
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222
with:
2323
path: pico-examples
2424

2525
- name: Checkout pico-sdk/develop
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2727
with:
2828
repository: raspberrypi/pico-sdk
2929
ref: develop

.github/workflows/multi-gcc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
mkdir -p "${{ github.workspace }}"
2020
2121
- name: Checkout pico-examples
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323
with:
2424
path: pico-examples
2525

2626
- name: Checkout pico-sdk/develop
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2828
with:
2929
repository: raspberrypi/pico-sdk
3030
ref: develop

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
rm -rf "${{ github.workspace }}/pico-sdk"
1919
rm -rf "${{ github.workspace }}/pico-examples"
2020
- name: Checkout pico-examples
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222
with:
2323
path: pico-examples
2424

2525
- name: Checkout pico-sdk/develop
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2727
with:
2828
repository: raspberrypi/pico-sdk
2929
ref: develop

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ project(pico_examples C CXX ASM)
99
set(CMAKE_C_STANDARD 11)
1010
set(CMAKE_CXX_STANDARD 17)
1111

12-
if (PICO_SDK_VERSION_STRING VERSION_LESS "2.0.0")
13-
message(FATAL_ERROR "Raspberry Pi Pico SDK version 2.0.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
12+
if (PICO_SDK_VERSION_STRING VERSION_LESS "2.1.0")
13+
message(FATAL_ERROR "Raspberry Pi Pico SDK version 2.1.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
1414
endif()
1515

1616
set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR})
@@ -59,6 +59,7 @@ endif()
5959

6060
# Hardware-specific examples in subdirectories:
6161
add_subdirectory(adc)
62+
add_subdirectory(binary_info)
6263
add_subdirectory(bootloaders)
6364
add_subdirectory(clocks)
6465
add_subdirectory(cmake)

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ App| Description
2424
---|----------------------------------------------------------------------------|---
2525
[hello_serial](hello_world/serial) | The obligatory Hello World program for Pico (Output over serial version) |
2626
[hello_usb](hello_world/usb) | The obligatory Hello World program for Pico (Output over USB version) | https://rptl.io/pico-hello-usb
27-
[blink](blink) | Blink an LED on and off. Works on both boards with regular LEDs and Pico W | https://rptl.io/pico-blink
28-
[blink_simple](blink_simple) | Blink an LED on and off. Does not work on Pico W. | https://rptl.io/pico-blink
29-
[picow_blink](pico_w/wifi/blink) | Blinks the Pico W on-board LED (which is connected via the WiFi chip). | http://rptl.io/pico-w-blink
27+
[blink](blink) | Blink a LED on and off. Works on both boards with regular LEDs and boards like Pico W where the led is connected via the Wi-Fi chip | https://rptl.io/pico-blink
28+
[blink_simple](blink_simple) | Blink a LED on and off. Does not work on boards like Pico W where the led is connected via the Wi-Fi chip. | https://rptl.io/pico-blink
29+
[picow_blink](pico_w/wifi/blink) | Blinks the on-board LED on boards like Pico W where the led is connected via the Wi-Fi chip. | http://rptl.io/pico-w-blink
3030

3131
### ADC
3232

@@ -40,6 +40,13 @@ App|Description
4040
[dma_capture](adc/dma_capture) | Use the DMA to capture many samples from the ADC.
4141
[read_vsys](adc/read_vsys) | Demonstrates how to read VSYS to get the voltage of the power supply.
4242

43+
### Binary Info
44+
45+
App|Description
46+
---|---
47+
[blink_any](binary_info/blink_any) | Uses `bi_ptr` variables to create a configurable blink binary - see the separate [README](binary_info/README.md) for more details
48+
[hello_anything](binary_info/hello_anything) | Uses `bi_ptr` variables to create a configurable hello_world binary - see the separate [README](binary_info/README.md) for more details
49+
4350
### Bootloaders (RP2350 Only)
4451
App|Description
4552
---|---
@@ -133,6 +140,7 @@ App|Description
133140
[pcf8523_i2c](i2c/pcf8523_i2c) | Read time and date values from a real time clock. Set current time and alarms on it.
134141
[ht16k33_i2c](i2c/ht16k33_i2c) | Drive a 4 digit 14 segment LED with an HT16K33.
135142
[slave_mem_i2c](i2c/slave_mem_i2c) | i2c slave example where the slave implements a 256 byte memory
143+
[slave_mem_i2c_burst](i2c/slave_mem_i2c) | i2c slave example where the slave implements a 256 byte memory. This version inefficiently writes each byte in a separate call to demonstrate read and write burst mode.
136144

137145
### Interpolator
138146

@@ -162,15 +170,16 @@ App|Description
162170
[blinky](picoboard/blinky) | Blink "hello, world" in Morse code on Pico's LED
163171
[button](picoboard/button) | Use Pico's BOOTSEL button as a regular button input, by temporarily suspending flash access.
164172

165-
### Pico W Networking
173+
### Pico Networking
166174

167-
These examples are for the Pico W, and are only available for `PICO_BOARD=pico_w`
175+
These networking examples are only available if Wi-Fi is supported by the board.
168176

169177
App|Description
170178
---|---
171179
[picow_access_point](pico_w/wifi/access_point) | Starts a WiFi access point, and fields DHCP requests.
172180
[picow_blink](pico_w/wifi/blink) | Blinks the on-board LED (which is connected via the WiFi chip).
173-
[picow_blink_slow_clock](pico_w/wifi/blink_slow_clock) | Blinks the on-board LED (which is connected via the WiFi chip) with a slower system clock to show how to reconfigure communication with the WiFi chip under those circumstances
181+
[picow_blink_slow_clock](pico_w/wifi/blink) | Blinks the on-board LED (which is connected via the WiFi chip) with a slower system clock to show how to reconfigure communication with the WiFi chip at run time under those circumstances
182+
[picow_blink_fast_clock](pico_w/wifi/blink) | Blinks the on-board LED (which is connected via the WiFi chip) with a faster system clock to show how to reconfigure communication with the WiFi chip at build time under those circumstances
174183
[picow_iperf_server](pico_w/wifi/iperf) | Runs an "iperf" server for WiFi speed testing.
175184
[picow_ntp_client](pico_w/wifi/ntp_client) | Connects to an NTP server to fetch and display the current time.
176185
[picow_tcp_client](pico_w/wifi/tcp_client) | A simple TCP client. You can run [python_test_tcp_server.py](pico_w/wifi/python_test_tcp/python_test_tcp_server.py) for it to connect to.
@@ -180,10 +189,12 @@ App|Description
180189
[picow_wifi_scan](pico_w/wifi/wifi_scan) | Scans for WiFi networks and prints the results.
181190
[picow_udp_beacon](pico_w/wifi/udp_beacon) | A simple UDP transmitter.
182191
[picow_httpd](pico_w/wifi/httpd) | Runs a LWIP HTTP server test app
192+
[picow_http_client](pico_w/wifi/http_client) | Demonstrates how to make http and https requests
193+
[picow_http_client_verify](pico_w/wifi/http_client) | Demonstrates how to make a https request with server authentication
183194

184195
#### FreeRTOS examples
185196

186-
These are examples of integrating Pico W networking under FreeRTOS, and require you to set the `FREERTOS_KERNEL_PATH`
197+
These are examples of integrating Wi-Fi networking under FreeRTOS, and require you to set the `FREERTOS_KERNEL_PATH`
187198
to point to the FreeRTOS Kernel. See https://github.com/FreeRTOS/FreeRTOS-Kernel
188199

189200
App|Description
@@ -195,10 +206,11 @@ App|Description
195206
[picow_freertos_ntp_client_socket](pico_w/wifi/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.
196207
[pico_freertos_httpd_nosys](pico_w/wifi/freertos/httpd) | Runs a LWIP HTTP server test app under FreeRTOS in NO_SYS=1 mode.
197208
[pico_freertos_httpd_sys](pico_w/wifi/freertos/httpd) | Runs a LWIP HTTP server test app under FreeRTOS in NO_SYS=0 (i.e. full FreeRTOS integration) mode.
209+
[picow_freertos_http_client_sys](pico_w/wifi/freertos/http_client) | Demonstrates how to make a https request in NO_SYS=0 (i.e. full FreeRTOS integration)
198210

199-
### Pico W Bluetooth
211+
### Pico Bluetooth
200212

201-
These examples are for the Pico W, and are only available for `PICO_BOARD=pico_w`.
213+
These Bluetooth examples are only available for boards that support Bluetooth.
202214
They are examples from the Blue Kitchen Bluetooth stack, see [here](https://bluekitchen-gmbh.com/btstack/#examples/examples/index.html) for a full description.
203215

204216
By default, the Bluetooth examples are only built in one "mode" only (*background*, *poll*, or *freertos*), with the

adc/read_vsys/power_status.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* \brief Get power source
1212
*
1313
* Returns whether battery powered
14-
* \note On Pico W must have called cyw43_arch_init
14+
* \note On boards that support Wi-Fi you must have called cyw43_arch_init first
1515
*
1616
* \param battery_powered True if powered by battery, False if powered by USB or another means
1717
* \return Zero if the battery status can be determined, an error code otherwise \see pico_error_codes

binary_info/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
add_subdirectory_exclude_platforms(blink_any host)
2+
add_subdirectory_exclude_platforms(hello_anything host)

binary_info/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
These programs demonstrate use of `bi_ptr` variables, which can be configured in a binary post-compilation using the `picotool config` command.
2+
3+
You can view the configurable variables with
4+
```
5+
$ picotool blink_any.uf2
6+
File blink_any.uf2:
7+
8+
LED Configuration:
9+
LED_PIN = 25
10+
LED_TYPE = 0
11+
12+
$ picotool config hello_anything.uf2
13+
File hello_anything.uf2:
14+
15+
text = "Hello, world!"
16+
Enabled Interfaces:
17+
use_usb = 1
18+
use_uart = 1
19+
UART Configuration:
20+
uart_baud = 115200
21+
uart_rx = 1
22+
uart_tx = 0
23+
uart_num = 0
24+
```
25+
26+
For example, to blink the LED on pin 7 instead of 25 use
27+
```
28+
$ picotool config blink_any.uf2 -s LED_PIN 7
29+
File blink_any.uf2:
30+
31+
LED_PIN = 25
32+
setting LED_PIN -> 7
33+
```
34+
35+
Or to change the printed string use
36+
```
37+
$ picotool config hello_anything.uf2 -s text "Goodbye, world!"
38+
File hello_anything.uf2:
39+
40+
text = "Hello, world!"
41+
setting text -> "Goodbye, world!"
42+
```
43+
44+
The binaries can also be configured after being loaded onto the device with
45+
```
46+
$ picotool config
47+
text = "Hello, world!"
48+
Enabled Interfaces:
49+
use_usb = 1
50+
use_uart = 1
51+
UART Configuration:
52+
uart_baud = 115200
53+
uart_rx = 1
54+
uart_tx = 0
55+
uart_num = 0
56+
57+
$ picotool config -s use_uart 0
58+
use_uart = 1
59+
setting use_uart -> 0
60+
```

0 commit comments

Comments
 (0)