Archive

Posts Tagged ‘tutorial’

ODROID-XU3 Lite Development Board – Android Setup and Benchmarks

November 21st, 2014 10 comments

It’s been nearly ten days since I make ODROID-XU3 Lite unboxing, and my plans to first test Linux on the board were thwarted due a problem with HDMI. Luckily, after several attempts I managed to boot the board with Android. So today, I’ll show how to install or update Android on the board, and run a few benchmarks. But since there’s always a silver lining, I’ll start buy writing a bit about the HDMI issue, as I learned a few things on the way.

HDMI Output Tribulations

ODROID-XU3 Lite looks like a nice and powerful kit, and it may be one of the most cost effective ARM board on the market since it comes to performance to price ratio, so I was excited to try it, but as you know if you’ve read my unboxing post I did not work quite as planned, as all I got was a black screen on my HDMI TV.

Here are some of the steps I followed to try to find out the cause or a workaround.

I usually connect the HDMI cable to an HDMI switcher as it’s more convenient to me. I got the connection light on the switcher but no image. Some devices won’t work with the switcher, so I decided to connect it directly to my Panasonic television instead, trying HDMI1 (DVI) and HDMI2 ports, but the result remained the same. I also connected the UART Debug board I got with ODROID-X board, and I could only see three lines related to HDMI in the log:

root@odroid:~# dmesg | grep -i hdmi                                             
[    0.417692] [c6] hdmi-en: no parameters                                      
[    2.753215] [c7] exynos-drm exynos-drm: bound 14530000.hdmi (ops hdmi_component_ops)                                                                         
[    4.787478] [c6] hdmi-en: disabling

So I tried with a Philips monitor, a slowly dying Samsung TV. Same results. So I decided to try with another micro HDMI cable, which I got with the older ODROID-X board. Still no luck. I was also instructed to try this Ubuntu image on a fast micro SD card, and after changing the boot switch position, the board booted from the micro SD “successfully”, but I still had a black screen. I also play around with boot.ini in the micro SD card to force various HDMI modes, but It did not work either.

Hardkernel decided to send me another ODROID-XU3 Lite board, and a few days later I tried again, and unfortunately I got the same issue. The company told me they sold several thousand ODROID-XU3 boards, and they did not get the same report before, so we even considered shipping my TV to Hardkernel office in South Korea. But, since I had troubles with three monitors/TVs, I thought it must have been another issue, and I wanted to try a few other things.

In the meantime, one reader informed me he had a similar issue with his ODROID board, the reason being the ground was not connected in the HDMI cable,and he fixed it by connecting one of the USB host port of the board to his TV. So I tried with both my ODROID-XU3 Lite board, but the problem persistently remained. Out of desperation I also tried a different power supply (SMPS), but it did not work.

Finally, I flashed Android 4.4.4 instead to the eMMC module, and using the “new” micro HDMI cable I got the same black screen, but switching to the “old” ODROID-X micro HDMI cable, I could finally get video output at 720p60, and see the Android home screen. Yeah!!! So finally, it looked like an HDMI cable issue, but there may also be a software issue, as Android works, but Ubuntu does not work (yet). It’s something I’ll have to check again.

I talked with one of Hardkernel’s developer on #odroid IRC channel, and they told me some HDMI cables lack a ground connection, and/or lines are mixed. They’ll check with their supplier(s) to make sure the problem does not occur again. There’s actually an interesting thread on odroid forum that explains various issues related to HDMI (cables).

Installing and Setting Up Android on ODROID-XU3 (Lite) Board

There are three images to install Android 4.4.4 Alpha on ODROID-XU3 (Lite), which can currently be downloaded @ http://dn.odroid.com/5422/ODROID-XU3/Android/:

  • android-4.4.4-alpha-1.3-emmc_installer-odroidxu3-20141105.img.zip – Zipped image to install Android from eMMC to eMMC
  • android-4.4.4-alpha-1.3-sd2emmc_installer-odroidxu3-20141105.img.zip – Zipped image to install Android from micro SD card to eMMC
  • android-4.4.4-alpha-1.3-sd_installer-odroidxu3-20141105.img.zip – Zipped image to install Android from micro SD card to micro SD card.

Since I have an eMMC pre-installed with Linux, and the microSD eMMC reader, eMMC I used the first image. I connected the eMMC reader to my PC using my USB card reader’s micro SD slot, and unzipped the image, and flashed it as follows:

unzip android-4.4.4-alpha-1.3-emmc_installer-odroidxu3-20141105.img.zip
dd if=android-4.4.4-alpha-1.3-emmc_installer-odroidxu3-20141105.img | pv | sudo of=/dev/sdX bs=1M
sync

where X is the letter for the eMMC drive. Check with lsblk command before you run dd, to make sure of the letter, or you may wipe out the data on your hard drive. Some system with built-in micro SD slot may show as /dev/mmcblk01 instead of /dev/sdX. If you want to boot from micro SD card, the procedure is the same, but use the “sd_installer” image instead. You can also do that in Windows using Win32DiskImager.

Now connect the eMMC to the board, and other item you may need. I’ve connected most ports with a USB 3.0 hard drive, a USB 2.0 webcam to the USB 3.0 OTG port via the blue adapter, HDMI to my TV, Ethernet, two USB RF dongle, a Bluetooth dongle, a USB flash drive, and the serial debug board to access the console.

ODROID-XU3_Lite_USB3_HarddriveFinally I connected the 5V/4A power supply to boot the board. In the console, it takes about 12 seconds to boot to the command line, but I had to wait a total of 1 minute 20 seconds for Android user interface to be displayed on my TV screen. I noticed in the console that between 12 and 65 seconds I did not get any message, and the first subsequent message was related to USB audio… My USB webcam comes with a built-in microphone, so I disconnected it, and boot time dropped to a more normal 29 seconds.

Android Home Screen (Click for Original Size)

Android Home Screen (Click for Original Size)

The default resolution is 1280×720, and my TV output resolution was also set to 720p60. So I went to Android Settings->Display, and… wait… nothing there to change the video output. You actually have to go to the list of apps.

odroid-utlityand start ODROID Utility app.

ODROID_Utility

There should can change the (framebuffer) resolution to 1280×800 (for ODROID-VU only?), 1280×720, or 1920×1080, and the HDMI phy, i.e. the actual video output mode. to 720p 50/60, 800p/59, 1080i 50/60, or 1080p 30/50/60. You can also select the orientation (portrait / landscape) which is very useful for digital signage applications. So I selected 1920×1080, and 1080p60, clicked on Save, and Apply and Reboot. The framebuffer resolution was properly changed, but for some unknown reasons, my TV will always fall back to 720p60. The Android image is currently in Alpha stage, so it still have a few bugs that will be fixed by Hardkernel and/or the community.

You may have noticed Google Play Store is not part of the pre-installed apps. That’s because in theory you need to have a certified device to install Google Mobile Services, and contrary to most Chinese vendors, Hardkernel rightly followed Google’s T&C. However, apparently nothing legally prevents the user from installing GMS by himself/herself. You could do so by downloading Gapps from goo.im, but there’s also GAppsInstaller_kitkat.apk that will easily and automatically do that for you. For full details read universal 1 click gapps installer for ODROID post.

ODROID-XU3_Apps_GappsAfter installation, we’ve got the Play Store, Hangout, Voice Search, Google, and so on.

So that’s all for the setup. Next time Hardkernel announces a new Android firmware update on their forums, you should not need to use an installer image, instead you can simply start ODROID Update app, which will automatically download and update the firmware.

ODROID_Updater

ODROID-XU3 Lite System, Storage, and Network Benchmarks

Before running actual benchmarks, I’ve started CPU-Z. The first surprised that is it can detect big.LITTLE configuration with four Cortex A7 cores @ 1.6 GHz, and four Cortex A15 cores @ 2.2 GHz. ODROID-XU3 Lite is supposed to have Exynos 5422 processor but clocked at a lower frequency (1.8 GHz) compared to ODROID-XU3 board (2.2 GHz). So maybe my processor is overclocked, or I got lucky. The GPU is also detected correcly as being an ARM Mali-T628. Internal storage is only shown to be 1.94 GB out of the 16GB eMMC, because there are two partitions with the other one having a 11GB+ capacity. ODROID-XU3_Lite_CPU-ZSo let’s get to the actual benchmark results, starting with Antutu 5.3.

Antutu 5.2 Score (Click to Enlarge)

Antutu 5.2 Score (Click to Enlarge)

As expected ODROID-XU3 Lite is a real beast with 45,815 points in Antutu, being one of the most powerful ARM Android platform currently available. It’s the highest verified score I’ve ever got on all the devices I tested. The only higher score was achieved by Tronsmart Draco AW80 mini PC with Allwinner A80 SoC (49,657 points), but it’s an unverified score.

Quadrant Score (Click to Enlarge)

Quadrant Score (Click to Enlarge)

ODROID-XU3 Lite got 9,256 points in Quadrant way ahead of last generation devices. It looks like Quadrant us not really up-to date so that’s probably the last time I use this benchmark.
ODROID-XU3_Lite_VellamoVellamo 3.1 scores are also very good. Metal score is 1,519 against 1,138 points for Allwinner A80 and 1,457 points for Rockchip RK3288, Multicore score is 1,449 against 1,352 points for Allwinner A80, and 2,003 points for RK3288, and the ODROID-XU3 Lite gets 2,868 points in the browser score against 2,109 points for Allwinner A80, and 2,549 points for RK3288. It does not make much sense for the quad core Cortex A12/A17 RK3288 to outperform the octa core Cortex A15 + A7 processor in the multi-core benchmark, and I’m not sure why that is. You can get comparison with other platform with the screenshots for Metal, Multicore, and Browser tests.

3Dmarks Ice Storm Unlimited (Click to Enlarge)

3Dmarks Ice Storm Unlimited (Click to Enlarge)

I’ve also tried to run 3DMarks Ice Storm Extreme to compare with A80 and RK3288, but unfortunately none of my three attempts could complete, either because of a kernel panic, or a problem with Mali driver (See log). So I switched to Ice Storm Unlimited test which runs at 720p, and could complete with a score of 15,184 points. That puts it close to flagship devices like  like the iPhone 6 Plus, Samsung Galaxy S5, which score between 16,000 and 18,000 points.

Beside standard benchmarks, I’ve also tested storage and network performance.

I used A1 SD benchmark to test the eMMC module, my class 10 SD card, and USB 3.0 + NTFS performance. The app also made the system unstable with kernel panic ensuing, but after a few tries I could complete all benchmarks.

USB NTFS Transfer rate in MB/S

USB NTFS Transfer rate in MB/S

ODROID-XU3 Lite is clearly ahead of the competition with its USB 3.0 port when it comes to NTFS read speed which reaches 47.90 MB/s. and that’s the only device that supports USB 3.0 type of performance, although not quite as good as as on my PC (100+ MB/s), but it was with another benchmark tool (Bonnie++) in Linux.

Transfer Rate in MB/s

Transfer Rate in MB/s

I’ve included both eMMC and a class 10 micro SD card used with ODROID-XU3 Lite in the chart above (ODROID results on right side), and for some reasons the eMMC 5.0 module only got 47.02MB/s read speed, which is very good but still far from the 180+MB/s advertised with another benchmark. Write speed (32.42 MB/s) however is much faster than any other platforms tested so far. The class 10 micro SD used as comparison reads at 34.26 MB/s and writes at 10.81 MB/s which is not too bad compared to most other solutions.

ODROID-XU3 is capable of great I/O performance as we’ve seen above, so it would be nice if we had a fast network interface to leverage fast I/Os. Hardfkernel does provide a USB 3.0 to Gigabit dongle, but it was not included in my kit, so I’m limited to the 10/100Mbit interface which is shown to provide a good transfer rate with iperf (Command line: iperf -t 60 -c 192.168.0.104 -d).

Throughput in MB/s

Throughput in Mbps

iperf log:

Client connecting to 192.168.0.106, TCP port 5001
TCP window size:  212 KByte (default)
------------------------------------------------------------
[  6] local 192.168.0.104 port 54914 connected with 192.168.0.106 port 5001
[ ID] Interval       Transfer     Bandwidth
[  6]  0.0-60.0 sec   656 MBytes  91.7 Mbits/sec
[  4]  0.0-60.0 sec   631 MBytes  88.2 Mbits/sec

So overall, ODROID-XU3 Lite has outstanding performance in almost all aspects, but Android 4.4.4, which is still considered Alpha, required some more work to make it stable. There’s also an Android 4.4.2 image which may be more stable (TBC).

Android SDK for ODROID-XU3 (Lite)

I haven’t tried the SDK this time, but with each firmware release, Hardkernel provides a BSP.

To get and build the latest source code, you simply need to type these four commands, provided you’ll already setup your build machine for Android development:

repo init -u https://github.com/hardkernel/android.git -b 5422_4.4.4_master
repo sync
repo start 5422_4.4.4_master --all
./build.sh odroidxu3

If you want the code for a specific release, for example November 5 release (Android 4.4.4 Alpha 1.3), the repo init command line would become:

repo init -u https://github.com/hardkernel/android.git -b 5422_4.4.4_master -m manifeset-5422_4.4.4_v1.3

With the other three commands remaining the same.

That’s all for today, and Android. The next step will be to check out Ubuntu / Linux. If you are interested in this board, you can purchase it directly from Hardkernel, or through distributors like Ameridroid (USA) or Pollin Electronics (Germany).

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How-to Install Ubuntu on Allwinner A80 Powered pcDuino8 and A80 OptimusBoard

November 17th, 2014 5 comments

Last month, pcDuino released Android 4.4 and Ubuntu images for pcDuino8 board powered by Allwinner A80 octa core processor, and since it’s the same board layout as A80 OptimusBoard, I decided to try it out, but it failed as the update script would try to flash it to a partition that’s too small for the root file systems. But last week, Ian Morrison and Minidodes gave it another try, and successfully booted Ubuntu, or more exactly Lubuntu, on A80 OptimusBoard.

Lubuntu Screenshot in A80 OptimusBoard

Lubuntu Screenshot in A80 OptimusBoard

Both their screenshot reports sun9i platform in /proc/cpuinfo, so that’s definitely Allwinner A80, but only one core is shown. I’m not sure if it’s because the other are idled and don’t show, or for some reasons, the kernel only supports one core at this stage.

Anyway, here’s how they did to install Lubuntu:

  • Flash the kernel (pcduino8_kernel_livesuit_20141008.img) with PhoenixCard or Livesuit first. See instructions to use Livesuit with A80 OptimusBoard.
  • Extract the rootfs (pcduino8_ubuntu_20141008.rar) to an SD card or USB flash drive. There should be two files: pcduino8_ubuntu_20141008.img and update.sh.
  • Boot the board, but don’t insert the SD card or USB flash drive yet.
  • update.sh script will attempt to copy the rootfs to /dev/nandd, but there’s not even space, so it will fail. So instead login as root (no password) and kill update.sh: ps ax | grep update, kill “pid”.
  • Now connect the mass storage device to pcDuino3 / A80 Optimusboard, and mount it to /mnt
  • Flash the Ubuntu image to /dev/mmcblk0p1:
    dd if=pcduino8_ubuntu_20141008.img of=/dev/mmcblk0p1 bs=1M
    sync
  • Now reboot the board and interrupt the boot sequence to enter U-boot, and use ‘env’ to change the bootargs with mmc_root to /dev/mmcblk0p1 and init to /sbin/init.
  • Save the environment with env save, and boot the board to start Ubuntu.

I have not tried (yet), since I’m busy with other hardware, so let me know if the instructions above need improvement. [Update: the procedure may depend on the Android firmware / flash partition, as described in the comments section]

On a side note, Merrii released some new SDKs for A10, A20, A31, and A80.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Beyond Debug Key Enables JTAG & UART Debugging, Supports OpenOCD

November 3rd, 2014 1 comment

Beyond Semiconductor, a fabless semiconductor company based in Slovenia which develops their own 32-bit BA2x IP cores, has sent me one of their development tool, namely Beyond Debug Key supporting JTAG and UART interfaces either with BeyondStudio for the company’s BA2x processor, or the open source suite OpenOCD for other processors. Since I don’t have any Beyond Semi boards, I instead configured it, and quickly tried it with Atmel SAMA5D3 Xplained ARM Cortex A5 development board, and OpenOCD (Open On-Chip Debugger).

Beyong_JTAG_Debug_Key_PackageThe debug tool comes in the package above describing the key features of the kit:

  • Performance
    • Transfer rate in excess of 600 kB/s
    • 30 MHz maximum JTAG clock
    • Less than 20 μW power draw from target board
  • Compatibility
    • Fully compatible with Beyond BA2x processor family
    • Access any 8-bit, 16-bit, 32-bit or 64-bit processors via JTAG
    • Works with all JTAG compliant devices
  • Software Support
    • OpenOCD for access to a range of CPLD, FPGA, flash and processor devices
    • BeyondStudio for graphical debugging of Beyond BA2x processors
  • Diagnostics – 7 autonomous status LEDs for power and flow control diagnostics
  • Target Debugging Integrated in BeyondStudio
    • Eclipse-based integrated development environment
    • Simplified and straightforward setup of target connection in just few clicks
    • Modern source-level debugger with hardware breakpoint, watchpoint and single step features
    • Integrated target console
  • Interfaces
    • USB 2.0 Hi-speed 480Mbps connection to PC
    • IEEE 1149.1 and IEEE 1149.7 JTAG interface standard pinout
    • RS232/RS422/RS485 UART Transfer Data Rate up to 12Mbaud
    • Simultaneous JTAG and UART operation
    • IO voltage range from 1.2 V to 3.3 V and including 5V CMOS compliant signaling
    • Independently controlled SRST and TRST signals
    • One Wire Debug (OWD) and Two Wire Debug (TWD) protocols support

Beyong_Debug_Key_JTAG
The kit include the Debug Key, a mini USB to cable, and a user’s manual describing the kit, explaining how to configured it with Windows and Linux computers, and listing the seven LED behaviours to diagonalize the connection. The tool uses a 20-pin JTAG connector, so as I did not want to wire JTAG signals manually, I went through my boards trying to find one with 20-pin JTAG receptacle, and I ended-up connecting it to Atmel SAMA5D3 Xpained development board as shown below.

Atmel_SAMA5D3_Xplained_JTAG_Debugger
Beyond Debug Key Connected to Atmel SAMA5D3 Xplained Board (Click to Enlarge)

JTAG can be used for board bring-up and flashing firmware, so I initially thought I would show how to configure the debug tool, and flash a firmware image to the board, but since Atmel SAMA5D3 configuration are not available, and it was my first time with OpenOCD, it took a little longer than usual, and I’ll just show the configuration part, and successful (I think) connection to the board.

The Debug key support both Windows and Linux, but I did everything from a computer running Ubuntu 14.04 LTS. The first thing is to install OpenOCD which is part of Ubuntu repo:

sudo apt-get install openocd

So it’s very easy to install, but OpenOCD version in Ubuntu is 0.7.0, and depending on the board you are using, you may want to build latest release (0.8.0), or directly from the source code tree:

git clone http://git.code.sf.net/p/openocd/code openocd-code
cd openocd-code
sudo apt-get install libusb-dev libftdi-dev texinfo libtool autoconf libusb-1.0-0-dev
./bootstrap
./configure --enable-ftdi
make -j8
sudo make install

OpenOCD requires config scrips both the JTAG key, and the target board. Beyond Semi provided the configuration files for their Debug Key, so that part was easy, and all I had to do was to create beyond.cfg with:

#
# Beyond Semi Debug Key
#
#
interface ftdi
ftdi_device_desc "Debug Key"
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 0

ftdi_layout_init 0x0f38 0xff3b
ftdi_layout_signal nTRST -data 0x0100 -noe 0x0400
ftdi_layout_signal nSRST -data 0x0200 -noe 0x0800

adapter_khz 30000

You also need to create a udev rules to be able to access the JTAG debugger as a normal user. so I created 52-beyong-jtag.rules in /etc/udev/rules.d/ with the line:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{product}=="Debug Key", MODE:="0666"

At this stage, if you run OpenOCD with beyond.cfg only, you get the following output:

openocd -f beyond.cfg
Open On-Chip Debugger 0.8.0 (2014-11-01-21:21)
Licensed under GNU GPL v2
For bug reports, read

http://openocd.sourceforge.net/doc/doxygen/bugs.html

Info : only one transport option; autoselect 'jtag'
adapter speed: 30000 kHz
Info : clock speed 30000 kHz
Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -expected-id 0x974008ef ..."
Warn : AUTO auto0.tap - use "... -irlen 2"
Error: auto0.tap: IR capture error; saw 0x0003 not 0x0001
Warn : Bypassing JTAG setup events due to errors
Warn : gdb services need one or more targets defined

At this stage, I had to find or create the script for Atmel SAMA5D3 CPU, and you’ve got a list of scripts in /usr/share/openocd/scripts/ which can help. There’s also site claiming to support Atmel SAMA5D3 with OpenOCD, but checking out the code asked me for a password. So instead I read Atmel SAMA5D3 datasheet (Chip Identification section), where I found relevant information such as SRAM start address, and Cortex-A5 JTAG IDCODE (0x4BA00477). The SRAM address is exactly the same as SAM9G45 processor which has a config files in OpenOCD, namely at91sam9g45.cfg which also includes at91sam9.cfg, so I simply copied both files to create my own at91sama5d3.cfg,  by simply replacing set _CPUTAPID 0x0792603f by “set _CPUTAPID 0x4ba00477″.

Here’s the output if I use both the Debug Key and SAMA5 scripts:

openocd -f beyond.cfg -f at91sama5d3.cfg
Open On-Chip Debugger 0.8.0 (2014-11-01-21:21)
Licensed under GNU GPL v2
For bug reports, read

http://openocd.sourceforge.net/doc/doxygen/bugs.html

Info : only one transport option; autoselect 'jtag'
adapter speed: 30000 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
adapter_nsrst_delay: 300
jtag_ntrst_delay: 200
RCLK - adaptive
1
Info : RCLK (adaptive clock speed)
Info : JTAG tap: at91sama5d36.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : Embedded ICE version 0
Error: unknown EmbeddedICE version (comms ctrl: 0x00000000)
Info : at91sama5d36.cpu: hardware has 2 breakpoint/watchpoint units

So despite one error, the connection appears to be successful, and both TDO and TDO LEDs blinked on the debug key, which means both JTAG Tx and Rx were active. That’s all I have achieve so far with the amount of time I had.

If you are interested in getting such JTAG Debugger, you can purchase Beyond Debug Key for 90 Euros directly from Beyond Semiconductor.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Getting Started with WRTnode OpenWRT Development Board

September 18th, 2014 No comments

Seeed Studio sent me two nice little boards that can be used for IoT development: WRTNode and LinkIt ONE. Today, I’ll show pictures of WRTNode and accessories, and go through the “starting guide“, and will test LinkIt ONE board a few days later.

WRTnode Unboxing

I’ve received WRTnode by Fedex, and the board is stored in a plastic box.
WRTnode_Package
Inside the box, you’ll find the board, a “special” USB used to power the board and as an OTG adapter, a piece of paper with useful links (Wiki), and some WRTnode stickers.

WRTnode, "special" USB cable, and Quick Start Card (Click to Enlarge)

WRTnode, “special” USB cable, and Quick Start Card (Click to Enlarge)

Any micro USB to USB cable can be used to power the board, but this cable is useless to connect USB devices such as flash drives, webcams (OpenCV is supported), Bluetooth dongles, and so on. You could even connect a USB hub to connect multiple USB devices as shown below.

WRTnode_Webcam_Flash_Drive_USB_Hub

I’ve also taken a picture of both sides of the board shown the antenna on-board antennas, Mediatek MT7620n WiSoC, Elixir N2TU51216DG-AC DDR2 chip (64MB @ 400 MHz), the 16 MB SPI flash, as well as the headers for connecting various peripherals via I2C, SPI, UART, USB, etc…

WRTnode Board (Click to Enlarge)

WRTnode Board (Click to Enlarge)

You can also add Ethernet easily by making your own Ethernet cable using T568B wiring standard. I’m not 100% sure it’s safe though, as there are usually some extra components for Ethernet. I’ve included the board pinout chart for your reference.

WRTnode_pinout

WRTnode Quick Start Guide

To start the board simply connect the USB cable to a power adapter or a USB port on your computer. After about 10 seconds, you should see a blue LED lit up, and shortly after, you should see WRTnodeXXXX ESSID, where XXXX are the last 4 digit of the board MAC address. Connect it with your computer, and input the password: 12345678.
WRTNode_Access_PointNormally the board will resolve as several URL, but at first none of them worked.

$ ping i.wrtno.de
ping: unknown host i.wrtno.de
$ ping openwrt.lan
ping: unknown host openwrt.lan
$ ping wrtnode.lan
ping: unknown host wrtnode.lan

But you can check the route to see which subnet is used by your Wi-Fi connection:

$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 1 0 0 eth0
192.168.8.0 * 255.255.255.0 U 9 0 0 wlan0

I could finally ping the board with:

$ ping 192.168.8.1
PING 192.168.8.1 (192.168.8.1) 56(84) bytes of data.
64 bytes from 192.168.8.1: icmp_seq=1 ttl=64 time=12.4 ms
64 bytes from 192.168.8.1: icmp_seq=2 ttl=64 time=2.37 ms
64 bytes from 192.168.8.1: icmp_seq=3 ttl=64 time=12.1 ms

Interestingly, ping openwrt.lan, and the other two URL also work afterwards, so maybe I was a little to impatient during my testing…

The first time you need to connect to the board via telnet in order to set the root password:

$ telnet 192.168.8.1

WRTNode_Telnet

Now change the root password using passwd as you would do in any other Linux machine, and exit the connection, in order to connect via SSH instead:

$ ssh [email protected]
The authenticity of host '192.168.8.1 (192.168.8.1)' can't be established.
RSA key fingerprint is bc:00:71:ac:b1:56:e7:7b:c7:7a:9b:6a:59:8e:da:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.8.1' (RSA) to the list of known hosts.
[email protected]'s password:
BusyBox v1.22.1 (2014-08-13 19:31:12 UTC) built-in shell (ash)
.....
root@OpenWrt:~#

At this point, you’ve got another Wi-Fi access point on your network, but it’s not connected to Internet, so let’s start by locating the Wi-Fi routers with aps command:

root@OpenWrt:~# aps
WRTnode AP scaner.
Begin scaning APs, pls wait...
Finished.
APs available are...
ra0 get_site_survey:
Ch SSID BSSID Security Siganl(%)W-Mode ExtCH NT WPS DPID
1 CNX-TRANSLATION 94:0c:6d:e6:5b:10 WPA1PSKWPA2PSK/TKIPAES 100 11b/g/n ABOVE In YES

I only have one ESSID here, but this will list all ESSID in your environment. With that data, you can configure WRTnode to connect to your Wi-Fi router using vw command (vi wireless?):

root@OpenWrt:~# vw
config wifi-device 'ra0'
 option type 'ralink'
 option mode '9'
 option channel '1'
 option txpower '100'
 option ht '20+40'
 option country 'US'
 option disabled '0'
config wifi-iface
 option device 'ra0'
 option network 'lan'
 option mode 'ap'
 option encryption 'psk2'
 option key '12345678'
 option ApCliEnable '1'
 option ApCliSsid 'CNX-TRANSLATION'
 option ApCliAuthMode 'WPA2PSK'
 option ApCliEncrypType 'AES'
 option ApCliPassWord 'router_password'
 option ssid 'WRTnode9A60'

You need to change the lines in bold above using the data from aps. The first line is the Channel (Ch) , and the four lines in the wifi-iface section are pretty much self-explanatory. Save the file with Esc + “:wq”.

aps and vw do not report security features in the same way. Here’s the conversion table in case you don’t use WPA2PSK/AES:

aps:Security           vw:ApCliAuthMode/ApCliEncrypType
=========================================================
WPA1PSKWPA2PSK/TKIPAES	WPA2PSK/AES
WPA2PSK/AES		WPA2PSK/AES
WPA2PSK/TKIP		WPA2PSK/TKIP
WPAPSK/TKIPAES		WPAPSK/TKIP
WPAPSK/AES		WPAPSK/AES
WPAPSK/TKIP		WPAPSK/TKIP
WEP			WEP/WEP

Finally, restart the network:

root@OpenWrt:~# nr

and verify WRTnode got an IP address from the Wi-Fi router using DHCP:

root@OpenWrt:~# ia
apcli0 Link encap:Ethernet HWaddr 66:51:7E:32:9A:60
inet addr:192.168.0.105 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::6451:7eff:fe32:9a60/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Good 192.168.0.105 is an IP adress from local network. Let’s also check we can ping a site on the Internet:

root@OpenWrt:~# ping cnx-software.com
PING cnx-software.com (104.28.18.95): 56 data bytes
64 bytes from 104.28.18.95: seq=0 ttl=53 time=81.999 ms
64 bytes from 104.28.18.95: seq=1 ttl=53 time=87.759 ms
64 bytes from 104.28.18.95: seq=2 ttl=53 time=81.381 ms
^C
--- cnx-software.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 81.381/83.713/87.759 ms

All good!

Once I had a problem connecting to my Wi-Fi router, and it turned out my router was configured to automatically select the channel, and it had switched to Channel 4. Running vw again to change the configuration withoption channel ‘4’” made the connection work again. There’s probably an option in OpenWRT to automatically detect the channel, but I haven’t investigated.

You can also install packages for okpg. I tried to install luci, but it was pre-installed, so I added openvpn support instead:

root@OpenWrt:~# opkg update
Downloading http://d.wrtnode.com/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/barrier_breaker.
root@OpenWrt:~# opkg install luci
Package luci (svn-r10457-1) installed in root is up to date.
root@OpenWrt:~# opkg install openvpn-easy-rsa
Installing openvpn-easy-rsa (2013-01-30-2) to root...
Downloading http://d.wrtnode.com/packages/openvpn-easy-rsa_2013-01-30-2_ramips_24kec.ipk.
Installing openssl-util (1.0.1h-1) to root...
Downloading http://d.wrtnode.com/packages/openssl-util_1.0.1h-1_ramips_24kec.ipk.
Configuring openssl-util.
Configuring openvpn-easy-rsa.
root@OpenWrt:~#

That’s it the quick start guide is completed.

I’ve also run some command to show memory and storage usage:

root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 7.3M 348.0K 7.0M 5% /
/dev/root 7.5M 7.5M 0 100% /rom
tmpfs 30.2M 80.0K 30.1M 0% /tmp
/dev/mtdblock5 7.3M 348.0K 7.0M 5% /overlay
overlayfs:/overlay 7.3M 348.0K 7.0M 5% /
tmpfs 512.0K 0 512.0K 0% /dev

root@OpenWrt:~# free -m
total used free shared buffers
Mem: 61852 29084 32768 0 3536
-/+ buffers: 25548 36304
Swap: 0 0 0

Out of the 16Mb SPI flash, only 7.3M available are available for OpenWRT, the  rest is probably used by the bootloader. There’s nearly 64MB RAM available, and 29MB free.

If you are interested in the board, you can purchase it from Seeed Studio ($25), which provided the board for this review, but it’s also available on other shops such as DFRobot or Eleduino for the same price, although shipping fees may vary. To go beyond this Quick Start Guide, visit WRTnode WiKi to access the source code, schematics, and various documentation including tutorials.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Creating and Flashing an Android Image from Rockchip RK3288 SDK

September 17th, 2014 10 comments

Following up on my post explaining how to build Android for RK3288 TV box, I’ve generated a firmware image, and flashed it to Tronsmart Orion R28 Meta TV box to see if it could boot properly. There’s basically no information in the Andoird SDK explaining how to do basic things like building from source, and generating and flashing the resulting image, so I’d like to thanks Linuxium, Droidmote and Naobsd for their various tips.

Launcher Part of Android SDK for RK3288 (Click for Original Size)

Launcher Part of Android SDK for RK3288 (Click for Original Size)

Since I’ve built everything from source, I’m using a Linux machine, but you should be able to create and flash the Android image in Windows using tools in RKTools/windows folder.

First let’s copy the required, and freshly built, files to create the firmware:

cp rockdev/Image-rk3288/* RKTools/linux/Linux_Upgrade_Tool_v1.2/rockdev/Image/
cp RKTools/rk3288-3.10-uboot-data1G.parameter.txt RKTools/linux/Linux_Upgrade_Tool_v1.2/rockdev/parameter
cp RKTools/bootloader/uboot-emmc/RK3288Loader_uboot_Apr212014_134842.bin RKTools/linux/Linux_Upgrade_Tool_v1.2/rockdev/
cd RKTools/linux/Linux_Upgrade_Tool_v1.2/rockdev/

We’ll also need to edit package-file follows (I only had to change the bootloader field):

# NAME Relative path
#
#HWDEF HWDEF
package-file package-file
bootloader RK3288Loader_uboot_Apr212014_134842.bin
parameter parameter
misc Image/misc.img
kernel Image/kernel.img
boot Image/boot.img
recovery Image/recovery.img
system Image/system.img
backup RESERVED
#update-script update-script
#recover-script recover-script

And now create the firmware file:

./mkupdate
start to make update.img...
Android Firmware Package Tool v1.0
------ PACKAGE ------
Add file: ./package-file
Add file: ./RK3288Loader_uboot_Apr212014_134842.bin
Add file: ./parameter
Add file: ./Image/misc.img
Add file: ./Image/kernel.img
Add file: ./Image/boot.img
Add file: ./Image/recovery.img
Add file: ./Image/system.img
Add CRC...
Make firmware OK!
------ OK ------
********RKImageMaker ver 1.61********
Generating new image, please wait...
Writing head info...
Writing boot file...
Writing firmware...
Generating MD5 data...
MD5 data generated successfully!
New image generated successfully!
Making update.img OK.
Press any key to quit:

The firmware file update.img can be flashed with upgrade_tool in Linux, or AndroidTool in Windows. Orion R28 also supports updates from SD card, but I don’t know how to generate such images (yet).

First you need to enter recovery mode. Connect the USB OTG port of your device to your PC, insert a toothpick in the AV port of your device to press the recovery push button (location of recovery button will differ between products), turn on the device, and release the button after a few seconds.

The first time I used upgrade_tool, I got the error “Creating Comm Object failed!”,  changing udev rules in Ubuntu will fix the issue (Source Radxa website):

sudo sh -c 'echo SUBSYSTEM==\"usb\", ATTR{idVendor}==\"2207\", MODE=\"0666\", GROUP=\"plugdev\" > /etc/udev/rules.d/51-android.rules'
sudo udevadm control --reload-rules
sudo udevadm trigger

Orion_R28_106k8Finally flash the firmware:

./upgrade_tool uf rockdev/update.img
Loading firmware...
Support Type:RK32 FW Ver:4.4.02 FW Time:2014-09-17 14:55:05
Loader ver:0.02 Loader Time:2014-04-21 15:36:59
Upgrade firmware ok.

Now cross your fingers, and restart your TV box: Google TV logo… Android animation… and after asking a few questions about Google Play, the system asks you which launcher you want to select: stock Android, or a custom launcher as shown in the top of this post. That means it works! Great!

Unfortunately, I quickly realized Ethernet does not work, as the MAC Address is 00:00:00:00:00:00, and the firmware version of the SDK (106k4) does not match with the firmware version originally flashed into Orion R28 Meta (108k4), and they’ve now updated it to 109k4. Wi-Fi did work fine however, I could login to Google Play, and install ES File Explorer. XBMC 13.1 Gotham is also part of that firmware, but won’t work that well based on testing from other RK3288 TV boxes.

I had initially planned to test Tronsmart Orion R28 Meta with the firmware built from the SDK, but unfortunately the SDK and actual released firmware are out of sync, which means the SDK is not really useful, and I don’t think the manufacturers are interested in released up-to-date source code. So instead I’ll do some hardware testing using the provided firmware.

If you want to play around Rockchip RK3288, including testing Ubuntu on your device, you may want to checkout Firefly-RK3288 Wiki, now updated with English instructions partially inspired from Radxa and Androtab websites.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

How to Build Android 4.4 for Rockchip RK3288 Devices (Tronsmart Orion R28)

September 16th, 2014 8 comments

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.
Android_4.4_SDK_Orion_R28

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:

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:

tar xvf Orion_R28_SDK_doc.tar.gz

And build the kernel first:

  1. Enter the kernel directory:
    cd RK3288_R-BOX_ANDROID4.4.2-SDK_V1.0.0/kernel/
  2. 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…):
    dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3288-box.dtb

    It’s also quite possible you need to extract the device tree file from your firmware or device.

  3. Building the kernel and resources (device tree + logo) images:
    make ARCH=arm rockchip_box_defconfig
    make rk3288-box.img -j8
    cd..
  4. 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

  5. Edit the culprit file, remove the inline directive, and continue the build:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
  6. Similar errors will occur one or twice more, so repeat step 5 as needed….
  7. Create kernel.img (not sure the command line is correct)
    ./mkkrnlimg arch/arm/boot/Image kernel.img rk3288-box
    cd..

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:

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”:

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/javadoc javah /usr/lib/jvm/jdk1.6.0_27/bin/javah 1

and make sure Java 1.6.0.27 is used by default:

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:

./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:

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.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Rockchip RK3288 Android 4.4.2 SDK and Schematics Released for Firefly Board

September 2nd, 2014 19 comments

Firefly-RK3288 development board was first announced in July. I still don’t have news about availability nor pricing, but the T-Firefly website launched yesterday. They seem do have a nice Wiki, but unfortunately everything is currently in Chinese, except when you go to the download page. You’ll find firmware upgrade_tool for Linux and Windows, the USB drivers for rooting and firmware update, firmware images (Android 4.4.2, Ubuntu 14.04, and dual boot), the board schematics (PDF), and Android KitKat 4.4.2 SDK with U-Boot, Linux, and Android source code, some documentation, XBMC apk (no source) with H.265 hardware decode support for MP4, MOV and MKV container formats.

Android_4.4._Linux_Rockchip_RK3288

The SDK is available on Bitbucket. I planned to test it, but unfortunately my network connection is very slow (and unstable) to this server, and I failed to retrieve it with git clone. The company also posted the build instructions in Chinese in their website, but I’ll reproduce them here for Ubuntu 14.04.

  1. Install required packages:
    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-gnueabihf \
    lzop libncurses5-dev  libssl1.0.0 libssl-dev
  2. Checkout the SDK:
    mkdir -p ~/edev/firefly
    cd ~/edev/firefly
    git clone https://bitbucket.org/T-Firefly/firefly-rk3288.git
    
  3. Build the Linux kernel:
    cd firefly-rk3288/kernel
    make firefly-rk3288_defconfig
    make -j8 rk3288-box.img
  4. Build Android:
    cd ..
    make -j8
    ./mkimage.sh ota

And after some patience, Android should be fully build. Instructions to create a Ubuntu image are also available in the Wiki, but only in Chinese.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter