Tinker Board Forum

Full Version: [TUTORIAL] Build a Tinker Board development image
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi Tinker fellas !! 

I've finally managed to find some time to build another image from scratch and to propose a tutorial to build a Tinker board development image. Keep in mind that the method is not 100% reliable and highly depends on the current development stage of the different Rockchip development repository.

Moreover, IT DOES NOT SUPPORT WIFI AND BLUETOOTH, SO NO WIFI/BLUETOOTH ANYMORE. 

You will need a Ubuntu 16.04 LTS 64 bits on a computer to be able to build the image. Then open a terminal and put the following commands.
First we need to install the required dependencies :
Code:
sudo apt-get install git-core gitk git-gui gcc-arm-linux-gnueabihf u-boot-tools device-tree-compiler gcc-aarch64-linux-gnu mtools parted build-essential binfmt-support qemu-user-static python-dbus python-debian python-parted python-yaml python-apt python-support libssl-dev

Retrieve the required sources from GitHub and start to build u-boot :

Code:
mkdir tinkeroscustom
cd tinkeroscustom/
git clone https://github.com/rockchip-linux/kernel.git
git clone https://github.com/rockchip-linux/u-boot.git
git clone https://github.com/rockchip-linux/rk-rootfs-build.git
git clone https://github.com/rockchip-linux/build.git
build/mk-uboot.sh miniarm
cd rk-rootfs-build/

The next command triggers a lot of errors but it looks like it is normal...

Code:
sudo dpkg -i ubuntu-build-service/packages/*

The next command tries to correct the missing dependencies from previous command :

Code:
sudo apt-get install -f

Execute next command to prepare linaro archive :

Code:
TARGET=desktop ARCH=armhf ./mk-base-debian.sh

Next command generates a lot of errors... looks like it is normal as it is still generating a file :

Code:
ARCH=armhf ./mk-rootfs.sh
./mk-image.sh

At this point, you should have a linaro-rootfs.img file of more than 1.7 GB in the current directory.
Now let's build the kernel :

Code:
cd ..
build/mk-kernel.sh miniarm

There is again a problem with a file configuration. Now it is file located in build/extlinux/rk3288.conf, I have to fix the block device id from 2 to 0 :

Code:
label kernel-4.4
    kernel /zImage
    fdt /rk3288-miniarm.dtb
    append  earlyprintk console=tty1 console=ttyS2,115200n8 rw root=/dev/mmcblk0p7 rootfstype=ext4 init=/sbin/init

Then execute commands :

Code:
build/mk-image.sh -c miniarm -t boot
build/mk-image.sh -c miniarm -t system -s 4000 -r rk-rootfs-build/linaro-rootfs.img
cd out/

If you have survived until here, you should have a "system.img" file in the current directory. It is the SD card image file ready to be copied ! You can test your custom image and don't hesitate to post if you have tweaks or report bugs on the corresponding rockchip-linux GitHub project ! If anyone is interested, I will post next time how to build a custom kernel.
Enjoy !!

EDIT: 
Link to a built image WITHOUT wifi/bluetooth : 2017.04.09
Install it like any other Tinkerboard image. It contains a custom kernel built as a preemptive kernel and ondemand performance governor with autofs4, brtfs, reiserfs, raid, fat32, ntfs, cifs support. Do not dist-upgrade or upgrade packages, it is breaking the X server.
Thanks Gooze74!

About the audio jack, I've been playing audio on my Tinker Board since receiving it, ALSA is reporting the codec as a USB audio device, the internal CODEC is only going to I2S, after a pin verification might be able to test it with an IQaudio DAC.  

Code:
linaro@linaro-alip:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Audio [USB Audio], device 0: USB Audio [USB Audio]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 1: USB Audio [USB Audio #1]
 Subdevices: 1/1
 Subdevice #0: subdevice #0
card 0: Audio [USB Audio], device 2: USB Audio [USB Audio #2]
 Subdevices: 0/1
 Subdevice #0: subdevice #0
card 1: rockchipminiarm [rockchip,miniarm-codec], device 0: ff890000.i2s-i2s-hifi i2s-hifi-0 []
 Subdevices: 1/1
 Subdevice #0: subdevice #0
linaro@linaro-alip:~$
Many thanks for the tutorial!

Going to try it very soon.

Btw, is it possible to use any info from here;
https://forum.armbian.com/index.php?/top...ment=27411
(or possibly direct here: https://github.com/igorpecovnik/lib/comm...d9b5355d36)?

//Per
Thanks tonymac32 and [b]Perus,[/b]

I don't know if info from armbian are possible to use.
Is there any advantages compared the provided rootfs ?

I am still waiting for better 2D performance in Xorg for the Tinker board, IMO there are not sufficient for video playback.
I'm currently trying to get Armbian to boot on the Tinker, it's not cooperating (and I'm learning how the build system works at the same time... Undecided) I'm not getting around some config issue in U-Boot, I think it has something to do with it trying to access the eMMC that doesn't exist, but I can't be certain yet.
(03-15-2017, 04:43 AM)tonymac32 Wrote: [ -> ]I'm currently trying to get Armbian to boot on the Tinker, it's not cooperating (and I'm learning how the build system works at the same time... Undecided)  I'm not getting around some config issue in U-Boot, I think it has something to do with it trying to access the eMMC that doesn't exist, but I can't be certain yet.

This could be down to flashing the uBoot it needs to be slightly different for emmc, sdcard or udisk.

Try this...........

tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin out
cat u-boot-dtb.bin >> out
sudo dd if=out of=/dev/sdb seek=64 conv=notrunc
(03-17-2017, 10:10 AM)ukrollergirl Wrote: [ -> ]
(03-15-2017, 04:43 AM)tonymac32 Wrote: [ -> ]I'm currently trying to get Armbian to boot on the Tinker, it's not cooperating (and I'm learning how the build system works at the same time... Undecided)  I'm not getting around some config issue in U-Boot, I think it has something to do with it trying to access the eMMC that doesn't exist, but I can't be certain yet.

This could be down to flashing the uBoot it needs to be slightly different for emmc, sdcard or udisk.

Try this...........

tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin out
cat u-boot-dtb.bin >> out
sudo dd if=out of=/dev/sdb seek=64 conv=notrunc

!!!!   That worked to get U-boot going, this noob moment brought to you by your truly.  ;-)  Thank you!

Now to remedy the errors concerning not finding the device tree...
(03-19-2017, 06:24 PM)tonymac32 Wrote: [ -> ]
(03-17-2017, 10:10 AM)ukrollergirl Wrote: [ -> ]
(03-15-2017, 04:43 AM)tonymac32 Wrote: [ -> ]I'm currently trying to get Armbian to boot on the Tinker, it's not cooperating (and I'm learning how the build system works at the same time... Undecided)  I'm not getting around some config issue in U-Boot, I think it has something to do with it trying to access the eMMC that doesn't exist, but I can't be certain yet.

This could be down to flashing the uBoot it needs to be slightly different for emmc, sdcard or udisk.

Try this...........

tools/mkimage -n rk3288 -T rksd -d spl/u-boot-spl-dtb.bin out
cat u-boot-dtb.bin >> out
sudo dd if=out of=/dev/sdb seek=64 conv=notrunc

!!!!   That worked to get U-boot going, this noob moment brought to you by your truly.  ;-)  Thank you!

Now to remedy the errors concerning not finding the device tree...
no problem.  If you want post the errors your having around the device tree im happy to have a look. When I get a chance I'll write up my build end to end doc and then maybe it can be used as a guide for others and we can make it revision controlled etc. Best tip is actually tackle the errors you see, going past them and hoping for the best generally means something later will break Smile
The error was quite simple, actually, U-Boot was looking for "/boot/dtb/rk3288-miniarm " and the file was actually "/boot/dtb/rk3288-miniarm.dtb"

I posted the adjustments to the Armbian forum, I'm afraid to do a pull request for fear of breaking their build environment for the MiQi, which I don't have to test. I've booted successfully to the Xenial desktop, browsed the web, etc.

https://forum.armbian.com/index.php?/top...rd/&page=2
Hello,
when I tried to make u-boot I get the following error:
build/mk-uboot.sh miniarm
board 'miniarm' not supported!

Any ideas?
Pages: 1 2 3