Built Android, How do I flash

Hi

Ive managed to compile the Android from source using Ubuntu 18.04 in a VM on windows 10.
So far so good.

Its created many files in the /out folder as expected. but how what images are used in flashing the device?

I’ve tried flashing the uboot image but get no output on the uart pins. its also only 4.2mb in size not the 16mb that is used for booting the radxa supplied android

It also doesn’t create a rk3588-spl-loader.bin file although there is a miniloaderall.bin file, is this the one to use?

Any help in flashing a modified uboot would be great

many thanks
Spriggsy

I think i’m beginning to understand this a little

please correct me if i’m wrong

Ive uploaded the U-boot image to spi flash using this guide
https://wiki.radxa.com/Rock5/install/spi

I think this is a minimal uboot version that will allow booting from other medias?

Ive then built that android image as per this guide
https://wiki.radxa.com/Rock5/guide/android12

using the all in one script.
it states that everything completes correctly, however flashing the generatedimage fails.

looking at the logs it seems to be trying to copy the Android image to the spi flash

when flashing the Radxa supplied image the logs state this line:

17:42:13 797 <LAYER 2-1> INFO:Start download image,total=5277184,band=8,DirectLBA=1,First4Access=1,Gpt=1
17:42:14 136 <LAYER 2-1> INFO:Start to download uboot,offset=0x4000,size=5242880
17:42:47 100 Layer<2-1>:Download Firmware Success

however when flashing my image i get this:

17:33:57 556 <LAYER 2-1> INFO:Start to download uboot,offset=0x4000,size=4194304
17:34:23 611 <LAYER 2-1> ERROR:RKA_File_Download–>Partition offset is larger than flash size, partition=misc,partition_offset=0x00008000,flash_size=0x00008000
17:34:23 611 <LAYER 2-1> ERROR:DownloadImage–>RKA_File_Download failed(misc)
17:34:23 620 Error:Layer<2-1>:Download Firmware Fail

any ideas?

many thanks
Spriggsy

Heres the logs from a succesful upload of the official image
https://pastebin.com/NnSa0jdv

and the log from a failed upload from my image

the Successful ones seems to upload uboot first then switched the device to loader mode before continuing.

where as my image does not do this.

@spriggsy Did you find out the way?
As far as I understand you get few disk images that you need to dd with right offsets. I think the debian guide had offsets specified.

not yet, I saw the offsets in one off the guides. I’ve put this on the back burner for now as without have a NVME caddy its quickly going to get tedious copying files over between devices.

Was hoping this would be easy. It should be as Radxa have already done it. Somehow

Spriggsy

They are using AOSP to build Android. May be AOSP documentation can be useful. AFAIK several img files are created for each partition. These are under out/target/product/device/ to be specific out/target/product/RadxaRock5B/ . From these and operating system image can be built using mkbootimg/abootimg. AFAIK AOSP does not contain kernel and it is expected to be provided by soc provider.

@spriggsy I suspect I found what needs to be done. I am away from home for few days and will be able to try it in 2 days.
In short if you run the full build script from the radxa guide you will get a gpt.img file. You should be able to dd it to an eMMC and vola.

https://wiki.radxa.com/Rock5/guide/android12
The detailed/step-by-step portion of the radxa guide specifies a command that needs to be executed. radxa:rock-android12/rockdev $ ./android-gpt.sh I assume that was the command generating OS image that has others included. I see it has 14 partitions.

Thanks for your help with this,

Ive stuck it on the back burner for now as was losing heart in it. there’s a lot more bits to this project that also need attention so have been working on these. Ill try and get a NVME usb caddy and try DD’ing it across later.

Thanks

I had a chance to try it and it worked with dd ing into emmc.
I didnt try any other boot medium because even the current release from radxa has problems with them. At least I only could boot it from emmc. I am using a device similar to this
USB3.1 to eMMC Reader/Writer – ALLNET China

just do a ./build.sh -UCKAupJ( x cores)

and it builds a update.img and a gpt img to make a spi nvme image you need some additional files in rktools .

here a custom manifest for the rkr12 sdk

just replace the line

repo init -u https://github.com/radxa/manifests.git -b Android12_RK3588_Radxa_rk8 -m rockchip-s-release.xml

with

repo init -u https://github.com/Shaggy013/manifests.git -b Raxda_12.1 -m default.xml

and just follow rest of the guide

https://wiki.radxa.com/Rock5/guide/android12

Thanks for trying to help.

Ive just tried this, it builds the Uboot image ok but then but it fails when trying to build the kernel?
The error i get is

HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
YACC scripts/kconfig/parser.tab.[ch]
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
HOSTLD scripts/kconfig/conf
configuration written to .config

Using .config as base
Merging ./kernel/configs/android-11.config
Value of CONFIG_CIFS is redefined by fragment ./kernel/configs/android-11.config:
Previous value: CONFIG_CIFS=y
New value: # CONFIG_CIFS is not set

Value of CONFIG_CIFS_XATTR is redefined by fragment ./kernel/configs/android-11.config:
Previous value: CONFIG_CIFS_XATTR=y
New value: # CONFIG_CIFS_XATTR is not set

Value of CONFIG_CIFS_POSIX is redefined by fragment ./kernel/configs/android-11.config:
Previous value: CONFIG_CIFS_POSIX=y
New value: # CONFIG_CIFS_POSIX is not set

Value of CONFIG_CRYPTO_MD4 is redefined by fragment ./kernel/configs/android-11.config:
Previous value: CONFIG_CRYPTO_MD4=y
New value: # CONFIG_CRYPTO_MD4 is not set

Value of CONFIG_DEVMEM is redefined by fragment ./kernel/configs/android-11.config:
Previous value: CONFIG_DEVMEM=y
New value: # CONFIG_DEVMEM is not set

Value of CONFIG_IKHEADERS is redefined by fragment ./kernel/configs/android-11.config:
Previous value: CONFIG_IKHEADERS=m
New value: CONFIG_IKHEADERS=y

Value of CONFIG_GKI_HIDDEN_GPU_CONFIGS is redefined by fragment ./kernel/configs/android-11.config:
Previous value: # CONFIG_GKI_HIDDEN_GPU_CONFIGS is not set
New value: CONFIG_GKI_HIDDEN_GPU_CONFIGS=y

Value of CONFIG_UNICODE_NORMALIZATION_SELFTEST is redefined by fragment ./kernel/configs/android-11.config:
Previous value: # CONFIG_UNICODE_NORMALIZATION_SELFTEST is not set
New value: CONFIG_UNICODE_NORMALIZATION_SELFTEST=y

Value of CONFIG_KSM is redefined by fragment ./kernel/configs/android-11.config:
Previous value: # CONFIG_KSM is not set
New value: CONFIG_KSM=y

Value of CONFIG_ZRAM_WRITEBACK is redefined by fragment ./kernel/configs/android-11.config:
Previous value: # CONFIG_ZRAM_WRITEBACK is not set
New value: CONFIG_ZRAM_WRITEBACK=y

merged configuration written to .config (needs make)

configuration written to .config

scripts/kconfig/Makefile:93: *** No configuration exists for this target on this architecture. Stop.
Makefile:627: recipe for target ‘rock5b.config’ failed
make[1]: *** [rock5b.config] Error 2
Makefile:350: recipe for target ‘__build_one_by_one’ failed
make: *** [__build_one_by_one] Error 2

failed to build some targets (9 seconds)

I know that my build environment is set up as I can still successfully build the Radxa supplied version.

ow yeah
just update the xml from git and remove kernel and do a sync
or
those files are in mkcombinedroot/configs you can also manual symlink or copy them to kernel-5.10/kernel/configs