Skip to content

Commit 2063a2d

Browse files
Enable OTA support for RP2350 (#2472)
The RP2350 has a different blob header requirement to identify a working image. Ensure that header is present in the OTA loader. Update the PicoOTA examples for the 2350
1 parent 4504d72 commit 2063a2d

File tree

12 files changed

+9752
-57
lines changed

12 files changed

+9752
-57
lines changed

docs/ota.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
OTA Updates
22
===========
33

4-
**NOTE:** OTA is not yet supported on the RP2350. PRs gladly accepted!
5-
64
Introduction
75
------------
86

docs/rp2350.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ is supported by the core with some minor caveats:
77
* PSRAM is supported via a new ``pmalloc`` call and ``PSRAM`` variable decorator.
88
* Both RP2350A and RP2350B (48 GPIOs) are supported.
99
* Only ARM mode is available. For RISC-V (Hazard3), please use the raw SDK.
10-
* OTA is not yet supported.
1110

1211
P2350-E9 Errata ("Increased leakage current on Bank 0 GPIO when pad input is enabled")
1312
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/rp2350/memmap_default.ld

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
__stack (== StackTop)
2222
*/
2323

24+
25+
26+
2427
MEMORY
2528
{
2629
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = __FLASH_LENGTH__
@@ -42,6 +45,20 @@ SECTIONS
4245
__flash_binary_start = .;
4346
} > FLASH
4447

48+
.ota : {
49+
/* Start image with OTA */
50+
KEEP (*(.OTA))
51+
*ota.o
52+
} > FLASH
53+
54+
.partition : {
55+
. = __flash_binary_start + 0x2ff0;
56+
LONG(__FS_START__)
57+
LONG(__FS_END__)
58+
LONG(__EEPROM_START__)
59+
LONG(__FLASH_LENGTH__)
60+
} > FLASH
61+
4562
/* The bootrom will enter the image at the point indicated in your
4663
IMAGE_DEF, which is usually the reset handler of your vector table.
4764

@@ -53,8 +70,8 @@ SECTIONS
5370
*/
5471

5572
.text : {
56-
__logical_binary_start = .;
5773
KEEP (*(.vectors))
74+
__logical_binary_start = .;
5875
KEEP (*(.binary_info_header))
5976
__binary_info_header_end = .;
6077
KEEP (*(.embedded_block))
@@ -276,7 +293,7 @@ SECTIONS
276293
.flash_end : {
277294
KEEP(*(.embedded_end_block*))
278295
PROVIDE(__flash_binary_end = .);
279-
} > FLASH =0xaa
296+
} > FLASH = 0xaa
280297

281298
.psram (NOLOAD) : {
282299
__psram_start__ = .;

lib/rp2350/ota.o

40 Bytes
Binary file not shown.

libraries/PicoOTA/examples/OTAfromFile-Compressed/OTAfromFile-Compressed.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
#include <PicoOTA.h>
1414
#include <LittleFS.h>
15-
#include "blink_100_1000.h"
15+
#include "blink_100_1000_rp2040.h"
16+
#include "blink_500_500_rp2350.h"
1617

1718
void setup() {
1819
Serial.begin(115200);

libraries/PicoOTA/examples/OTAfromFile-Compressed/blink_100_1000.h renamed to libraries/PicoOTA/examples/OTAfromFile-Compressed/blink_100_1000_rp2040.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#ifdef PICO_RP2040
12
const unsigned char blink_gz[] = {
23
0x1f, 0x8b, 0x08, 0x08, 0x86, 0x7e, 0xf3, 0x62, 0x02, 0x03, 0x73, 0x6b,
34
0x65, 0x74, 0x63, 0x68, 0x5f, 0x61, 0x75, 0x67, 0x31, 0x30, 0x61, 0x2e,
@@ -3896,3 +3897,4 @@ const unsigned char blink_gz[] = {
38963897
0x03, 0xeb, 0x79, 0x7c, 0xf6, 0x3f, 0x01, 0xa8, 0x7b, 0x69, 0xf7, 0x10,
38973898
0x11, 0x01, 0x00
38983899
};
3900+
#endif

libraries/PicoOTA/examples/OTAfromFile-Compressed/blink_500_500_rp2350.h

Lines changed: 3931 additions & 0 deletions
Large diffs are not rendered by default.

libraries/PicoOTA/examples/OTAfromFile/OTAfromFile.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#include <PicoOTA.h>
1111
#include <LittleFS.h>
12-
#include "blink_100_1000.h"
12+
#include "blink_100_1000_rp2040.h"
13+
#include "blink_500_500_rp2350.h"
1314

1415
void setup() {
1516
Serial.begin(115200);

libraries/PicoOTA/examples/OTAfromFile/blink_100_1000.h renamed to libraries/PicoOTA/examples/OTAfromFile/blink_100_1000_rp2040.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#ifdef PICO_RP2040
12
const unsigned char blink[] = {
23
0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21,
34
0x88, 0x43, 0x98, 0x60, 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b,
@@ -5826,3 +5827,4 @@ const unsigned char blink[] = {
58265827
0xc1, 0x45, 0x00, 0x10, 0x9d, 0x48, 0x00, 0x10, 0xad, 0x4b, 0x00, 0x10,
58275828
0xed, 0x63, 0x00, 0x10
58285829
};
5830+
#endif

libraries/PicoOTA/examples/OTAfromFile/blink_500_500_rp2350.h

Lines changed: 5684 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)