The purpose of this tutorial is to walk through the required steps to upgrade NXT chip (or pocketchip) from debian jessie to debian buster.
If you would like to start your Chip from scratch, follow the steps in the Preparation section.
A linux host machine, recommended Ubuntu 18.04. However I managed to do it with 20.10 with some tweak.
- Remove the C.H.I.P from its case (in case you have a Pocket C.H.I.P).
- Connect the FEL and a GROUND pin of the C.H.I.P (for example, with a paperclip).
- Connect the C.H.I.P its micro USB port to a USB port of your Linux machine.
- In the Linux machine:
- run
git clone https://github.com/thore-krug/Flash-CHIP.git
to clone this repository. cd
into the location where you stored this repository.- run
sudo chmod +x Flash.sh
- run
./Flash.sh
- Select the version you want to install.
- Wait until the installation finishes.
- Restart the Chip
- run
- Connect to your chip using USB network or ssh over wifi. For USB network, run
screen /dev/ttyACM0
For Wifi ssh, runssh chip@<ip_address_of_chip>
- Your chip is running Debian Jessie now.
- Update the apt source file. Replace all
jessie
withstretch
in/etc/apt/source.list
. Comment away or remove the following
# deb http://http.debian.net/debian jessie-backports main contrib non-free
# deb-src http://http.debian.net/debian jessie-backports main contrib non-free
# deb http://opensource.nextthing.co/chip/debian/repo jessie main
and add
deb http://chip.jfpossibilities.com/chip/debian/repo jessie main
deb http://chip.jfpossibilities.com/chip/debian/pocketchip jessie main
After the modification, your /etc/apt/source.list
should look something like
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb http://chip.jfpossibilities.com/chip/debian/repo jessie main
deb http://chip.jfpossibilities.com/chip/debian/pocketchip jessie main
sudo apt update && sudo apt upgrade
Note I started with the headless server version and manually install lightdm and i3wm after the upgrade. Your experience might defer if you use other images.
- If you are stuck at
waiting for FEL...
, try to run the script without plugin the chip to the USB port of the host machine. Instead, you start the script./Flash.sh
and proceed until you see the promptwaiting for FEL...
, then plug in the chip. - If you are stuck at
flash usb_bulk_send() ERROR -7: Operation timed out
, your host machine is probably running a latest version of the sunix tool. Try to downgrade it by download the deb file fromsunxi-tools_1.4.1-1_amd64.deb
fromhttps://ubuntu.pkgs.org/18.04/ubuntu-universe-amd64/sunxi-tools_1.4.1-1_amd64.deb.html
. Then overwrite the existing installation with
$ sudo dpkg -i sunxi-tools_1.4.1-1_amd64.deb
And edit the Flash.sh
file to comment away the following lines.
# sunxi-tools \
- Login to your chip.
- Update the apt source file. Replace all
jessie
withstretch
in/etc/apt/source.list
. Comment away or remove to the two lines
# deb http://chip.jfpossibilities.com/chip/debian/repo jessie main
# deb http://chip.jfpossibilities.com/chip/debian/pocketchip jessie main
After the modification, /etc/apt/source.list
file should be like the following
deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
sudo apt update && sudo apt full-upgrade
- Modify the file
/etc/NetworkManager/NetworkManager.conf
to the following
[main]
plugins=ifupdown,keyfile
[connection]
wifi.mac-address-randomization=1
[device]
wifi.scan-rand-mac-address=no
[ifupdown]
managed=false
[keyfile]
unmanaged-devices=interface-name:wlan1
- If you have X running, modify the file
/etc/X11/xorg.conf
to the following
Section "Files"
ModulePath "/usr/lib/arm-linux-gnueabihf/xorg/modules/"
ModulePath "/usr/lib/xorg/modules/"
EndSection
Section "Monitor"
Identifier "VGA"
Option "PreferredMode" "1024x768_60.00"
EndSection
Section "Monitor"
Identifier "HDMI"
Option "PreferredMode" "1280x720_60.00"
EndSection
Section "Monitor"
Identifier "Composite"
Option "PreferredMode" "NTSC10"
EndSection
Section "Device"
Identifier "Allwinner sun4i DRM"
Driver "armsoc"
Option "Monitor-Composite-0" "Composite"
Option "Monitor-VGA-0" "VGA"
Option "Monitor-HDMI-A-0" "HDMI"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
EndSection
Section "Device"
Identifier "Card0"
Driver "modesetting"
EndSection
- Restart your chip and it should be in Stretch now.
- Login to your chip
- Update
/etc/apt/source.list
to the following
deb http://deb.debian.org/debian/ buster main contrib non-free
#deb-src http://deb.debian.org/debian/ buster main contrib non-free
#deb http://security.debian.org/ buster/updates main contrib non-free
#deb-src http://security.debian.org/ buster/updates main contrib non-free
#deb http://deb.debian.org/debian buster-backports main contrib non-free
#deb-src http://deb.debian.org/debian buster-backports main contrib non-free
sudo apt update && sudo apt full-upgrade
- Update
/etc/X11/xorg.conf
to the following
Section "Files"
ModulePath "/usr/lib/arm-linux-gnueabihf/xorg/modules/"
ModulePath "/usr/lib/xorg/modules/"
EndSection
Section "Monitor"
Identifier "VGA"
Option "PreferredMode" "1024x768_60.00"
EndSection
Section "Monitor"
Identifier "HDMI"
Option "PreferredMode" "1280x720_60.00"
EndSection
Section "Monitor"
Identifier "Composite"
Option "PreferredMode" "NTSC10"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
EndSection
Section "Device"
Identifier "Card0"
Driver "fbdev"
EndSection
-
(Optional) install lightdm and i3 by following this link https://www.reddit.com/r/ChipCommunity/comments/abndo9/an_updated_guide_for_installing_i3_window_manager/
-
Reboot. If your touch screen cursor movement is reversed, append the following to either
/etc/X11/xorg.conf
or/usr/share/X11/xorg.conf.d/99-calibration.conf
Section "InputClass"
Identifier "calibration"
MatchProduct "1c25000.rtp"
Option "Calibration" "3992 182 3694 276"
Option "SwapAxes" "0"
Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
EndSection
Thanks to https://www.reddit.com/user/pernig_/ awesome finding
- Edit this file
/etc/systemd/logind.conf
and change the following line
#HandlePowerKey=poweroff
to
HandlePowerKey=ignore
- Save the file and run the following in the terminal as root
$ systemctl kill -s HUP systemd-logind
Most of the steps in this tutorial were inspired/modified from the following references.
Since Jessie is now archived, the repository is not at archive.debian.org/debian (RE step 7). Also you may need to update the keyring using
apt install debian-keyring debian-archive-keyring
You should alsoupdate the keyrings after changing the sources list to the next release before runningapt update