Skip to content

Commit ca86e47

Browse files
committed
Update the Zumo and 3pi+ example code.
1 parent ce11c8a commit ca86e47

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

default.nix

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ let
22

33
# This date is used to identify releases. It gets baked into the filenames,
44
# file system timestamps, and `sys.version` in Python.
5-
date = "2026-01-27";
5+
date = "2026-02-10";
66

77
short_date = (builtins.substring 2 2 date) +
88
(builtins.substring 5 2 date) + (builtins.substring 8 2 date);
@@ -33,9 +33,12 @@ let
3333
};
3434

3535
patches = [
36+
# Expose traceback info for exceptions, making better error messages possible.
37+
# https://github.com/micropython/micropython/pull/11244
3638
./mpy-traceback.patch
3739

3840
# ports/rp2/clocks_extra: Set VREG like the SDK: needed for 200 MHz.
41+
# https://github.com/micropython/micropython/pull/18739
3942
./mpy-vreg.patch
4043

4144
# Change the Pico firmware to use a 1MB USB Mass Storage filesystem.
@@ -100,7 +103,7 @@ in rec {
100103
board_name = "Raspberry Pi Pico";
101104
file_name = "pico";
102105
MICROPY_BOARD = "RPI_PICO";
103-
image_size_mb = "2";
106+
image_size_mb = 2;
104107
start_url = "https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html";
105108
example_code = pkgs.fetchFromGitHub rec {
106109
owner = "pololu";
@@ -115,27 +118,29 @@ in rec {
115118
board_name = "Pololu 3pi+ 2040 Robot";
116119
file_name = "pololu-3pi-2040-robot";
117120
MICROPY_BOARD = "POLOLU_3PI_2040_ROBOT";
118-
image_size_mb = "16";
121+
image_size_mb = 16;
119122
start_url = "https://www.pololu.com/3pi/start";
120123
example_code = pkgs.fetchFromGitHub rec {
121124
owner = "pololu";
122125
repo = "pololu-3pi-2040-robot";
123-
rev = "6ddb719da080c21d9d1fb03e9f92007a12848f24"; # 2024-01-16
124-
hash = "sha256-KcT2ChRHVFUHAa1h+B75kmP1wDPcyP1cxVF3IsEllxU=";
126+
rev = "3eaee7e247a2acf4d2875c766ccaec36881e3ac0"; # 2026-02-09
127+
name = "${repo}-${rev}";
128+
hash = "sha256-Q63pdnYCjtHLaY0Z33+w0K+INq7i9IVQFTVny0TewSs=";
125129
};
126130
};
127131

128132
pololu-zumo-2040-robot = board {
129133
board_name = "Pololu Zumo 2040 Robot";
130134
file_name = "pololu-zumo-2040-robot";
131135
MICROPY_BOARD = "POLOLU_ZUMO_2040_ROBOT";
132-
image_size_mb = "16";
136+
image_size_mb = 16;
133137
start_url = "https://www.pololu.com/zumo/start";
134138
example_code = pkgs.fetchFromGitHub rec {
135139
owner = "pololu";
136140
repo = "zumo-2040-robot";
137-
rev = "7bf996d4aa4180349538ab3c64980621930f6623"; # 2024-01-16
138-
hash = "sha256-V+vFeZ82soP77lXwHTVZks7a2DvdbjIJckPnrViBgCE=";
141+
rev = "a530761b51241c4bd23a95b4065b5d113c7f6a23"; # 2026-02-10
142+
name = "${repo}-${rev}";
143+
hash = "sha256-Dfe9zugGT43uN+gx3hXQaa2l/TR+S/YAaiDrdFpQOWA=";
139144
};
140145
};
141146

mpy-vreg.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
From 7bdb2682794378cace9fe126d3145038fe681eb7 Mon Sep 17 00:00:00 2001
1+
From caa5430c35ec318ee4c1af1fa2225a40bfa1da8e Mon Sep 17 00:00:00 2001
22
From: "David (Pololu)" <dev-david@pololu.com>
33
Date: Tue, 27 Jan 2026 10:56:36 -0800
4-
Subject: [PATCH] ports/rp2/clocks_extra: Set VREG like the SDK: needed for 200
4+
Subject: [PATCH] rp2/clocks_extra: Set VREG like the SDK does: needed for 200
55
MHz.
66

77
The RP2040 now supports running at 200 MHz, but the datasheet says
88
that speed requires an elevated core supply of 1.15 V. The SDK
99
implements that in runtime_clocks_init, but we do not call that
10-
function becausde we override it in clocks_extra.c.
10+
function because we override it in clocks_extra.c.
1111

1212
Signed-off-by: David (Pololu) <dev-david@pololu.com>
1313
---
1414
ports/rp2/clocks_extra.c | 8 ++++++++
1515
1 file changed, 8 insertions(+)
1616

1717
diff --git a/ports/rp2/clocks_extra.c b/ports/rp2/clocks_extra.c
18-
index ab3e6261f..b38452932 100644
18+
index ab3e6261f..db3643975 100644
1919
--- a/ports/rp2/clocks_extra.c
2020
+++ b/ports/rp2/clocks_extra.c
2121
@@ -14,6 +14,7 @@
@@ -30,12 +30,12 @@ index ab3e6261f..b38452932 100644
3030
XOSC_HZ,
3131
XOSC_HZ);
3232

33-
+#if SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST && defined(SYS_CLK_VREG_VOLTAGE_MIN)
33+
+ #if SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST && defined(SYS_CLK_VREG_VOLTAGE_MIN)
3434
+ if (vreg_get_voltage() < SYS_CLK_VREG_VOLTAGE_MIN) {
3535
+ vreg_set_voltage(SYS_CLK_VREG_VOLTAGE_MIN);
3636
+ busy_wait_at_least_cycles((uint32_t)((SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST_DELAY_US * (uint64_t)XOSC_HZ) / 1000000));
3737
+ }
38-
+#endif
38+
+ #endif
3939
+
4040
/// \tag::configure_clk_sys[]
4141
// CLK SYS = PLL SYS (usually) 125MHz / 1 = 125MHz

0 commit comments

Comments
 (0)