Parallella with kernel 4.4.3

Booting Parallella with latest Linux kernel has many benefits – docker support, security, speed. Thanks to kernelci project, it’s quite easy:

Prerequisites (needed for manual process only)

  1. Connect Parallella UART 3 pins and make sure you see boot messages
  2. Power up Parallella with no SD card inserted
  3. Set timeout for U-Boot

     

Prepare SD card

  1. Download official trusty image and burn it on SD card
  2. Download pre-built images
  3. Build uncompressed kernel image (uImage)
  4. Copy the following files to /boot partition

Manual Boot Process

  1. Hit any key during 5 secs delay in U-Boot to get prompt
  2. Load FPGA
  3. Load kernel, dtbd, set args and boot
    setenv bootargs ‘console=ttyPS0,115200 root=/dev/mmcblk0p2 ip=dhcp’

Automatic boot

I don’t feel confident enough to alter Uboot settings, but the following procedure seems to be working without any special bootargs:

  1. Put newly created uImage instead of 3.14 image on your Sd card /boot partition
  2. Rename zynq-parallella.dtb to devicetree.dtb (instead of the original)

Boot the device – for me it worked (no UART prompt)! 🙂

References

  • https://github.com/parallella/parallella-linux/issues/8
  • https://parallella.org/forums/viewtopic.php?f=23&t=1711

read more

Optimizing Parallella network throughput

15478282925_5accdb9d95_o-600x400

I like Parallella board very much in terms of performance, form-factor and price. So I decided to measure it’s performance in terms of Ethernet throughput. Xilinx XAPP1082 reference design for Zynq FPGAs measured very promising performance, therefore my initial thought was Parallella should not fall behind (even though results from 2013 were not very promising).

The Setup

Parallella hardware: based on Zynq 7010

Parallella firmware: Ubuntu 14.04.4 LTS (GNU/Linux 3.14.12-parallella-xilinx-g40a90c3 armv71)

read more

Cross compiling collectd for ARM device

Logo_der_Software_collectd.svg

The following procedure will compile collectd package for AsusWRT router RT-AC56U (based on Broadcom BCM4708 ARM Cortex-A9 Dual-Core CPU).

Prerequisites

You will need Broadcom toolchain available in asuswrt-merlin package.

Build process

 Get binaries

In my case the following didn’t worked (probably as a result of some bug):

Good luck!

A great free book about reverse engineering

I haven’t seen a really great book about reverse engineering for a long time, until I bumped into “Reverse Engineering for Beginners” by Dennis Yurichev.

I think this 700 pages free book covering recent popular technologies like x64 code and ARM CPU, might be a great resource not only for beginners and not only for reverse engineers, but also for advanced developers (PC and embedded) looking to optimize their software and willing to know how decent hackers think.

The book contains:

read more

Cross-compiling with external library (not it toolchain)

I wanted to compile an application that uses sound library (alsa-utils) for ubuntu ARM (Udoo board). The library is obviously not a part of toolchain and I needed to copy it from target along with its headers.

Steps:

  1. Install library and dev package on target, e.g.:

     
  2. Find files you need for compilation:

    For me those are:
    /usr/include/alsa/*
    /usr/lib/arm-linux-gnueabi/libasound.so
  3. Copy include files to your host toolchain:
    Include files to <PATHTO>/arm-fsl-linux-gnueabi/arm-fsl-linux-gnueabi/include
  4. Copy lib file to your host toolchain.
    In my case it is dynamic library libasound.so which was a symlink to libasound.so.2.0.0. I copied it to <PATHTO>/arm-fsl-linux-gnueabi/arm-fsl-linux-gnueabi/multi-libs/lib renaming to libasound.so (without symlink)

read more

Installing Intel DPDK on Ubuntu

Intel

If you are planning to process high speed (1Gbps and up) network packets stream or create InfiniBand network appliance, Intel DPDK (Data Plane Development Kit) framework recently released as an open source package, will probably be your first choice. Because official documentation is still lacking, this tutorial will guide you step-by-step on installing DPDK on Ubuntu 12.04 LTS.

Prerequisites

These instructions were tested on Ubuntu 12.04 LTS 64bit with dpdk-1.5.2r1

Preparing Ubuntu:

Add additional Grub entry with hugepages enabled:

read more

Setting Up Eclipse for Cross-Compiling Application on Udoo

Udoo is a fantastic small form-factor platform containing strong Freescale processor along with strongest Arduino Due controller. Freescale Dual/Quad core processor might have enough power to develop entry level applications and compile them on target. Yet if you are developing something complicated or you are used to separate your target from development machine (as I do), you will find it useful to cross-compile your code on x86 and deploy it on Udoo.

1. Prerequisites

  • I suggest to use latest Ubuntu 12.04 read-to-go image that you can get from Udoo downloads page
  • This tutorial is based on Eclipse Kepler (or later) installed on Ubuntu

1. Installing Toolchain

  • Download cross-compiler from here or here.
  • Untar it somewhere

2. Configuring Eclipse project

  • Start create C++ Project Wizard
  • Select C++ Project-> Executable, with “Cross GCC” toolchain -> Next
  • Mark Debug and Release configurations and click Advanced Settings
  • Under C/C++ Build->Settings
    • Add toolchain included path (“<Path to>/ arm-fsl-linux-gnueabi/arm-fsl-linux-gnueabi/include”) to Cross GCC Compiler->Includes->Include paths and to Cross G++ Compiler->Includes->Include paths
    • Add toolchain lib path (“<Path to>/ arm-fsl-linux-gnueabi/lib/gcc”) to Cross G++ Linker->Libraries->Library search path
    Set path to bin directory in toolchain you downloaded (<Path to>/arm-fsl-linux-gnueabi/bin) in “cross compiler path” field Set “arm-fsl-linux-gnueabi-” in Cross compiler prefix field Finish the wizard and build the solution

    3. Configuring deployment

    • Connect Udoo to your PC with ethernet cable (directly or through Switch). I guess you can also use wireless connection
    • Configure IP addressing and check that you can connect to Udoo SSH server from your host.
    • If you only want to download your executable to Udoo, you can use SCP:
    •  If you are looking for configuring remote debugging through Eclipse continue to the next Section

    4. Eclipse remote debugging

    • Install gdbserver on Udoo
      • Make sure it has internet connection
      Configure remote connection
      • Open Remote System Explorer (Window -> Open Perspective -> Other)
      • Right Click on Remote Explorer -> New Connection
      • Select Linux -> Next
      • Enter your Udoo IP address and “Udoo” on Connection Name -> Next
      • Select “ssh.files” -> Next
      • Select processes.shell.Linux -> Next
      • Select ssh.shells -> Next
      • Select ssh.terminals -> Finish
      • Right click on new Udoo connection and select Properties
      • Click on Host and make sure you have “ubuntu” as Default User Id (if not change it)
      • Make sure that your connection works by expending “Udoo” and browsing remote Processes (you will need to enter password and store SSH hash key)
      Configure remote debugger
      • Open Run->Debug Configurations…
      • Double click on C/C++ Remote Application
      • Select “Udoo” in “Main” tab->Connect dropdown
      • Fill “Remote Absolute File Path for C/C++ Application” (you can browse remote directory tree as well)
      • Click on “Debugger tab” and select debugger from our Toolchain (<path to>/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gdb)
      • Apply
      Click on Debug

      You can use this configuration for debugging or running on target (it will handle the download to target automatically).

      read more

Udoo – Quad-core 1GHz ARM side by side with Arduino Due for $135

Udoo

Few days ago I received my Udoo, another Kickstarter project, which I think is one of the most successful system-on-chip boards for DIY since Arduino Uno.

It contains Dual or Quad core Freescale i.MX 6 ARM clocked to 1GHz along with Atmel SAM3X8E (which is the same chip on 84Mhz Arduino Due).

Some cool features are:

  • Wifi / 1G etherenet / USB host or slave / SATA connector are on board
  • Arduino Due shield can be used as is
  • GPIOs available on “Arduino” headers can be drived by Freescale or Arduino
  • Can run Linux/Android (head or headless)
  • Arduino sketches can be loaded from internal Linux or externally
  • All for $135 (or $115 for dual core)

read more

Compiling and installing net-snmp on BeagleBone

The easiest way to control our Beaglebone device using SNMP is to install net-snmp package.

The following tutorial assumes you have angstrom toolchain installed as described here and you are running vanilla Angstrom distribution on your Beagle

Download net-snmp source from here and untar it Configure the package as the following: run “make” run “make install DESTDIR=<explicit temp dir path>” install files to BeagleBone using SSH:   To test your installation, create snmpd.conf file by running: and run snmpd in shell: (use ip address you wish to listen on)

You can check /var/log/snmpd.log for errors

Good luck!

Building and setting up QT environment for BeagleBone

There are too few information available on how to easily setup QT environment for building Beaglebone applications (command line or GUI). In this tutorial we will compile QT and setup the environment from scratch.

1. My environment

  • Host: Ubuntu 12.10 32bit (VMplayer)
  • Target: BeagleBone Black running Angstrom
  • QT: 4.8.5

2. Setup Angstrom cross-compile toolchain for Linux

3. Download and un-tar QT

 4. Create qmake.conf

Add the following to qmake.conf with your favorite editor:

 5. Configure QT embedded

 6. Build and install

“-j 4” will run the long build process reusing 4 CPU cores, you can change to your own CPU cores amount.

read more