After blowing up my ATX power supply, and learning such things as “FULL” power supplies do exists, I finally managed to build Android for Tronsmart Orion R28 using the provided SDK. I haven’t tried to load it on the device yet, but the build could complete successfully after following the steps below in Ubuntu 14.04. The SDK is probably not specific to one device, so it might just also work on other RK3288 TV boxes and tablets.
First download Android 4.4 SDK for RK3288, or use the one in the micro SD card provided with the Beta version of R28 Pro and Meta.
Install some dependencies:
1 2 3 4 5 |
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev \ squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 \ libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev \ lib32readline-gplv2-dev gcc-multilib libswitch-perl gcc-arm-linux-gnueabi lzop libncurses5-dev \ libssl1.0.0 libssl-dev |
Extract the SDK:
1 |
tar xvf Orion_R28_SDK_doc.tar.gz |
And build the kernel first:
- Enter the kernel directory:
1cd RK3288_R-BOX_ANDROID4.4.2-SDK_V1.0.0/kernel/ - Change arch/arm/boot/dts/Makefile to use RK3288 device tree file instead of an RK3188 (may not be needed, but the build failed for me without that change…):
1dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3288-box.dtb
It’s also quite possible you need to extract the device tree file from your firmware or device. - Building the kernel and resources (device tree + logo) images:
123make ARCH=arm rockchip_box_defconfigmake rk3288-box.img -j8cd.. - Done
It will fail with:drivers/usb/dwc_otg_310/dwc_otg_hcd.c: In function ‘dwc_otg_hcd_rem_wakeup_cb’:
drivers/usb/dwc_otg_310/dwc_otg_hcd.c:446:31: error: inlining failed in call to always_inline ‘dwc_otg_hcd_to_hcd’: function body not available Edit the culprit file, remove the inline directive, and continue the build:
1<del>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-</del>Similar errors will occur one or twice more, so repeat step 5 as needed….Create kernel.img (not sure the command line is correct)
12<del>./mkkrnlimg arch/arm/boot/Image kernel.img rk3288-boxcd..</del>
Before building Android, you need to make sure you use the right version of Java. I recently build AOSP for ARMv8 which requires OpenJDK 1.7 in Ubuntu, but this version requires Oracle 1.6 SE. At first I used JDK 6u45 (1.6.045), but I got some errors:
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
out/target/product/rk3288/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]
Based on a thread on XDA developer forums, I installed Java 1.6.0.27 instead, which you can download here:
1 2 3 4 |
chmod +x jdk-6u27-linux-x64.bin ./jdk-6u27-linux-x64.bin sudo mkdir -p /usr/lib/jvm sudo mv jdk1.6.0_27/ /usr/lib/jvm/ |
Now add the new Java version to the “alternatives”:
1 2 3 4 5 6 |
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_27/bin/java 1 sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_27/bin/javac 1 sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.6.0_27/bin/javap 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_27/bin/javaws 1 sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_27/bin/javadoc 1 sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk1.6.0_27/bin/javah 1 |
and make sure Java 1.6.0.27 is used by default:
1 2 3 4 5 6 |
sudo update-alternatives --config java sudo update-alternatives --config javac sudo update-alternatives --config javap sudo update-alternatives --config javaws sudo update-alternatives --config javadoc sudo update-alternatives --config javah |
I’m not sure all six tools need to be configured, but it probably does no hurt to do so.
Finally, you just need to run a script to build Android:
1 |
./3288.sh |
Be patient, and it should finish with something like:
Creating filesystem with parameters:
Size: 1073741824
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 4096
Label:
Blocks: 262144
Block groups: 8
Reserved block group size: 63
Created filesystem with 1792/65536 inodes and 149182/262144 blocks
+ '[' 0 -ne 0 ']'
Install system fs image: out/target/product/rk3288/system.img
out/target/product/rk3288/system.img+out/target/product/rk3288/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p maxsize=1096212480 blocksize=135168 total=598297319 reserve=11083776
TARGET_PRODUCT=rk3288
TARGET_HARDWARE=rk30board
system filesysystem is ext4
make ota images...
create boot.img with kernel... done.
create recovery.img with kernel... done.
create misc.img.... done.
create system.img... done.
*******************************
3288_4.4 sdk do finish
*******************************
All relevant files can be found in rockdev/Image-rk3288 directory:
1 2 3 4 5 6 7 8 |
6.7M Sep 17 10:53 boot.img 5.6M Sep 17 10:53 kernel.img 48K Jun 19 11:11 misc.img 48K Jun 19 11:11 pcba_small_misc.img 48K Jun 19 11:11 pcba_whole_misc.img 9.6M Sep 17 10:53 recovery.img 113K Sep 17 10:53 resource.img 573M Sep 17 10:53 system.img |
Next step is to flash it to the device, and see if it can boot.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
My instructions for the kernel part of not correct based on a comment on G+: https://plus.google.com/u/0/110719562692786994119/posts/MyGmGKPY4jF
Looks like I need to run:
make kernel.img
then
make rk3288-box.img
I’ll check that tomorrow. Now… relax and sleep time 🙂
While you sleep the bugs will play?
Step 2: rk3288-box.dts not rk3288-box.dtb
Step 3: CROSS_COMPILE=/RK3288_R-BOX_ANDROID4.4.2-SDK_V1.0.0/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi
I tried this just for the kernel and got a screen displaying “Google TV” … in pink though as my device seems ,,,
@Ian W MORRISON (Linuxium)
For step2… the rest of the Makefile is filled with dtb files…
The original line is:
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3188-tb.dtb
I can see both rk3288-box.dts and rk3288-box.dtb in arch/arm/boot/dts, but I suppose the dtb file is generated from the dts, so maybe both are OK?
@Jean-Luc Aufranc (CNXSoft)
No, use rk3288-box.dtb (I thought it fixed something else, but it didn’t!)
Hi
i downloaded the RK3288_R-BOX_ANDROID4.4.2-SDK_V1.0.0/ for Tronsmart.
I wan to to make a kernel for HPH RK3288 Box.
I extracted the kernel.dtb file and converted it to a *.dtd file from the resource.img. What must I do with this file now? Should I just make a normal kernel and flash the kernel and stock resource.img to my box?
@mo123
You can place the dtd file (e.g. rkdevice3.dtd) in the source tree, and generate the image:
make rkdevice3.img -j8
Then follow instructions @ http://www.cnx-software.com/2014/09/17/creating-and-flashing-an-android-image-from-rockchip-rk3288-sdk/ to flash it?
@Jean-Luc Aufranc (CNXSoft)
Thanks
Anyone already downloaded the Firefly RK3288 SDK and can only upload the kernel?
https://bitbucket.org/T-Firefly/firefly-rk3288/overview
Here is the kernel seperate but it’s much older
https://bitbucket.org/TeeFirefly/firefly-rk3288-kernel
it takes too long to download from baidu and cloning the repo takes ages.
Already have the Tronsmart SDK, since it was uploaded to mega.
@mo123
I’ve never managed to retrieve the code from bitbucket, it will just end up in error, maybe because the connection is unreliable. Tronsmart SDK is a little old, but maybe the kernel is OK.
There’s also another kernel @ https://github.com/rkchrome/kernel, but maybe not for Android.
If i try to install the dependencies i het this error in ubuntu ~$ sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev pngcrush schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib libswitch-perl gcc-arm-linux-gnueabi lzop libncurses5-dev libssl1.0.0 libssl-dev Reading package lists… Done Building dependency tree Reading state information… Done E: Unable to locate package squashfs-tools E: Unable to locate package libxml2-utils E: Unable to locate package lib32readline-gplv2-dev E: Unable to locate package libssl1.0.0 E: Couldn’t find any package by regex ‘ libssl1.0.0’ kraakie256@ubuntu:~$ kraakie256@ubuntu:~$ Read more: http://www.cnx-software.com/2014/09/16/how-to-build-android-4-4-sdk-for-rk3288-tronsmart-orion-r28-beelink-r89/#ixzz3Mpg1RQbS What… Read more »
@kraakie
Maybe you have a different version of Ubuntu. I have Ubuntu 14.04.
Run “aptitude search libssl” or “aptitude search libssl1” to find which version is available on your system.
@Jean-Luc Aufranc (CNXSoft)
I found the problem copy paste issue thnx 🙂
But what i am wondering do i have to run make kenrel.img in the kernel folder or make make rk3288-box.img -j8 ? after the deconfig command of course ?
@Ian W MORRISON (Linuxium)
@Jean-Luc Aufranc (CNXSoft)
Managed to produce a binary under fedora using the toolchain in the SDK as 32b gcc would not compile. Hijacking the thread, does anyone know how to enable RT2X00 USB wifi modules? CONFIG_RT2X00=m gets overwritten when issuing make ARCH=arm. Ralink does not appear in make menuconfig.
To answer my own post, solved this by pulling /drivers/net/wireless/ Kconfig & Makefile from
the vanilla http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.37.tar.xz
There is a mistake in the article
sudo update-alternatives –install /usr/bin/javadoc javah /usr/lib/jvm/jdk1.6.0_27/bin/javah 1
should be
sudo update-alternatives –install /usr/bin/javah javah /usr/lib/jvm/jdk1.6.0_27/bin/javah 1