You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example requires a partition table in flash. This can be loaded by creating a UF2 from the partition table JSON in this folder:
1
+
# Overview
2
+
3
+
This example uses a python script running on a host machine to _push_ new operating software image to a specified Pico 2 W running this `ota_update` example image. The incoming image is programmed into Pico 2 W flash memory.
4
+
5
+
On successful completion of the flash programming, the Pico 2 W will be rebooted and the updated operating image will be selected and executed by the RP2350 bootrom. This process can be repeated as required.
6
+
7
+
## More detail
8
+
9
+
The Pico 2 W operates as a server which listens on TCP port 4242. The incoming octet stream, pushed by the host, is expected to be a sequence of UF2 blocks which are programmed into Pico 2 W flash using the APIs provided by the RP2350 bootrom. In addition to programming, the received data is 'hashed' using the RP2350 SHA256 hardware, and the hash sent back to host to allow integrity checking.
10
+
11
+
The flash must be appropriately partitioned for this example to work; most obviously *two*` IMAGE_DEF` partitions are required, one for the running software and the other which is updated by the example software.
12
+
13
+
Note: This example _also_ demonstrates storage of the CYW43 Wi-fi firmware object using additional flash partition(s) although this firmware is not updated by this example.
14
+
15
+
For more information flash partitioning and boot image selection please see section 5 of [RP2350 datasheet](https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf)
16
+
17
+
## How to
18
+
19
+
### Flash partitioning
20
+
21
+
Before the example can be run, the Flash on the Pico 2 W must be appropriately partitioned.
22
+
23
+
Flash partitioning only needs doing only once for this example but, as written below, will completely remove any previous flash contents.
24
+
25
+
The required partition data can be loaded by creating a UF2 from the partition table JSON in this folder:
26
+
2
27
```
3
28
picotool partition create main.json pt.uf2
4
29
```
@@ -8,13 +33,19 @@ picotool load pt.uf2
8
33
picotool reboot -u
9
34
```
10
35
11
-
Once the partition table is loaded, you first need to load the Wi-Fi firmware UF2 (`picow_ota_update_wifi_firmware.uf2`) followed by loading & executing the main program (`picow_ota_update.uf2`) - either by dragging and dropping them in order, or using `picotool`:
36
+
Once the partition table is loaded, you first need to load the Wi-Fi firmware UF2 (`picow_ota_update_wifi_firmware.uf2`) followed by loading and executing the main program (`picow_ota_update.uf2`) - either by dragging and dropping them in order, or using `picotool`:
12
37
```
13
38
picotool load picow_ota_update_wifi_firmware.uf2
14
39
picotool load -x picow_ota_update.uf2
15
40
```
16
41
17
-
Once running, you can use [python_ota_update.py](python_ota_update.py) to upload new UF2s to it using it's IP address:
42
+
### Operation
43
+
44
+
Once running, you can use [python_ota_update.py](python_ota_update.py) to upload new UF2s from the host to it using it's IP address. For example:
0 commit comments