All posts by Raph

A hardly free minded low level programmer.

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.


  • 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:!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.


  • 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++ )



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 )

Latest Inland SSD 480GB has no DRAM !

When I bought Inland SSD 480GB again from Amazon, I found new SSD is exactly different from old model by just open paper box – that was plastic enclosured SSD, it was never expected.

Left : new, Right: old

 Aghhh .. always problem is ‘cost down matter’ of many manufacturer, new SSD model may changed ODM manufacturer, It means no more metal enclosured chasis, no DDR cache for stability and fast performance for end up capacity, so they are discontinued many things. Here is more negative issues when I open case for putting thermal pads to manage heating.

One third size PCB from the past, why? What happended to them  … Yes, new Inland SSD 480GB is totally different, here is PCB picture of previous model with enclosure, black painted steel? aluminium? with full sized PCB with many components.


Previous SSD 480GB contains full size PCB with many Toshiba NANDs with DDR memory beside Phison controller. Every side of PCB finished with grounding that increases durability. Much different with new !

But new PCB is smaller than previous, it is like Chineses cheap SSD, just one third size from SATA3 connector, Different Phison controller is really smaller than previous, different model of PS3111-S11 from PS3110-S10.

New SSD model PS3111-S11 is made for 3D MLC and TLC NAND models without DDR cache, just supports SLC cachining for limited capacity. So fresh device may not makes troubles while write datas until this SLC caching ran out – then most of lacks of performance occurs mostely filled capacity in half.

New SSD 480GB ironed two NANDs up and down side, may better than Chinese single module. But still there’s nothing like write cache on board. ‘Quick forget makes me comfort’, yes fast way is just close the enclosure with my minimal thermal therapy, I put some copper tapes to spread heats from controller and backside NAND while it operates in high temperature thru thermal pad.

Plastic enclosure makes high temperature thermals stucks in small chamber because there’s nothing like to space to spreads out heated air to outside of enclosure. So I am always using this solution to makes components of high temperature heating components to against roasted death of them.

Fresh performance at USB 3.0 controller with UASP is almost 300MB/sec to sequence write, and sequence reading is 360MB/sec.

Phison PS3111-S11 controller supports thermal monitoring – some Chinese cheap models are not support this, with minimal S.M.A.R.T features. I’m not sure PS3111-S11 how keep good performance when filled in over half capacity until now, I will continue to write in later for getting more experiences.

Anyway, “Inland” sold their trust to money for thir profit.

Create HBITMAP from Fl_RGB_Image

Here is a simple code for convert Fl_RGB_Image to HBITMAP.

It should be help to convert Fl_RGB_Image ( must have depth 4 for RGBA ) to HBITMAP. And it works for changing Fl_Window to Layered window easily like this.

And it may runs as this.

How to set debug mode easily for libusb and libuvc.

Here is a tip for programer for debug any application with using libusb(x) or libuvc.

There’s many way to debug what it going on with gbd when you are using gcc or MinGW (incl. MinGW-W64) , you may feels somehow difficult to control gdb to debug in deep call stacks without IDE like Code::Blocks.

You can use putenv() to set debug mode to print all messages to ‘stdout’ (aka. console, or terminal) .


Enable debugging message

Meaning of number appends LIBUSB_DEBUG is this level :

When you enabel this, you can see all debugging messages on your terminal or console.

Developing libuvc for MinGW-W64, day 1

Now I am trying to get YUV2 buffer from formal USB camera, but it doesn’t easy on Windows system. MS designed most of USB video devices need to use Direct media layer, but it occurs many different problems while using OpenGL or hardware accelerated surface at same instance of Windows application.

So I made it from starting understand UVC and common library of libuvc.

And I understood it depends on libusb that is well known libraray for multiple platforms except Windows. So I have to make it building ways as like Makefile on MSYS and for MinGW-W64, then it comes to Josh Blake’s libusbx to customized for build in MinGW-W64 and MSYS easily.

But it still has many problems, exactly same failure for -12 ( UNSUPPORTED ).

It belongs to failure of libusb_open() returns -12 through libuvc error result. Testing open USB HD Camera with libusb or libusbx always same.

It must be study for what different Windows USB drivers, and why UVC not able to open with formal libusb, further need to understand libusb-win32 or libusbk.

So I reached same position again, Windows is not my option, really.

Server recovered back.

Everytime to updating latest versions of each plug-ins and theme makes me have check what it chnaged. And I didn’t wait for what it done for updating previous theme.

It was recovered easily to putting definition for exactly what domain name to Word Press configuration.

Arghh, We are doomed by Intel, Thank you so MUCH !

By Linux kernel group with Google, Vulnerability open for modern high performanced CPU (incl. AP, ARM Cortex architecture) that using pipe-line and fast matching caching systems of designed to using multiple calculating unit almost since over 15 years ago.

There’s two kinds of vulnerability, MELTDOWN and SPECTRE. These problems belong to hardware design fault, and may not bypass or protected by software level – so we are doomed, anyway.

Most of Intel CPU ( from Pentium multi-core designed thru Core2Duo to modern all Intel products of x86 architecture ) has leaking secured kernel memory to un-trusted user instructions to read them out easily. Also most of ARM cortex-A architecture same to vulnerabled – yes, our all smartphones since iPhone3Gs and all of Androids.

It means, your secured password should be read by any hacker when you been attacked without any protecting solutions, specially old aged Windows or Linux even Mac OS.

Intel guiding now to update system firmware ( BIOS, EFI, Intel ME ) to protect our computers, but it only depends on mainboard or hand held device manufacturer’s support !

My main desktop CPU is Intel’s i5-3570, 3rd generation of Core-I series. Its mainboard was discontinued to support in many years ago, and no way to support by manufacturer – damn Gigabyte.

It may same also for most of people as like me, long time users without any upgrade – why need upgrade for latest? It is enough now for enjoying games with ATi Rx460 4GB, it is even faster than I expected.

Among this opening of hell-gate, there’s a winner – AMD.

AMD win this game for much less vulnerability, and my next desktop will be AMD again. You won the game, AMD ! And Goodbye UNGRATEFUL INTEL ! You such a mad for money moron!