Skip to content

Pico Computer 3 & 2 v0.18 (test)

Latest

Choose a tag to compare

@UKTailwind UKTailwind released this 03 Dec 12:46
· 0 commits to master since this release

3 December 2026. Compared with v0.17, the last version released (its firmware.uf2 as updated on 3 September, with the USB host hardening).

This is MicroPython 1.29.0 for the Pico Computer 3 and the Pico Computer 2 (RP2350B), with the machine's screen, keyboard, mouse, sound, SD card and USB drives. Please report problems on the Back Shed forum.

The files are below: firmware.uf2 for the machine, pc3emu-linux-x64.tar.gz for the PC emulator (Linux, or Windows through WSL2), and the User Manual as USER_MANUAL.pdf and USER_MANUAL.md.

v0.18 brings:

  • Ctrl-C stops a database query. A long SQLite statement ends with a KeyboardInterrupt that your program can catch. Before, a big sort or index build could not be stopped, which looked like a hang.
  • Big sorts take a quarter of the memory, 256KB where they took 1MB, in the same time. That pays for a page cache four times the size, 1MB, which makes queries with a temporary table (DISTINCT, some subqueries) faster.
  • ANALYZE is an error, where it did nothing and seemed to work.
  • The mouse pointer in RGB1024 mode is drawn where the mouse is; it was a pixel off.
  • The book: every example has been run on a machine and its bugs fixed, a new Appendix K covers the Colour Maximite 2, and the book can be built as a web site.

Before you update

Write the firmware as before. Your files and settings survive.

USB HUB switch to DISABLE, connect the Prog port to a PC, hold BOOT and click RESET, drag firmware.uf2 onto the drive that appears, then switch back to ENABLE.

A database made by v0.17 opens in v0.18 as it was: SQLite is still 3.47.0, and its files are SQLite's.

What is new

SQLite (usqlite)

  • Ctrl-C ends a long statement. SQLite now looks for a Ctrl-C every 1,000 of its steps, from the USB keyboard or the serial console, and ends the statement. The call that ran it, execute() or the loop over its rows, then raises KeyboardInterrupt, which an except KeyboardInterrupt in your program catches. A change that was interrupted is undone: inside BEGIN ... COMMIT, the whole transaction is. One pass of a very large sort finishes before the statement stops.
  • Sorts take far less memory. ORDER BY, GROUP BY, DISTINCT and CREATE INDEX keep at most 256KB of rows in memory before they write a run to a temporary file. They used to keep up to 1MB, whatever was asked, and a big cache made them keep more: that was the hang of a 4MB pool that v0.12 cured by keeping the cache small.
  • The page cache is 1MB (it was 256KB), in slots of its own at the start of SQLite's 4MB of memory. Each 4KB page used to take an 8KB block, so the cache cost twice its size.
  • ANALYZE says "ANALYZE is not available". This build has no ANALYZE, and before it did nothing and reported success.
  • usqlite.mem_current() and mem_peak() report SQLite's memory less the page cache's 1MB, which is set aside at the first connect().

The screen and the prompt

  • The mouse pointer in RGB1024 mode is drawn where the mouse is. Its pixels were placed the wrong way round in each pair, so it showed a pixel off.
  • auto() works at the prompt, as chapters 30 and 36 of the book use it.

The book

  • Every example has been run, and the ones that failed are fixed. The adventure of chapter 25 made its framebuffer, as chapters 17 to 24 do, and its tile map takes a whole number. Chapter 29's mktime() is given its eight values. Chapter 31 imports from ulab import numpy as np. Chapter 30's GitHub example sends the User-Agent that GitHub asks for.
  • Appendix K, Running this book on a Colour Maximite 2, covers its MicroPython: starting it, files, pins, Wi-Fi, the clock, memory and the cmm2 module. Chapters 1, 2, 4, 5, 15, 29, 30 and 32 point to it.
  • The book builds as a web site as well as a PDF and an EPUB (make web): one page per chapter, Previous, Contents and Next on every page, and fonts that every reader has. Its listings no longer lose their indentation on a machine without the DejaVu fonts.

Building

BUILDING.md says how to build the firmware, the PC emulator and the manual from a fresh copy of the source: what to install, the submodules, the build and how to flash it.

The PC emulator

pc3emu has the same SQLite settings as the firmware.

What behaves differently

  • ANALYZE is an error where it reported success.
  • Ctrl-C during a query raises KeyboardInterrupt from the call that ran it. Before, the query ran to its end, and the KeyboardInterrupt came after it, at a place a program's try might not cover.
  • usqlite.mem_current() and mem_peak() leave out the page cache.
  • CREATE INDEX writes more temporary data. Its runs are smaller, so there are more of them: on the board's flash an index over 20,000 rows took 194 seconds where it took 167, run one after the other from the same state.

Tested

On a Pico Computer 3, firmware built from this release's sources, and v0.17's for comparison. 20,000 rows were on the board's flash, with SQLite's temporary files there too:

  • ORDER BY: 17.7 seconds and 291KB, where v0.17 took 18.7 seconds and 1,546KB.
  • GROUP BY: 17.3 seconds and 292KB, where v0.17 took 17.2 seconds and 1,547KB.
  • CREATE INDEX: 194 seconds and 301KB, where v0.17 took 167 seconds and 1,564KB.
  • ANALYZE: the error, where v0.17 reported success.

The sizes are the most SQLite's memory held during each statement. v0.17's include its page cache, which could take up to 512KB, and v0.18's leave out the 1MB set aside for its cache. Either way, v0.18's sorts use about a quarter of what v0.17's did.

  • Ctrl-C over the serial console, 3 seconds into a statement of 3,000,000 steps: v0.17 ran it to its end (123 seconds), and the KeyboardInterrupt then went off outside the program's try and stopped the program. v0.18 stopped the statement 0.22 seconds after the key, the program caught the KeyboardInterrupt, and the database answered the next query.
  • The test files were removed from the board's flash afterwards.
  • This release's own firmware (the build firmware.uf2 is made from), on the same board: the banner says v0.18, 2,000 rows sorted in order, ANALYZE refused, and a Ctrl-C 3 seconds into a long statement caught 0.21 seconds later, with the database still answering.
  • The emulator in this release's tarball says "PICO COMPUTER 3 v0.18 emulator", has the 1MB cache, and refuses ANALYZE.

On the PC emulator (the same SQLite settings, 200,000 rows): ORDER BY 1.9 seconds where it took 1.2, with 0.53MB of SQLite's memory beside the cache where it took 1.6MB with it; DISTINCT 54 seconds where it took 65; CREATE INDEX 2.6 seconds where it took 1.8.

The book's examples were run on a Colour Maximite 2 (its MicroPython app), and the failures were checked on a Pico Computer 2 with the PC3 firmware before they were fixed.

Known problems

  • A Ctrl-C from the USB keyboard during a query has not been tried on the machine. It comes through the same check as the serial console's, which has.
  • One long step of a big sort runs to its end before Ctrl-C stops the statement.
  • In the PC emulator, Ctrl-C always stopped a query, with v0.17's SQLite too: the emulator handles Ctrl-C another way. It is not a test of this fix.