Category Archives: Embedded

Easy way to build Rock960 ARM64 system image.

Why need to do this?

96Board developing team only provides armhf ( arm 32bit ) pre-build images in officially. But some people as like me, are need to use AARCH64 for better performance. This article is for people who demands runs Rock960 board on AARCH64.

Preparation

  • x86.64bit debian based Linux, recommends ‘Linux Mint 18.x’.
  • Make sure your linux ‘up to date’ by these
    • sudo apt-get update
    • sudo apt-get upgrade
  • These packages to be installed before start.
    • git related
      • repo git-core gitk git-gui gcc-arm-linux-gnueabihf u-boot-tools device-tree-compiler gcc-aarch64-linux-gnu mtools parted pv libssl-dev
    • some others
      • binfmt-support qemu-user-static python-dbus python-debian python-parted python-yaml
    • use  sudo apt-get install ... with above packages to be installed.
  • Some other tool binaries, ‘rkdeveloptool’ and ‘k3399_loader_v1.12.112.bin’.
    • Recommend to install ‘rkdeveloptool’ to your system – ‘/usr/local/bin’.
    • ‘rkdeveloptool’ is placed in ‘rkbin/tools’, or refer to my prebuilt image archive.

Clone Rock960 repositiory

There’s may many ways to getting source codes, but I recommend to do this way with your git client. And we before start, make a directory to identify where we are starting rock960 building work, so I recommend to make ‘rock960dev’ directory on your home ( ~, or ${HOME} ).

Then, let’s do these, remember – this work takes may long long waiting …

Build kernel and u-boot

You may waited for long time to be done, now we need keep moving to next step to build kernel and u-boot. these are important your board works to ARM64(AARCH64).

And remember, Rock960 board model name is ‘rock960ab’, or if you bought ‘C’ model ( no built-in eMMC model ) means ‘rock960c’ – it’s little bit different model but same platform of RK3399.

Our journey will be started in ~/rock960dev, and type like these.

This works generates each ‘.config’ files in kernel and u-boot directory with default ‘rock960ab’ model configurations. You can change kernel options with ‘menuconfig’ in kernel directory with make ARCH=arm64 menuconfig.

Build file system

All linux ( or Windows, or Android too ) need file system that contains many things like busybox and desktop ( X11 ) for doing something. So we need build file system.

First thing to do, is install some packages in local ( don’t need to consider failure while install these, just skip them if met failure screen ) in ‘rootfs’ directory.

Le’ts move to ‘rootfs’ and your current directory path will be ‘ ~/rockdev/rootfs’, then let’s do this for once.

Now, time to build desktop system !

Just a wait, you didn’t minded to build desktop (LXDE) build ? Just change TARGET to what you wnated – maybe server with ubuntu release ?

And it may takes really long waitness, drink a beer and fish&chips. Or a cup of coffee. Or continue to tomorrow.

Make a system.img

Everytime you done each work, all generated file copies to ‘rock960dev/out’ directory except root file system ( it generates linaro-rootfs.img in rootfs directory ). So when we reached to step for making file system done, now it need to make it a whole image as know as ‘system.img’.

Now let’s move to rock960dev directory, then proceed this.

A file ‘system.img’ will be generated in ‘out’ directory.

Flashing your image to Rock960 board !

Now it is left only for last step of flashing new image to eMMC.

Let’s make your datas backed up to somewhere in Rock960 board, then step inside to flash eMMC and new 64bit linux with ‘MASKROM’  and ‘RESET’ buttons on board. Press them together and release only ‘RESET’ to enter ROM writing mode.

Now flashing them all

 

Rock960 debian stretch prebuild system image for AARCH64

Currently 96rock’s (VAMRS) Rock960 board officially published for debian stretch image for 32bit ( they aren’t published for AARCH64 ), so I rebuilt their open source for supporting nvative AARCH64 at all with bundled LXDE.

Download link:

https://mega.nz/#!cp1wRSZS!Lg35IENdY7eyzCLT5PpYZc81b3XCZexUYq9n46YP_ig

This compressed binary contains many things: seperately kernel and u-boot image. But you don’t have to flash them in each, just use rkdeveloptool in toolbin.

 Walkthrough:

  • Extract compressed file to somewhere to use them easily.
  • Move to extracted path.
  • Give permission “rkdeveloptool” binary to executive, use
  • Make your Rock960 board connected USB-C to your PC and turn to maskrom mode ( push both of maskrom and reset butttons, then release only reset )
  • Your host PC ( may Linux ) should detects new USB device, then it may allow to downloading mode with rkdeveloptool.
  • Then just write system.img to your board.
    Warning : all your datas in eMMC may deleted, back up your data before doing this !
  • It may takes for minutes, wait for done.
  • Then reset your board.

After boot up

You may see LXDE desktop within a minute, then connect to your WiFi, then make systems up to date with these.

 

How to know 64bit ?

Just make a C++ source and compile it, then run it for a test. ( before you may need get install g++ with this :  sudo apt-get install g++ )

Then,

Done.

Additional build info

My AARCH64 system image build in these options –

  • Default Rockchip configuration
  • Not supports SOC cameras ( a.k.a MIPI-CSI )
  • USB-C OTG supports as default option ( removable drive at host PC )

Recommended work to do after flashing image

  • Keep update your system via ‘apt-get’
  • Manage your power configuration – I don’t recommend to use power manager ( there’s many Rockchip DWM driver control errors )

Recommended for developers

  • Install ‘g++’ first.
  • LXDE’s X11 library is not much functional – need to consider non-acccelerated desktop graphics ( because MALi 8xx not suppors OpenGL ! – OpenGL|ES and OpenGL is not compatibled )