Followed the blog post to install Fedora: PBP not booting anymore
#1
Hi guys,

So I had Manjaro installed on my eMMC for a while now and I wanted to switch to Fedora.

I went to the official Wiki which redirects us to a blog post from 2021 which I followed.
I flashed the firmware to the micro SD Card


Code:
$ sudo spi-flashing-disk --target=pinebook-pro-rk3399 --media=/dev/sdc1
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdc1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
= Writing idbloader.img for pinebook-pro-rk3399 .... on media /dev/sdc1
348+0 records in
348+0 records out
178176 bytes (178 kB, 174 KiB) copied, 0.00409355 s, 43.5 MB/s
= Writing u-boot FIT image for pinebook-pro-rk3399 .... on media /dev/sdc1
2042+0 records in
2042+0 records out
1045504 bytes (1.0 MB, 1021 KiB) copied, 0.217239 s, 4.8 MB/s
umount: /tmp/fw: not mounted.
rmdir: failed to remove '/tmp/fw': Directory not empty

I didn't really pay attention to the error messages at the beginning nor at the end, I just saw that some data was copied to the micro SD card so I thought it was fine.

Then I opened the case of my Pinebook Pro, disabled the eMMC using the switch 24 (I should have just removed the eMMC actually).
Then I tried to boot with the micro SD card inserted and... absolutely nothing happened even after pluging in the DC barrel.

Now even with the micro SD card removed and the switch 24 enabled my PBP won't boot.
I tried to check the content of the micro SD card with my other laptop (I'm on Fedora) but I'm not able to mount it.


Code:
$ sudo mount /dev/sdc1 /run/media/koenigs/sdcard
mount: /run/media/koenigs/sdcard: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

I don't even understand what went wrong actually, I didn't enter any command to flash the SPI with the firmware from the micro SD card, it just didn't do anything so I didn't even get the opportunity to try it...

Is there any way I can recover from the situation?
I'm a bit worried I screwed my SPI, it seems a bit tricky and risky to follow this procedure so I'd like to avoid it if possible.

Thanks for your answers

EDIT: I understand what I did wrong, I flashed the firmware to the partition sdc1

Code:
$ sudo spi-flashing-disk --target=pinebook-pro-rk3399 --media=/dev/sdc1

I should have done it to the card card's disk scd instead
Code:
$ sudo spi-flashing-disk --target=pinebook-pro-rk3399 --media=/dev/sdc

But my PBP is still not booting after fixing the micro SD card.

Did I screw my SPI???  Confused
  Reply
#2
Well, at the end I was able to access the boot prompt after disconnecting the NVMe SSD and pressing the "reset" button next to the CPU.

I typed the commands like in the blog post 

Quote:Hit any key to stop autoboot:  0
=> ls mmc 1:1
  167509  idbloader.img
  335872  idbloader.spi
  975872  u-boot.itb
  9331712  u-boot-rockchip.bin

4 file(s), 0 dir(s)

=> sf probe
SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB

=> load mmc 1:1 ${fdt_addr_r} idbloader.spi
335872 bytes read in 39 ms (8.2 MiB/s)

=> sf update ${fdt_addr_r} 0 ${filesize}
device 0 offset 0x0, size 0x52000
61440 bytes written, 274432 bytes skipped in 0.803s, speed 427777 B/s

=> load mmc 1:1 ${fdt_addr_r} u-boot.itb
975872 bytes read in 107 ms (8.7 MiB/s)

=> sf update ${fdt_addr_r} 60000 ${filesize}
device 0 offset 0x60000, size 0xee400
914432 bytes written, 61440 bytes skipped in 9.415s, speed 106127 B/s

I flashed my eMMC with Fedora-KDE-38-1.6.aarch64.raw.xz, put the eMMC back and tried to boot MANY times but nothing happens even when re-inserting the micro SD card and removing/disabling the eMMC.

I think I didn't do any mistake while flashing the SPI but I can't be sure because I forgot to take a photo of what I actually did...
I think I'm good to order a pry tool on Amazon to I can access the SPI and follow the procedure I didn't want to do...  Cry
  Reply
#3
where you may have gone wrong is using u-boot.itb on the spi
Just a guess
It migth be simpler to compile rkdeveloptool to blank the spi
You do have to find miniloader.bin suitable for the hardware
(this is what initializes mem and usb ports),,, ie
rkdeveloptool ld (it will say loader or maskrom, maskrom is what you want, remove ALL media)
rkdeveloptool rd 3 (only if needed, changes it to maskrom), check with ld
rkdeveloptool db miniloader.bin..... and now rkdeveloptool will do every command
---
mkimage comes with uboot (for boot.cmd/boot.scr),, the command is
mkimage -C none -A arm -T script -d boot.cmd boot.scr
--------------------
or maybe simpler, short spi clock pin to ground the first 5 sec of boot, then it can't interfere
Assumes you have a bootable sd or emmc
  Reply
#4
(05-30-2023, 08:22 PM)wdt Wrote: where you may have gone wrong is using u-boot.itb on the spi
Just a guess
It  migth be simpler to compile rkdeveloptool  to blank the spi
You do have to find miniloader.bin suitable for the hardware
(this is what initializes mem and usb ports),,, ie
rkdeveloptool ld (it will say loader or maskrom, maskrom is what you want, remove ALL media)
rkdeveloptool rd 3 (only if needed, changes it to maskrom), check with ld
rkdeveloptool db miniloader.bin..... and now rkdeveloptool will do every command
---
mkimage comes with uboot (for boot.cmd/boot.scr),, the command is
mkimage -C none -A arm -T script -d boot.cmd boot.scr
--------------------
or maybe simpler, short spi clock pin to ground the first 5 sec of boot, then it can't interfere
Assumes you have a bootable sd or emmc

Thanks for your answer but after searching on the internet about this "miniloader.bin" I could find literally nothing about it...

But anyway, I actually just found out WHAT I DID WRONG:
I didn't read correctly the blog post and I wrote the u-boot.itb at offset 6000 instead of 60000  Dodgy

The day after I screwed up my SPI, someone posted a new blog post on Reddit on how to install Fedora on the RockPro64 so I'm 99% sure it will work the same way on my Pinebook Pro if at least I can correctly write u-boot to the SPI without doing any mistake...

The way to enter in Maskrom with the recover and reset buttons doesn't work for me so I'm still waiting for the pry tools I ordered to arrive.
  Reply
#5
RK3399MiniLoaderAll_V1.09.bin RK3399MiniLoaderAll_V1.12.bin RK3399MiniLoaderAll_V1.15.bin RK3399MiniLoaderAll_V1.19.bin
  Reply
#6
I managed to enter in Maskrom this morning by short-circuiting the SPI pins.
I erased the SPI with all zeros then I flashed the SPI again but this time at offset 60000 for u-boot.itb.
At last I copied Fedora ARM on the eMMC using an USB-eMMC adapter and put it back in the PBP!

Everything is working now, I don't know what is this miniloader thing but I didn't need it
  Reply
#7
Shorting the SPI clock does NOT get you into maskrom, it just disables the SPI while shorted
rkdeveloptool is a utility from Rockchip, mostly for soldered emmc's
It is to manage a device that is in maskrom
If you don't use rkdeveloptool then miniloader is of no use
If you ever "do" TV boxes, then you will use rkdeveloptool or something simlar or some windows tool
miniloader does something like idbloader, and for rkdeveloptool it is necessary
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Does latest Tow-Boot install/work correctly for everyone? tophneal 4 2,250 08-03-2023, 03:30 PM
Last Post: tophneal
  I'm booting from NVME but I want to switch back to eMMC acruhl 4 1,679 04-23-2023, 06:58 AM
Last Post: acruhl
Exclamation PineBook Pro shuts down immediately after booting zogkarndon 5 2,268 01-10-2023, 10:16 AM
Last Post: Perl6_user
  Use SD to install new OS over pinebook debian Rudy558 9 11,249 09-25-2022, 01:19 AM
Last Post: jackwilson
  MiniConda Install Issues nixyhustle 0 864 09-16-2022, 10:06 PM
Last Post: nixyhustle
  Does anyone know how to install levinsboot on pbp? computerc 0 685 09-05-2022, 03:52 PM
Last Post: computerc
Big Grin EASY SOLUTION for Manjaro "Missing Keys" Update and Install Failure Zoroaster-Z 0 1,510 08-14-2022, 09:01 PM
Last Post: Zoroaster-Z
  Total Noob. Need help booting from SD Mattchublean 18 14,197 07-23-2022, 11:54 PM
Last Post: LivingLinux
Wink Booting Windows on bare-metal rk3399 SBC (no linux involved) strongtz 9 10,957 05-26-2022, 11:36 PM
Last Post: strongtz
  PInebook not booting with eMMC enabled aragaer 4 4,474 10-25-2021, 09:11 PM
Last Post: wdt

Forum Jump:


Users browsing this thread: 1 Guest(s)