Notes on the PocketCHIP handheld (if you're coming to it new in 2019)
There's what's presumably new old stock of NTC CHIP chips and PocketCHIP handhelds circulating, and I picked up a PocketCHIP, having missed them the first time around. I had a CHIP and backed up much of NTC's information myself, so let's just put everything to understand the PocketCHIP in one place.
- It's a Debian 8 (Jessie) machine. Debian 8 has been EOL since June 2018.
- The display is 480x272 with resistive touch. A stylus is recommended.
- The previously advertised 3D hardware acceleration is OpenGL ES only.
- The 8GB flash storage models use Hynix chips. You can determine which you have by pulling the CHIP out of the back of the PocketCHIP and looking at the large center chip on the underside for a model number starting with either T for Toshiba (4GB) or H for Hynix (8GB). You can also run
dmesg | grep nand
and one of the lines will include the manufacturer name and model number. - There's two firmware builds preserved for the PocketCHIP, a "stable"
b126
and a "testing"b667
. It's unclear what the differences are, but they're only a month apart. - While the NTC repositories for the stable builds were preserved, it doesn't appear as though the repositories for the testing builds were. That may mean we're missing out on any last beta NTC packages.
- Benchmarks put the CHIP somewhere between an original Raspberry Pi 1 (or Zero W) and a Raspberry Pi 2 in performance.
- The firmware it ships with hides the Linux bootup and shutdown scrolls with a graphical progress bar. The two firmware you might flash it with do not.
There's a few different ways to flash your CHIP, check Reddit or the wiki for the latest options.
Note that you don't need to remove the CHIP from your PocketCHIP to flash it; you can jumper the FEL to any GROUND using the header holes at the top.
b126
b126
shows an in-app date of "Fri Dec 9 22:59:49 UTC 2016", the same as listed in/etc/os-release
BUILD_ID
.- Via serial console, U-Boot version says
U-Boot 2016.01-00115-g5f814bb
uname -a
saysLinux chip 4.4.13-ntc-mlc #1 SMP Tue Dec 6 21:38:00 UTC 2016 armv7l GNU/Linux
/etc/chip_build_info.txt
unhelpfully saysDebian on C.H.I.P pocketchip build rev
/etc/debian_version
says8.6
/proc/cmdline
saysroot=ubi0:rootfs rootfstype=ubifs rw earlyprintk ubi.mtd=4
which means you're not getting the fancy PocketCHIP boot animationglxinfo
reports no hardware acceleration, andglxgears
runs at ~24fpses2_info
reports OpenGL ES 2.0 support with a Mali-400 MP, andes2_gears
runs at ~60fps
b667
b667
shows an in-app date of "Fri Jan 6 01:23:42 UTC 2017", the same as listed in/etc/os-release
BUILD_ID
.- Via serial console, U-Boot version says
U-Boot 2016.01-00119-g2b4a5dd
(slightly newer than b126) uname -a
,/etc/chip_build_info.txt
,/etc/debian_version
and/proc/cmdline
are all the same as b126glxinfo
,glxgears
,es2_info
andes2gears
are all the same as b126
Unclear if any differences
The U-Boot version differences (00115
v. 00119
) and hashes (g5f814bb
v. g2b4a5dd
) don't align with standard U-Boot release numbers or with commits in either the mainline U-Boot repository or the preserved NTC CHIP U-Boot repository. It's unclear if there are any practical differences, given the builds are only about a month apart.
There are no NTC packages to upgrade with either b126 or b667 except for PICO-8, which has since had a first-party update from Lexaloffle anyway. This means once flashed, you only need to specify the stock Debian Jessie archive and security repositories in your apt configuration.
Under b126, there are 208 other Debian packages to upgrade (205 with three held back due to additional dependencies). Under b667, there are 206 other Debian packages to upgrade (203 with the same three held back due to additional dependencies. Once either one is upgraded, both should be identical.
The three held back packages can be installed manually, or you can use sudo apt-get --with-new-pkgs upgrade
to include them. There doesn't appear to be any point to preserving the package pinning.
Given that you can restore the boot animation, and all the rest of the software on the system comes from the Debian repositories, I'm not sure there's any reason to stick with the stock image or bother with the "testing" image.
Restoring the boot animation after flashing
Boot animations are provided by a program called Plymouth. With a stock PocketCHIP, you'll see a CHIP splash image, and then an animated progress bar that fills in pink. After flashing, the splash image may show briefly, but then it'll be just scrolling Linux kernel text.
A post in this archived forum thread basically says you need to add the quiet lpj=501248 loglevel=3 splash plymouth.ignore-serial-consoles
parameters (back) to the kernel boot command.
You can do this with a serial cable by interrupting the U-Boot boot process, but it's not actually necessary, and these instructions are the same regardless of the brand or size of NAND your CHIP has, or which build you've flashed with.
From Terminal or serial console, sudo nano /etc/fw_env.config
, and type the line /dev/mtdblock3 0 0x400000 0x4000
. Ctrl-O, Enter to save, Ctrl-X to exit. Then, sudo fw_printenv bootargs
to see what the current boot command is (it should match the output of cat /proc/cmdline
).
To change it, sudo fw_setenv bootargs root=ubi0:rootfs rootfstype=ubifs rw ubi.mtd=4 quiet loglevel=3 splash plymouth.ignore-serial-consoles
. We're leaving out the lpj=501248
as we're assuming that the later firmware discovered it didn't need to set loops per jiffy. We're removing earlyprintk
because we're silencing everything, so early kernel output won't still show up on the screen and interrupt the animation.
To make sure it was set, run sudo fw_printenv bootargs
again. Then, reboot.
Updating Debian packages
Configure your wifi, then from Terminal (an external USB keyboard is recommended):
- Create a fake
https
transport for apt until we can install the real one - Remove package pinning
- Ignore the EOL package dates
- Add the final Jessie repositories
$ cd /usr/lib/apt/methods/ $ sudo ln -s http https $ $ sudo rm /etc/apt/preferences $ $ sudo nano /etc/apt/apt.conf $ cat /etc/apt/apt.conf Acquire::Check-Valid-Until "false"; $ $ sudo nano /etc/apt/sources.list $ cat /etc/apt/sources.list deb http://archive.debian.org/debian/ jessie main contrib non-free deb http://security.debian.org/ jessie/updates main contrib non-free deb http://archive.debian.org/debian jessie-backports main contrib non-free $ $ sudo apt-get update $ sudo apt-get install apt-transport-https $ sudo apt-get --with-new-pkgs upgrade
Configure locales and time zones so other software doesn't complain:
$ sudo apt-get install locales $ sudo dpkg-reconfigure locales $ sudo dpkg-reconfigure tzdata
Change the hostname from chip
to pocketchip
:
$ sudo nano /etc/hostname $ cat /etc/hostname pocketchip $ sudo nano /etc/hosts $ cat /etc/hosts 127.0.0.1 pocketchip 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters $ $ sudo /etc/init.d/avahi-daemon restart
Optionally, add SSH:
$ sudo apt-get install openssh-server openssh-client
Because Debian Jessie is EOL, once updated, you shouldn't have to update it ever again. All packages installed should be the final ones.
I'm Vitorio, it's April 27, 2019, thanks for your time.