Rkdeveloptool is not able to erase the SPINOR flash

I was testing that I have the capability to erase the SPINOR flash in case this one has a dirty content, not able to boot, but sufficiently good to let the boot process try to boot on it (SPINOR has priority over external MMC). my conclusion was that rkdeveloptool doesn’t do the job as expected.

My testing process:

sudo rkdeveloptool db rk3588_spl_loader_v1.15.113.bin
sudo rkdeveloptool ef
sudo rkdeveloptool rd
  • Testing the SPINOR content => still the previous one.

I wonder if there is a special rk3588_spl_loader specialized for SPINOR or if rkdevloptool is not able to tell which flash device it targets…

To respond to myself, I patched rkdevtoptool to gain the SPINOR access.
see https://forum.radxa.com/t/patched-rkdeveloptool-with-full-access-to-spinor-device/25702

What do you mean you want to ease spinor flash? You want to install firmware onto eMMC so that you want to erase SPINOR flash or the other way round (you tried to install image onto nvme and die to boot failure you wanted to erase SPINOR flash) .
I was trying to flash some custom Android 12 ROM for 5b+ from here and I tried to boot these firmware from nvme SSD but I couldn’t succeed no matter what I do.
Could you help me install the custom firmware onto nvme ? What exactly does your patched rkdevtool it how exactly can I use it to make a firmware boot from nvme ?

My rk3588 board, Rock5 ITX has SPINOR (16MB), eMMC (8GB). I don’t know for Rock5B.
Since SPINOR has higher boot priority than eMMC, if for some reasons I flash garbage into SPINOR, my system will not being able to boot at all. That’s why being able to erase the SPINOR flash from Maskrom mode was a “Must have feature” before doing any experimentation. (Now, I also know there is another way to force booting of external SD card whatever the content of SPINOR or eMMC is but I didn’t know at that time).

The patch I add to rkdevelotool now gives all the flexibility to work on SPINOR or eMMC content by erasing/reading/writing any arbitrary part of those devices. This is very convenient for experimentation, hacking or development.

For your Android question, It really depends of what the Android boot process is expecting to find to be installed on NVME. I can only describe how the armbian/uboot process works and you can see on your side if the android way is the same.
On an armbian install:

  • rk3588 is looking for IDBlock at offset 0x8000 of SPINOR, then eMMC, then SD. the first valid IDBlock is used to load the DDR init, and the uboot SPL.
  • DDR init initialize the DDR
  • uboot SPL performs the loading of next components looking at offset 0x800000 of various flash devices (eMMC, SD, SPINOR, order depending on how u-boot was built). Usually, it consists of ATF + uboot (post SPL).
    So ATF and uboot are loaded, and uboot did the rest of init: search for a kernel image in all possible block devices (eMMC, MMC, NVME drive, USB drives, network etc…) and boot on this kernel.

As you can see, lots of booting parts are split: you can have the first one (DDRinit+SPL) in SPINOR, the second (ATF+uboot) in eMMC and the third (linux kernel) on NVME.
That’s also why it is important to be able to clean those devices first to really be sure of the booting process.

I never looked at the way Android is booting. But I highly suggest to add a serial console to your board to follow the booting process. It will be the only way the understand the various steps.
Then I would first starts to flash a booting image only on SD card, cleaning eMMC and SPINOR to be sure only the SD card will be used by the boot. Thanks to the serial console, I would see what parts are used and how they are placed on the SD card.
Identifying the various parts on the SD card, I would be able to move them on other devices, and see if it work or not.

2 Likes

This information is beyond my comprehension level. I am not an engineer but just a tech enthusiast.
I get your point in dissecting the problem and to do that I need to have some tools to see where exactly the problem lies in successfully booting Android from nvme.
It’s better I should wait for some expert(mo123) to cook a firmware which installs on nvme without problem. I thought I could try but the way you explained it and so many factors involved at different levels I am out of this experiment simply because I don’t have enough knowledge in this field.

Thanks for your valuable time and information.