This is an automated archive made by the Lemmit Bot.

The original was posted on /r/chipcommunity by /u/w1kk on 2023-07-08 03:33:19+00:00.


As title says. It seems to work pretty well based on limited testing. WiFi and Bluetooth work fine. The kernel of course is still the same, but the userspace has all the fun “new” tools — anything newer than 6-8 years old basically. I’ve been playing around with podman to help isolate different projects and experiments deployed on the same CHIP device, which would have been harder to do with Debian Jessie.

I don’t claim any credit for the instructions below, it’s all been pieced together from different parts of the (awesome) CHIP community and beyond.

Step 1: Flash your CHIP

I won’t replicate the many other great and very thorough guides for flashing and updating out there, although I’ll briefly list out the steps I took since I had a pretty hard time flashing my device for the first time.

I didn’t have a spare computer I could install or live-boot an old version of Ubuntu so I used a fresh installation of Raspbian on a Raspberry Pi 4 for everything.

  1. On a fresh installation of Raspbian, install the required dependencies except for sunxi-tools and add the appropriate udev rules as described here sudo apt-get install u-boot-tools fastboot git build-essential curl libusb-1.0-0-dev pkg-config sudo usermod -a -G dialout $USER sudo usermod -a -G plugdev $USER sudo tee /etc/udev/rules.d/99-allwinner.rules <<EOF > /dev/null SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="efe8", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip" SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot" SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="1010", GROUP="plugdev", MODE="0660" SYMLINK+="usb-chip-fastboot" SUBSYSTEM=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", GROUP="plugdev", MODE="0660" SYMLINK+="usb-serial-adapter" EOF
  2. Compile and install specifically sunxi-tools v1.4 (the one from APT is 1.4.2 which didn’t work for me, I also tried compiling from source both 1.4.2 and 1.4.1 and neither worked) git clone https://github.com/linux-sunxi/sunxi-tools -b v1.4 && cd sunxi-tools make && sudo make install-tools
  3. Either modify the flashing scripts to avoid the usage of the old -i and -u flags for fastboot, or use a fork like this one git clone https://git.nytpu.com/forks/CHIP-tools/ && cd CHIP-tools
  4. Boot the CHIP into FEL mode using a jumper cable, and connect the CHIP to any of the Raspberry Pi’s ports with a microUSB cable
  5. From the CHIP-tools folder, run the flashing command FEL='sudo sunxi-fel' FASTBOOT='sudo fastboot' SNIB=false ./chip-update-firmware.sh -s
  6. Once the flashing process finishes and the CHIP device reboots, you should be able to connect to it — don’t forget to remove the jumper cable that puts it into FEL mode. To connect from the Raspberry Pi, I used: screen /dev/ttyACM0 115200
  7. After the device has booted you can connect it to your network, I used: nmcli device wifi connect <ssid> password <password>

From this point on, you should be able to connect to the device using SSH instead of screen if you prefer.

In theory these instructions should also work to flash your CHIP from another CHIP, but it seems that the USB port tries to draw too much power and the host CHIP reboots during the flashing process — or maybe it just refuses to engage in CHIP-on-CHIP violence.

Step 2: Upgrade to Buster

In general you should not skip releases, but going from the original Debian version (Jessie) to Buster has worked reliably for me. I tried going to later versions directly and it didn’t work.

  1. Update the apt sources: sudo tee /etc/apt/sources.list <<EOF > /dev/null deb http://deb.debian.org/debian buster main contrib non-free deb http://deb.debian.org/debian buster-updates main contrib non-free deb http://deb.debian.org/debian buster-backports main contrib non-free deb http://security.debian.org/debian-security/ buster/updates main contrib non-free EOF
  2. Upgrade the operating system, follow all on-screen instructions. sudo apt update && sudo apt -y full-upgrade && sudo apt -y autoremove

Step 3: Upgrade to Bullseye

Basically a repeat of the previous step with some minor modifications.

  1. Update the apt sources: sudo tee /etc/apt/sources.list <<EOF > /dev/null deb http://deb.debian.org/debian bullseye main contrib non-free deb http://deb.debian.org/debian bullseye-updates main contrib non-free deb http://deb.debian.org/debian bullseye-backports main contrib non-free deb http://security.debian.org/debian-security/ bullseye-security main contrib non-free EOF
  2. Upgrade the operating system, follow all on-screen instructions. sudo apt update && sudo apt -y full-upgrade && sudo apt -y autoremove

Step 3: Upgrade to Bookworm

These next steps might seem familiar if you’ve been paying attention.

  1. Update the apt sources: sudo tee /etc/apt/sources.list <<EOF > /dev/null deb http://deb.debian.org/debian bookworm contrib main non-free-firmware deb http://deb.debian.org/debian bookworm-updates contrib main non-free-firmware deb http://deb.debian.org/debian bookworm-backports contrib main non-free-firmware deb http://deb.debian.org/debian-security bookworm-security contrib main non-free-firmware EOF
  2. Upgrade the operating system, follow all on-screen instructions. sudo apt update && sudo apt -y full-upgrade && sudo apt -y autoremove

Known Issues

I encountered quite a few issues during the process until I was able to make it work reliably. To list a few:

  • Timeout waiting for FEL: Likely an issue of communication between the Pi and the CHIP, or wrong version of sunxi-tools.
    • Use a different cable
    • Plug in the microUSB cable right before running the flash command, or while it’s waiting for FEL
    • Install specifically version v1.4 of sunxi-tools
  • Timeout waiting for fastboot: Likely an issue of communication between the Pi and the CHIP.
    • Use a different cable
  • Flash succeeds but device fails to boot: Either wrong version of sunxi-tools or the device fails to draw enough power during wakeup (mine would shut off as soon as the wifi turned on during the boot process).
    • Use a different cable
    • Use a better power source for the Pi
    • Install specifically version v1.4 of sunxi-tools
  • Invalid GPG signatures in apt: Some of the Debian repositories being used are very old.
    • Safe to ignore, just type y when prompted or add -y --force-yes to your apt commands
  • Running apt update is stuck on “waiting for headers”: Unknown reason, something related to networking.
    • Patience, eventually the command succeeds
    • You can change some of the sources to your geographical location (e.g. replace deb.debian.org with ftp.us.debian.org)
  • **E: Sub-process /usr/bin/dpkg returned an error code (1)**: Something went wrong with an apt commend.
    • Run sudo apt-get install -f
    • Run sudo dpkg --configure -a
    • Reboot the device and re-run the command that failed
  • Bluetooth service fails to start due to Sap driver initialization failed.: Some versions of the bluetooth service try to use an unsupported feature.
    • Follow these instructions to disable SAP
    • Disable the bluetooth service if you don’t plan on using it: sudo systemctl disable bluetooth