thore-krug / flash-chip Goto Github PK
View Code? Open in Web Editor NEWReady to use Flash environment for the C.H.I.P Single Board Computer
Ready to use Flash environment for the C.H.I.P Single Board Computer
Hello!
The script doesn't work in the latest ubuntu, 20.10. I am no good with linux, so can't really tell you what went wrong, but installing 18.04 and running the script worked perfectly fine. If someone could check that out I'm sure it can be beneficial for the future.
weired.
Hi there,
I am trying to flash my PocketCHIP to the Desktop image but keeping running into new error messages.
I originally had the ERROR 7 that other people have mentioned and I downgraded sunxi-tools as others suggested and it fixed that issue. Now my new error is as follows:
waiting for fel...OK
stat() error on file ".new/firmware/images/u-boot-dtb.bin":No such file or directory.
How can I get this missing file?
If I rerun the install script again it will sometimes come up with:
waiting for fel...OK
usb_bulk_send() ERROR -9: Pipe error
Any help appreciated, I am new to this so sorry if its basic stuff.
I am running a Pi 4b Debian
Regards,
Chris
root@raspberrypi:/home/pi/Flash-CHIP/CHIP-tools# sunxi-fel -l
USB device 001:027 Allwinner A13 16254291:50303743:39383030:0d4267de
root@raspberrypi:/home/pi/Flash-CHIP/CHIP-tools# FEL='sudo sunxi-fel' FASTBOOT='sudo fastboot' SNIB=false ./chip-update-firmware.sh -gn
== Gui selected ==
== No Limit mode ==
== preparing images ==
== Local/cached probe files located ==
== Staging for NAND probe ==
Image Name: detect NAND
Created: Tue Oct 15 21:28:18 2019
Image Type: ARM Linux Script (uncompressed)
Data Size: 97 Bytes = 0.09 kB = 0.00 MB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 89 Bytes = 0.09 kB = 0.00 MB
waiting for fel...OK
usb_bulk_send() ERROR -7: Operation timed out
I'm having an issue trying to run this script from my Windows PC. I've tried running it through a VM and it just wasn't working (probably user error), and I've tried the Windows Subsystem for Linux and was running into this error: /bin/bash^M: bad interpreter: No such file or directory.
According to Google the problem is that the file endings confuse Unix, and following the commands "sed -i -e 's/\r$//'" and "sed -i -e 's/^M$//'" (per https://stackoverflow.com/questions/14219092/bash-script-and-bin-bashm-bad-interpreter-no-such-file-or-directory) solved it for Flash.sh, but the issue continues on farther down the line to ./Flash.sh: ./chip-update-firmware.sh and likely beyond. Is there anything you can do about this?
I get this message a few seconds after the waiting for fel...OK message.
I use an external supply to power the CHIP as recommended.
This CHIP was sick, I believe the original distribution must have been corrupted and the device did not enable the UART over USB and there was no evidence the device booted (no ssh even though it had been configured and was running before the device failed).
When I connect the FEL pin to ground and connect the USB to a Windows 10 PC, the PC does detect a USB device (not a COM port), so that gave me hope the hardware was not completely toast.
I use a Raspberry Pi B+ to install and run the tools.
The first time I ran the Flash.sh tool, it did download and build a bunch of stuff (I also had to install git first).
When it failed, I rebooted and retried a few times. After the first time it did not have to build anything and went into the "waiting for fel...OK" pretty quickly. I got the same error message each time though.
I do have a second CHIP that is working with the original Jessie distro, which I would like to upgrade since there is no software available for Jessie any longer, but I would rather try to save this one first...
Thanks for what looks like a great tool (if I can get it to work...) and thanks in advance for any further help.
Didier
Which version of linux do you suggest I start from? Because none of the ones I tried actually work. I tried the vagrant machine and VB with ubuntu 14.04, 18.04 and 20.04. My approach was pretty much the same each time. I start with a clean install (with guest additions) and then do:
sudo apt update && sudo apt upgrade
sudo apt install -y build-essential git make libusb-1.0-0-dev pkg-config android-tools-fastboot
cd ~/Downloads
git clone --branch v1.4.1 https://github.com/linux-sunxi/sunxi-tools.git
cd ~/Downloads/sunxi-tools
make
sudo make install
sudo make install-misc
cd ~/Downloads
git clone https://github.com/Thore-Krug/Flash-CHIP
cd ~/Downloads/Flash-CHIP
sudo chmod +x Flash.sh
./Flash.sh
Some notes:
I went into Flash.sh and deleted the line where sunxi-tools is updated to the newest version by apt. Before running ./Flash.sh I jumpered my C.H.I.P. between ground and FEL and then connected it to my computer. Also in VB I configured the device such that it is grabbed by my VM each time it reboots. Through the menu in VB I made sure these two devices are always connected to the VM:
Onda (unverified) V972 tablet in flashing mode [02B3]
Allwinner Technology USB download gadget [0215]
I am using a USB2.0 hub. Each time the download gadget appears in the VM for 1-2 seconds and then disappears again.
On the vagrant machine I could use the latest version of sunxi-tools. On my own images inside VB this didn't work so I had to install v1.4.1
I installed fastboot with apt install android-tools-fastboot. Using the official method to install fastboot I ran into the following error: usb_bulk_send() ERROR -7: Operation timed out.
There is always something. Sometimes it just can't find the board even though I got it jumpered correctly. Other times it looks fine for a while but then fails at the flashing part.
The latest error is that after everything has been downloaded, the script times out when waiting for fastboot. I read online that using the dev branch of CHIP-tools solves this problem, but there is no way for me to get that now.
I tried rebooting a million times but it doesn't help.
I think it'd be a good idea to make a working image for flashing C.H.I.P.s and then share that to save other people the trouble. But to do that I would first like your help with getting it to work in the first place.
Hello,
after trying all my micro usb cable chip finised flashing with the headless mode. No errors and the roll quote in the end.
But the CHIP didn´t connect to my network - can´t found at the fritzbox router. Connecting the HDMI it end in the command promt, but no updates because of no network.
What to do.
Thanks for help
Greetings
Peter
After installing the right toolschain for embedded i got all excited to run the installer on osx mojave, only to get
` ln -nfs sunxi-fexc /usr/local/bin/fex2bin
arm-none-eabi-gcc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -static -o sunxi-meminfo meminfo.c
meminfo.c:22:10: fatal error: sys/mman.h: No such file or directory
#include <sys/mman.h>
^~~~~~~~~~~~
'
2 hours of googling didn't help... suggestions welcome.
support nextthing chip (not pro) debian 9 (stretch)?
I need NetworkManager 1.x
I tried several USB cables on various Pi's and a VM virtualbox (Debian) on Windows 10.
All ending with the usb_bulk_send() error -7.
Maybe this is relevant:
https://github.com/linux-sunxi/sunxi-tools/blob/master/fel_lib.c
{
/*
* With no progress notifications, we'll use the maximum chunk size.
* Otherwise, it's useful to lower the size (have more chunks) to get
* more frequent status updates. 128 KiB per request seem suitable.
* (Worst case of "slow" transfers -> one update every two seconds.)
*/
size_t max_chunk = progress ? 128 * 1024 : AW_USB_MAX_BULK_SEND;
size_t chunk;
int rc, sent;
while (length > 0) {
chunk = length < max_chunk ? length : max_chunk;
rc = libusb_bulk_transfer(usb, ep, (void *)data, chunk,
&sent, USB_TIMEOUT);
if (rc != 0)
usb_error(rc, "usb_bulk_send()", 2);
length -= sent;
data += sent;
if (progress)
progress_update(sent); /* notification after each chunk */
}
}
Originally posted by @Superlub in #15 (comment)
I might be stupid, but I can't seem to get this to work.
Using Ubuntu I get the error:
Error: Unable to locate sunxi-fel utility.
Install sunxi-fel with:
CHIP-SDK setup script [github.com/NextThingCo/CHIP-SDK]
I can't get the flasher to work, and always run into the "cannot locate sunxi-fel utility". I can't download it using the link provided as the github link given is dead. Any help?
I don't know why but it's telling me
Installing CHIP-tools
Already up-to-date.
== Server selected ==
== preparing images ==
== Local/cached probe files located ==
== Staging for NAND probe ==
Image Name: detect NAND
Created: Sat Sep 7 05:08:33 2019
Image Type: ARM Linux Script (uncompressed)
Data Size: 97 Bytes = 0.09 kB = 0.00 MB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 89 Bytes = 0.09 kB = 0.00 MB
waiting for fel...OK
Invalid command spl
and won't go any further.
Even after restarting the Flash.sh script and the machine one which i'm running the script. I heep getting the error below:
sending sparse 'UBI' 14/24 (28672 KB)...
OKAY [ 1.892s]
writing 'UBI' 14/24...
OKAY [ 18.104s]
sending sparse 'UBI' 15/24 (28672 KB)...
FAILED (data write failure (Bad address))
finished. total time: 256.262s
Any Idea what's wrong ?
Running the script on Debian Buster:
== Local/cached probe files located ==
== Staging for NAND probe ==
Image Name: detect NAND
Created: Sat Oct 26 19:58:32 2019
Image Type: ARM Linux Script (uncompressed)
Data Size: 97 Bytes = 0.09 KiB = 0.00 MiB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 89 Bytes = 0.09 KiB = 0.00 MiB
waiting for fel....OK
usb_bulk_send() ERROR -7: Operation timed out
works ok on a Pi 3 running Jessie.
root@SandboxPi:~/Chip/Flash-CHIP# ./Flash.sh
#########
########
Welcome to the C.H.I.P Flasher Tool
Please enter your wanted flavour
++++++++++++++++++++++++++++++++++++++++++
enter p for pocketchip Image
enter s for the headless Server Image
enter g for the Desktop Image
enter b for the Buildroot Image
++++++++++++++++++++++++++++++++++++++++++
IMPORTANT INFO
If u suffer from Power Problems add a n
to your choice of flavour
Example: gn for the No-Limit Desktop Image
++++++++++++++++++++++++++++++++++++++++++
Other options
++++++++++++++++++++++++++++++++++++++++++
enter f for Force Clean
++++++++++++++++++++++++++++++++++++++++++
Then press enter please
g
Setting up environment
Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
curl is already the newest version (7.52.1-5+deb9u9).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
u-boot-tools is already the newest version (2016.11+dfsg1-4+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
adb is already the newest version (1:7.0.0+r33-1).
android-tools-fastboot is already the newest version (1:7.0.0+r33-1).
fastboot is already the newest version (1:7.0.0+r33-1).
git is already the newest version (1:2.11.0-3+deb9u4).
sunxi-tools is already the newest version (1.4.1-1).
u-boot-tools is already the newest version (2016.11+dfsg1-4+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Adding current user to dialout group
Adding current user to plugdev group
Adding udev rule for Allwinner device
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"
Installing CHIP-tools
Already up-to-date.
== Gui selected ==
== preparing images ==
== Local/cached probe files located ==
== Staging for NAND probe ==
Image Name: detect NAND
Created: Thu Nov 7 14:21:49 2019
Image Type: ARM Linux Script (uncompressed)
Data Size: 97 Bytes = 0.09 kB = 0.00 MB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 89 Bytes = 0.09 kB = 0.00 MB
waiting for fel...OK
waiting for fel......OK
NAND detected:
9g?▒▒▒
`▒H]N▒▒@bX9s▒▒▒ümu▒ѝ▒▒▒▒:▒▒▒J6▒▒▒Je▒d▒G▒▒z@
H▒▒T▒=ian▒▒a▒▒C▒▒
▒▒ʿ▒▒$▒▒▒%▒▒▒R▒"m▒▒@▒▒eķ?u▒▒SE▒▒▒H▒▒▒▒▒▒▒▒ڔH+▒w!c▒p@▒ߺ/Chip/Flash-CHIP# PuTTYPuTTY036\017': command not found
N▒▒c4▒▒▒▒▒m▒a▒▒▒T▒[▒▒AF▒▒▒▒\▒▒4h▒▒d▒6n4U▒▒)▒▒l▒▒@▒▒▒5p▒▒PuTTYPuTTY/tmp/chip-uboot-script-NVtO45/nand-info: line 1: $'9\024g?\200\367\333\036\017': command not found
/tmp/chip-uboot-script-NVtO45/nand-info: line 2: unexpected EOF while looking for matching ``'
/tmp/chip-uboot-script-NVtO45/nand-info: line 4: syntax error: unexpected end of file
root@SandboxPi:
/tmp/chip-uboot-script-NVtO45/nand-info: line 2: unexpected EOF while looking for matching ``'
-bash: PuTTYPuTTY036017: command not found
Raspbian updated something that broke the reflashing of the CHIP? I was trying option 'g'
Would be interested if you ran across this? As you can see, all the tools are up to date.
I connect the CHIP as recommended to my USB port, with the jumper between FEL and GND. When the CHIP powers on I get a pink and white LED, then I run the ./Flash.sh command as outlined and it always ends in with FEL....TIMEOUT, ERROR: please make sure CHIP is connected and jumpered in FEL mode
My Linux is running as a virtual machine on a windows host via Virtualbox. I have given the virtual machine direct access to both the network hardware and usb hardware. Any help would be greatly appreciated!
I am trying to get the script running on Fedora. I removed all those 'apt' related lines of code at the start, and installed the dependencies. I installed the following Fedora packages with dnf...
dnf install curl wget git android-tools uboot-tools sunxi-tools
I ran the script as root without sudo, and it almost worked, here is the output...
# # #
#########
### ###
# {#} #
### '\######
# #
### ###
########
# # #
Welcome to the C.H.I.P Flasher Tool
Please enter your wanted flavour
++++++++++++++++++++++++++++++++++++++++++
enter p for pocketchip Image
enter s for the headless Server Image
enter g for the Desktop Image
enter b for the Buildroot Image
++++++++++++++++++++++++++++++++++++++++++
IMPORTANT INFO
If u suffer from Power Problems add a n
to your choice of flavour
Example: gn for the No-Limit Desktop Image
++++++++++++++++++++++++++++++++++++++++++
Other options
++++++++++++++++++++++++++++++++++++++++++
enter f for Force Clean
++++++++++++++++++++++++++++++++++++++++++
Then press enter please
pn
Adding udev rule for Allwinner device
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"
Installing CHIP-tools
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:
git config pull.rebase false # merge (the default strategy)
git config pull.rebase true # rebase
git config pull.ff only # fast-forward only
You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.
Already up to date.
== Pocketchip selected ==
== No Limit mode ==
== preparing images ==
== Local/cached probe files located ==
== Staging for NAND probe ==
Image Name: detect NAND
Created: Wed Feb 3 20:54:19 2021
Image Type: ARM Linux Script (uncompressed)
Data Size: 97 Bytes = 0.09 KiB = 0.00 MiB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 89 Bytes = 0.09 KiB = 0.00 MiB
waiting for fel......OK
waiting for fel.....OK
NAND detected:
nand_erasesize=400000
nand_oobsize=500
nand_writesize=4000
== Cached UBI located ==
Image Name: flash pocketchip
Created: Wed Feb 3 20:54:31 2021
Image Type: ARM Linux Script (uncompressed)
Data Size: 2288 Bytes = 2.23 KiB = 0.00 MiB
Load Address: 00000000
Entry Point: 00000000
Contents:
Image 0: 2280 Bytes = 2.23 KiB = 0.00 MiB
waiting for fel...OK
waiting for fastboot...fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.fastboot: invalid option -- 'i'
.TIMEOUT
failed to flash the UBI image
FLASH VERIFICATION FAILED.
TROUBLESHOOTING:
Is the FEL pin connected to GND?
Have you tried turning it off and turning it on again?
Did you run the setup script in CHIP-SDK?
Download could be corrupt, it can be re-downloaded by adding the '-f' flag.
It is clearly having trouble with running fastboot which led to a timeout of some kind.
I have the same error with ubuntu, the chip is in FEL mode ( the pins are connected) it’s in a usb2 port with a working cable, but it keeps saying : waiting for Fel:.......... timeout
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.