Jump to content

How to USB boot Orange Pi Zero with MX25L1606E NOR flash?


Rammwurst

Recommended Posts


1.Update package

$ sudo apt-get update
$ sudo apt-get upgrade

 

2.Download flashrom-0.9.9.tar.bz2 from here.
https://www.flashrom.org/Flashrom/0.9.9


3.Install flashrom-0.9.9 to Opi-ZERO

$ sudo apt-get install pciutils
$ sudo apt-get install libftdi-dev
$ sudo apt-get install libusb-dev
$ sudo apt-get install libpci-dev
$ bzip2 -d flashrom-0.9.9.tar.bz2
$ tar xvf flashrom-0.9.9.tar
$ cd flashrom-0.9.9/
$ make
$ sudo make install

 

4.Write SPI Flash image

$ cd
$ dd if=/dev/zero count=2048 bs=1K | tr '\000' '\377' > spi.img
$ dd if=/usr/lib/linux-u-boot-orangepizero_5.31_armhf/u-boot-sunxi-with-spl.bin of=spi.img bs=1k conv=notrunc
$ sudo flashrom -p linux_spi:dev=/dev/spidev0.0 -c MX25L1605 -w spi.img

 

Note:
linux-u-boot-orangepizero_5.31 depends on the version of the kernel.
 

5.Writing an image to USB memory
You will need to use an image writing tool (like Win32DiskImager.exe)
to install the Armbian image on your USB memory.

 

6.Shutdown 
A SD card is removed from Opi-ZERO.
A USB memory is stuck into Opi-ZERO.

 

7.Power On

Link to comment
Share on other sites

So basically write a u-boot image to the NOR flash and an armbian image to the usb memory and power on the device

 

i did try that with the sunxi wiki recommended

 

$ sudo sunxi-fel -v -p spiflash-write 0 u-boot-sunxi-with-spl.bin

though that didn't work because "Invalid command spiflash-write"

 

your flashing method doesn't want to work for me either "linux_spi_init: failed to open /dev/spidev0.0: No such file or directory"

Link to comment
Share on other sites

5 minutes ago, Rammwurst said:

though that didn't work because "Invalid command spiflash-write"

It's not in the main sunxi-tools branch yet: https://github.com/linux-sunxi/sunxi-tools/pull/107

 

6 minutes ago, Rammwurst said:

your flashing method doesn't want to work for me either "linux_spi_init: failed to open /dev/spidev0.0: No such file or directory"

Which image (or rather which kernel branch - default or dev) did you use?

Link to comment
Share on other sites

I'm not on any Armbian kernel

 

I'm on Ubuntu trying to set up a opi zero without a SD card

 

no wonder the flashing didn't work ;)

 

sudo flashrom -p linux_spi:dev=/dev/spidev0.0 -c MX25L1605 -w spi.img

assumed i was on the device with Armbian

 

 

Link to comment
Share on other sites

17 minutes ago, martinayotte said:

On which one ?

On another device or a PC. As I understand it "without SD card" means without booting any image on the board itself, so the only option left is FEL boot (requires a pretty complex setup) or FEL SPI write (requires compiling sunxi-tools from a special repo/branch that I linked above)

Link to comment
Share on other sites

I got it to work somewhat

 

i compiled a u-boot-sunxi-with-spl.bin (orangepi_zero) with CONFIG_SPI_BOOT=y and compiled the sunxi-tools from apritzel's spiflash branch and succesfully flashed the u-boot image to the NOR flash via USB OTG

 

copied Armbian 5.32.170915 (nightly) to a 8gb USB 3.0 with Etcher, plugged the USB into the opi-zero and turned it on

 

the green LED comes on fairly quickly, the ethernet leds flash as well but it takes a couple power-on's for me to get the heartbeat from the red LED and i can connect over SSH but the system seems unstable and sluggish

 

Could it be the power? i tried 2 different 5V power supplies and the USB 3.0 ports of my PC and it doesn't seem any different

Link to comment
Share on other sites

How much current can they deliver? (what's specified on the PSU doesn't match every time with the reality!) USB port on a PC is not recommended (they're mostly deliver arround 500mA). We've an own subforum for underpowered boards here.. ;)

https://forum.armbian.com/index.php?/forum/31-sd-card-and-power-supply/

 

A personal opinion: Before start to think about booting from an USB stick, I would make sure that your system runs smoothly with an SD card. Just to reduce possible variables of failure.

 

Link to comment
Share on other sites

4 hours ago, chwe said:

How much current can they deliver? (what's specified on the PSU doesn't match every time with the reality!) USB port on a PC is not recommended (they're mostly deliver arround 500mA). We've an own subforum for underpowered boards here.. ;)

https://forum.armbian.com/index.php?/forum/31-sd-card-and-power-supply/

 

A personal opinion: Before start to think about booting from an USB stick, I would make sure that your system runs smoothly with an SD card. Just to reduce possible variables of failure.

 

 

One has 900 mili amps output and the other 1.5 amps

 

don't actually have any tools to accurately measure it though, only read the labels

 

I ordered a SD card, this whole USB business is really just a result of lacking patience

Link to comment
Share on other sites

Problem is often not curret, I would recommend 2 amps (as xunlong do) but this is often not needed. The problem of all these small usb chargers is, that the voltage drops when they are running under high load. This doesn't matter if you charge a battery but your orange pi tends to be bitchy.. :P

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines