Skip to content

Commit 0a7c3ca

Browse files
authored
Merge branch 'master' into patch-3
2 parents 1f4ccd0 + b6ac07f commit 0a7c3ca

File tree

67 files changed

+1560
-236
lines changed

Some content is hidden

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

67 files changed

+1560
-236
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: 3 additions & 4 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
@@ -39,8 +39,7 @@ jobs:
3939

4040
- name: Build Project
4141
working-directory: ${{github.workspace}}/pico-examples
42-
# bash required otherwise this mysteriously (no error) fails at "Generating cyw43_bus_pio_spi.pio.h"
43-
shell: bash
42+
shell: pwsh
4443
run: |
4544
mkdir build
4645
cd build

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: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ App| Description
1919
---|----------------------------------------------------------------------------|---
2020
[hello_serial](hello_world/serial) | The obligatory Hello World program for Pico (Output over serial version) |
2121
[hello_usb](hello_world/usb) | The obligatory Hello World program for Pico (Output over USB version) | https://rptl.io/pico-hello-usb
22-
[blink](blink) | Blink an LED on and off. Works on both boards with regular LEDs and Pico W | https://rptl.io/pico-blink
23-
[blink_simple](blink_simple) | Blink an LED on and off. Does not work on Pico W. | https://rptl.io/pico-blink
24-
[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
22+
[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
23+
[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
24+
[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
2525

2626
### ADC
2727

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

38+
### Binary Info
39+
40+
App|Description
41+
---|---
42+
[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
43+
[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
44+
3845
### Bootloaders (RP235x Only)
3946
App|Description
4047
---|---
@@ -128,6 +135,7 @@ App|Description
128135
[pcf8523_i2c](i2c/pcf8523_i2c) | Read time and date values from a real time clock. Set current time and alarms on it.
129136
[ht16k33_i2c](i2c/ht16k33_i2c) | Drive a 4 digit 14 segment LED with an HT16K33.
130137
[slave_mem_i2c](i2c/slave_mem_i2c) | i2c slave example where the slave implements a 256 byte memory
138+
[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.
131139

132140
### Interpolator
133141

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

160-
### Pico W Networking
168+
### Pico Networking
161169

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

164172
App|Description
165173
---|---
166174
[picow_access_point](pico_w/wifi/access_point) | Starts a WiFi access point, and fields DHCP requests.
167175
[picow_blink](pico_w/wifi/blink) | Blinks the on-board LED (which is connected via the WiFi chip).
168-
[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
176+
[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
177+
[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
169178
[picow_iperf_server](pico_w/wifi/iperf) | Runs an "iperf" server for WiFi speed testing.
170179
[picow_ntp_client](pico_w/wifi/ntp_client) | Connects to an NTP server to fetch and display the current time.
171180
[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.
@@ -175,10 +184,12 @@ App|Description
175184
[picow_wifi_scan](pico_w/wifi/wifi_scan) | Scans for WiFi networks and prints the results.
176185
[picow_udp_beacon](pico_w/wifi/udp_beacon) | A simple UDP transmitter.
177186
[picow_httpd](pico_w/wifi/httpd) | Runs a LWIP HTTP server test app
187+
[picow_http_client](pico_w/wifi/http_client) | Demonstrates how to make http and https requests
188+
[picow_http_client_verify](pico_w/wifi/http_client) | Demonstrates how to make a https request with server authentication
178189

179190
#### FreeRTOS examples
180191

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

184195
App|Description
@@ -190,10 +201,11 @@ App|Description
190201
[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.
191202
[pico_freertos_httpd_nosys](pico_w/wifi/freertos/httpd) | Runs a LWIP HTTP server test app under FreeRTOS in NO_SYS=1 mode.
192203
[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.
204+
[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)
193205

194-
### Pico W Bluetooth
206+
### Pico Bluetooth
195207

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

199211
By default, the Bluetooth examples are only built in one "mode" only (*background*, *poll*, or *freertos*), with the
@@ -363,8 +375,9 @@ These require you to set `PICO_ARM_TOOLCHAIN_PATH` and `PICO_RISCV_TOOLCHAIN_PAT
363375

364376
App|Description
365377
---|---
378+
[blink](universal/CMakeLists.txt#L126) | Same as the [blink](blink) example, but universal.
366379
[hello_universal](universal/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.
367-
[nuke_universal](universal/CMakeLists.txt#L107) | Same as the [nuke](flash/nuke) binary, but universal. On RP2350 runs as a packaged SRAM binary, so is written to flash and copied to SRAM by the bootloader
380+
[nuke_universal](universal/CMakeLists.txt#L132) | Same as the [nuke](flash/nuke) example, but universal. On RP2350 runs as a packaged SRAM binary, so is written to flash and copied to SRAM by the bootloader
368381

369382
### USB Device
370383

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)