Tow-Boot icon indicating copy to clipboard operation
Tow-Boot copied to clipboard

No option to flash firmware to SPI on Pinebook Pro

Open ckykenken opened this issue 2 years ago • 26 comments

I wrote the image spi.installer.img to my SD card, shut down my PBP, disconnect the eMMC chip (as it takes precedence to boot), and boot from my SD card. And when I reached the boot menu, there is no option for flash firmware to SPI flash. Or is there any way to flash the firmware from the console?

ckykenken avatar Oct 17 '21 05:10 ckykenken

You may need to "boot from SD" from the boot menu to get to the menu with flashing options.

It is possible to flash manually, but there are safeguards built into the flashing script that would be bypassed. Namely the flashing script "breaks" booting from SPI until the very last moment. Which means that an incomplete flash should leave SPI flash out from the boot order.

samueldr avatar Oct 17 '21 23:10 samueldr

Tried "boot from SD", but it refuses to boot, it keeps saying "boot from SD failed". I'm 1000% sure that I wrote the correct image to the SD card. What process did I miss out on before I shut down the machine and boot from SD card?

ckykenken avatar Oct 18 '21 18:10 ckykenken

Odd. I'm assuming you don't currently have a platform firmware (e.g. U-Boot) installed to the SPI flash, right?

In that case, when you start the platform firmware from SD, from the spi.installer.img, you do see the Tow-Boot logo during boot, right? If you don't it means that some other platform firmware (U-Boot installation) is being used. The installer image uses non-default U-Boot options to work, which mean it can't exactly be installed from another U-Boot installation in its current form.

EDIT: and if you mount the partition from the SD image on another computer, what files do you see?

samueldr avatar Oct 18 '21 18:10 samueldr

you do see the Tow-Boot logo during boot, right?

Yes, and I pulled away the eMMC from the board beforehand

Mounting the SD card I see boot.scr, flash.scr and Tow-Boot.spi.bin

ckykenken avatar Oct 18 '21 22:10 ckykenken

Right, so the SD card seems okay. It's weird that you can't "boot from SD card"... unless for some reason it's disliked by Tow-Boot (or U-Boot really)...

Is there anything else before "boot from SD failed"?

samueldr avatar Oct 18 '21 23:10 samueldr

I also couldn't use the installer SD image. I solved the problem by running dd if=Tow-Boot.spi.bin of=/dev/mtd0 from the already installed OS.

(I think) I already had a u-boot written to SPI from previous tinkering. I'm not near the laptop now but from memory the serial output mentioned unknown commands starting with td_

Hope this helps.

gwenhael-le-moine avatar Oct 19 '21 11:10 gwenhael-le-moine

Oh, in the case where there's a valid U-Boot on SPI, manually erasing that install first would help. From Linux using /dev/mtd0 I guess would work. Otherwise sf erase 0x0 0x2000 from U-Boot's command-line (this only erases the start of the SPI Flash, but is enough to prevent the SoC from seeing it as valid).

Then, once erased, booting the spi installer hopefully uses Tow-Boot correctly, which in turn can boot form the SD image.

samueldr avatar Oct 20 '21 00:10 samueldr

I'm stuck with the same issue. I entered the "Firmware Console" and ran the erase command mentioned by Samuel, but still no luck.

First I get a message at the bottom that with ESC or CTRL+C, I can enter the boot menu. Then a lot of text flies over the screen, too fast to read. And after that the boot menu appears. I recorded a video so that I would be able to read the text.

switch to partition #0, OK
mmc0(part 0) is current device
** No partition table - mmc 0 **
Couldn't find partition table mmc 0:1

This might be, because I dd'ed the beginning of the eMMC in order for the SDcard to boot.

After that there are a couple of lines about missing Ethernet and a missing environment variable "bootfile". Doesn't seem serious.

But then...

## Executing script at 00500000
Wrong image format for "source" command
SCRIPT FAILED: continuing...
Creating menu...

I believe there is the issue.

criena avatar Jan 25 '22 15:01 criena

@crlena: which disk image did you flash to the SD card?

When booting, you can start "spamming" presses of ESC or CTRL+C to break into the boot menu. Does selecting to boot from SD card from the menu work? (Be careful not to touch the touchpad, the current U-Boot input drivers reportedly lock-up on touch pad events.)

samueldr avatar Jan 25 '22 17:01 samueldr

@samueldr: I used the spi-installer.img. When I try to boot from the SD card, I get the message "SD Boot failed".

criena avatar Jan 25 '22 18:01 criena

Odd. What exact command are you using to write the spi installer to the SD card?

Given it's seemingly starting Tow-Boot (assuemd from the esc/ctrl-c message), it seems that at the very least the system is starting from SD card, unless you had another Tow-Boot install somewhere else.

samueldr avatar Jan 25 '22 18:01 samueldr

The one from https://tow-boot.org/getting-started.html dd if=spi-installer.img of=/dev/mmcblk1 oflag=direct,sync.

The SPI is still maiden, nothing touched it yet. And I cleared out the boot area from the eMMC. Only the SD card has bootable code. I find it odd too, but it's the same issue the TO described.

criena avatar Jan 25 '22 18:01 criena

Assuming your SD card reader indeed is /dev/mmcblk1, it is looking fine. The important parts are probably done correctly, that is syncing the storage media.

Do you have access to another model/brand of SD card? I'm wondering if while the SoC can use the SD card correctly, if U-Boot itself somehow misconfigures it or makes it act in an odd fashion.

Sadly, even knowing the model/brand may not be enough to reproduce locally, sometimes model/brand are "user facing" and comprised of different actual chips.

samueldr avatar Jan 25 '22 19:01 samueldr

@samueldr I have to admit, I had my doubts that another SD card would solve the issue. After all the first card did show a boot menu. But indeed with a second card everything went smoothly just as it should. I flashed the SPI and now I have Tow Boot on the Pinebook Pro! Time to get NixOS up and running. ;-) Thanks!

criena avatar Jan 25 '22 21:01 criena

I wouldn't call this a solution, ideally we'd be able to dig into why this failed. But eh, t works. Anyone having similar issues (Tow-Boot starts from SD, but it itself won't boot the SD SPI Installer) should try with a different model/brand SD card too.

SD cards are fickle beasts.

samueldr avatar Jan 25 '22 23:01 samueldr

I have just had exactly the same problem, and the same solution. The card that does not provide the option to flash the firmware to SPI is a Kingston 8GB MicroSD HC "Speed Class 4" card. The working card is a Mengmi 16GB MicroSD HC UHS Speed Class 1 card -- in case this info helps narrowing down the issue.

Since this seems at least somewhat common (3-4 reports so far with 2 confirmations that "use a different SD" resolves it), is it worth mentioning in a README file for the Pinebook Pro board (which I guess would need to be created in this directory of the repo)?

aecay avatar Feb 06 '22 20:02 aecay

I guess this could be a general troubleshooting step. I expect troubles like these could happen with any hardware, so trying this as an additional troubleshooting step is relatively painless and not expensive.

samueldr avatar Feb 06 '22 20:02 samueldr

Found a workaround finally

  1. Boot from the SD card and get to the Tow Boot menu
  2. eject the SD card
  3. Select "Boot from SD"
  4. Plug the SD card back in
  5. Select "Boot from SD" And finally, I got into the flash to SPI menu

A bit brute force, but it worked

ckykenken avatar Mar 11 '22 14:03 ckykenken

I had the same issue, workaround by @ckykenken works (on 2021.10-005).

pkubaj avatar Aug 23 '22 18:08 pkubaj

hello I've been having a problem for several days. I've asked for help from Pine64/Pinebook chat room, but nothing we tried works with the people that were available at the time I asked. none of them encountered this problem before.

  • I do not even see the Tow Boot menu. I've made 3 different SD cards with the SPI installer.img and with Emmc switch off, It still does not show up , no text, just red power light and dark blue screen.
  • my SD slot seems to work since I can use it to run Armbian off the SD card (IF the switch is off for emmc - otherwise Manjaro boots up and skips the SD card completely).
  • I recently got the Pinebook Pro used. I got help installing Manjaro KDE on the EMMC a couple days ago. It is fully updated too.
  • I even bought new micro SD cards. non of them work. I haven't in past 16 hours trying to figure this out.
  • Any ideas for what I could do next? thanks and much appreciated. I can provide screen shots if needed.
  • I tried to erase the SPI from inside manjaro and installing Tow boot from inside manjaro. but it did not work. when I rebooted. it just booted to manjaro screen. I never saw a line at the bottom of the screen to hit Escape or CTRL C. so eventually it goes to Manjaro login screen again.
  • I've tried with the Switch on the motherboard off and on. if it is on, then it just boots to Emmc and manjaro. if it's off then I only see dark blue screen and red light. it never shows anything no menu.
  • we even tried older versions of SPI.Installer.img as well as newer one.

River-Mochi avatar Nov 24 '22 10:11 River-Mochi

TL_Lim of Pine64 thinks this might be a bug in the Tow-boot Display Driver - so it might be there on my screen but I just can't see it. Similar to the PostmarketOS UBoot, it also does not appear on screen. image

Another Pine64 member with same problem and also has an older PineBook Pro. he said using the special Pine Store UART cable to PinebookPro he can get the Postmaket Uboot menu to appear on a separate screen and it works, he just has to blindly hit ESC, down arrow 3 times, then Enter and it boots to his SD card OS. When he tries it with Tow-Boot the same UART trick he doesn't get a Menu display but gets some errors at least and not an empty screen.

River-Mochi avatar Nov 26 '22 02:11 River-Mochi

SD cards I have , all of them work for Linus distros. All of them boot linux but not Tow-boot (tow-boot could be there but just invisible because of the Display Driver Bug). None of them allow Tow-Boot to display on screen if SPI.installer.img is written to them

Sandisk A1 class 10, 32GB Sandisk A1 class 10, 64GB (several of these) HC MicroSD class 2, 16GB Samsung Pro A2 V30 U3 128GB (several of these )
Some others were also used.

Used BOTH Balena Etcher to write SPI.imstaller.img and inside Manjaro and PostmarketOS also tried to make SD cards with SPi. installer. All of the SD cards work. but the Tow-Boot simply doesn't display on the screen.
Goes from Black screen (off) to dark blue screen and nothing, empty.

River-Mochi avatar Nov 26 '22 02:11 River-Mochi

I can confirm ckykenken's technique of ejecting and inserting the SD card worked with this card image Thanks!

vampirefrog avatar Dec 06 '22 18:12 vampirefrog

I can confirm the issue using the latest version (2021.10-005) on my Pinebook Pro. The workaround described by @ckykenken (ejecting and reinserting the SD Card) worked.

py-crash avatar Jan 26 '23 22:01 py-crash

I confirm @ckykenken workaroung

halletienne avatar Nov 06 '23 01:11 halletienne

In can confirm that https://github.com/Tow-Boot/Tow-Boot/issues/55#issuecomment-946644092 answer works, but I have used the official command of Pine64 wiki instead of dd (mtd-utils package must be installed first):

sudo flashcp Tow-Boot.spi.bin /dev/mtd0

This file is inside the binaries folder of the tar.xz archive.

This seems the cleanest manner of flashing Tow-Boot.

Martin1887 avatar Jan 20 '24 17:01 Martin1887