Archive for the ‘Uncategorized’ Category

Cheat Sheet installing Android 7.1.2 nouget on i.mx6

March 6th, 2018

It has been a while since Freescale released nouget 7.1.2. We have clubbed together a cheat sheet to build Android for the Sabre SD platform. This should help you to do a quick copy paste to get whole thing going.

Install following packages

It is possible that you have following packages already installed - but just make sure

sudo apt-get install uuid uuid-dev
sudo apt-get install zlib1g-dev liblz-dev
sudo apt-get install liblzo2-2 liblzo2-dev
sudo apt-get install lzop
sudo apt-get install git-core curl
sudo apt-get install u-boot-tools
sudo apt-get install mtd-utils
sudo apt-get install android-tools-fsutils
sudo apt-get install openjdk-8-jdk

Create a directory - call it myandroid to hold all the packages

$ cd ~
$ mkdir myandroid
$ mkdir bin
$ cd myandroid
$ curl > ~/bin/repo
$ chmod a+x ~/bin/repo
$ ~/bin/repo init -u -b android-7.1.2_r9
$ ~/bin/repo sync
# Please make sure you have plenty of time. It may take overnight.
$cd ~/myandroid/system/tools
$ git clone
$ cd bpt
$ git checkout -b n7.1.2_2.0.0-gab7c3059e5d8c408f60222edc898ef1c229d8fc2d

No Get the kernel source code

$cd ~/myandroid
$git clone git:// kernel_imx
#the kernel repo is large. Therefore, this process can take a while.
cd kernel_imx
$git checkout n7.1.2_2.0.0-ga

Get the u-boot

$cd ~/myandroid/bootable
$mkdir bootloader
$cd bootloader
$git clone git:// uboot-imx
$cd uboot-imx
$git checkout n7.1.2_2.0.0-ga

Download the file android_N7.1.2_2.0.0_source.tar.gz from nxp / freescale ( requires login) to directory, say, android7.1.2 and unzip it

$cd android7.1.2
$tar xzvf android_N7.1.2_2.0.0_source.tar.gz

$cd ~/myandroid
$source ~/android7.1.2/android_N7.1.2_2.0.0_source/code/N7.1.2_2.0.0/
Make sure you see a c_patch command available
$c_patch ~/android7.1.2/android_N7.1.2_2.0.0_source/code/N7.1.2_2.0.0/ imx_N7.1.2_2.0.0-ga

If this is successful you should see a message that says something like - you can build the Android code for FSL.

Building Android

$cd ~/myandroid
$source build/

Select sabresd_6dq-user

The following is required to avoid GC overhead limit error. Increasing heap size helps.

$export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
$./prebuilts/sdk/tools/jack-admin kill-server
$./prebuilts/sdk/tools/jack-admin start-server

Not the make command

$ make 2>&1 | tee build-log.txt

It takes some time ( Like 5 hours of a decent laptop).

The above process generates files for eMMC. To generate it for SD Card, you will need to do following

1. Remove /out/target/product/sabresd_6dq/root directory and boot*.img.
2. Remove /out/target/product/sabresd_6dq/recovery directory and recovery*.img.
3. Build the boot.img and recovery.img as follows:
make bootimage BUILD_TARGET_DEVICE=sd
make recoveryimage BUILD_TARGET_DEVICE=sd

To create SD Card to boot

$cd ~/myandroid/
$sudo chmod +x ./device/fsl/common/tools/
$sudo ./device/fsl/common/tools/ -f /dev/sdX
can is imx6q I.MX6 quad processor

Keep all the required files in the current directory.

Issues and Fixes

Will be coming up with list of issues encountered and their fixes.


Using SABRE-SD u-boot on Sabre Lite for i.MX6

February 25th, 2018

There are two lines of the evaluation boards for freescale i.mx6 - SABRE SD and Sabre Lite. The two boards have their own lines of u-boot. Some of the features available in the SABRE SD u-boot, for example SPL boot and the Falcon boot are not available in SABRE LITE board.

With some small modifications you can make the SABRE-SD u-boot to work on the Sabre-Lite board.

In include/configs/mx6sabresd.h






#define CONSOLE_DEV "ttymxc0"


#define CONSOLE_DEV "ttymxc1"

The SABRE SD board uses UART1 for the console message while the the Sabre Lite board uses UART2. So the first change is to make the

In board/freescale/mx6sabresd/mx6sabresd.c

Add following to support UART2.

static iomux_v3_cfg_t const uart2_pads[] = {

Also add


in setup_iomux_uart

static void setup_iomux_uart(void)

Compile using

make mx6sabresd_defconfig

Since the SPL mode is supported by default - use the following two stage commands to flash the SD Card with

sudo dd if=SPL of=/dev/sdc bs=1k seek=1
sudo dd if=u-boot.img of=/dev/sdc bs=1k seek=69

Please note that this assumes the u-boot to be in the SD Card. This will require that the fuse in the Sabre Lite is not programed for EEPROM

At this point the board is able to boot with following errors

The MMC Card is not detected and the reason is that the Card Detect Pin is different in Sabre SD and the Sabre Lite.

This required following fixes
1.In board/freescale/mx6sabresd/mx6sabresd.c replace

#define USDHC3_CD_GPIO IMX_GPIO_NR(2, 0)
#define USDHC3_CD_GPIO IMX_GPIO_NR(7, 0)

2. Make following changes in usdhc3_pads

static iomux_v3_cfg_t const usdhc3_pads[] = {







The board proceeds but stops at next error

As a quick and dirty fix, returned in the beginning of power_init_board without checking for Power ICs in board/freescale/mx6sabresd/mx6sabresd.c .

int power_init_board(void)

struct pmic *p;
unsigned int reg;
int ret;

// Vikas dirty return to be fixed
return 0;

p = pfuze_common_init(I2C_PMIC);
if (!p)
return -ENODEV;



Serial Port in Ubuntu - Using Terminal

February 20th, 2018

We are often required to use Serial COM port in embedded system ( Like console booting in i.MX6). A USB to serial board comes handy in such case. First find out which Serial port corresponds to the hardware using

ls -la /dev/ttyUSB*

It is most likely going to be /dev/ttyUSB0

Next install putty

sudo apt-get install putty

Once it is install, you can launch putty using the following command

sudo putty /dev/ttyUSB0 -serial -sercfg 115200,8,n,1,N

This example assumes you want baud rate of 115200, 8 bit, no Parity

If you want to use the App instead, you will need to do following '
1. install gksudo
sudo apt-get install gksudo

gksudo is the gui compatriot of sudo

Next we need to modify the file /usr/share/applications/putty.desktop

Open /usr/share/applications/putty.desktop

sudo gedit /usr/share/applications/putty.desktop

Change the line



Exec=gksudo -k -u root putty


Order Notixed

February 5th, 2018

Notixed is up for sale at Reference Designer

Order The Notixed: ( Shipping in US is $4 for first and $1 for each additional)

Notixed - Turn Rpi to USB device
Notixed - Turn Rpi to USB device
Turn Pi Zero into USB device using Notixed, Shipping is $4 in US

Out of US : The shipping is $6 for first and $3 for each additional unit.

Notixed - Turn Rpi to USB device
Notixed - Turn Rpi to USB device
Turn Pi Zero into USB device using Notixed, Shipping is $4 in US


ArduinoPixed - Integrated USB Hub and Arduino for Pi Zero

January 30th, 2018

ArduinoOixed has 3 USB Ports and an integrated Arduino Nano circuit and thereby allows you to seriously enhance the usefulness of Raspberry Pi Zero.


It comes with an On board LED, a Push Button Input and a Thermistor that can be used for temperature measurement.


The Arduino functionality is implemented on ATMEGA328 chip and its Pins come on two Headers of 10 pin each.


The block diagram below best captures its functionality


Arduinopixed builds upon our earlier successful projects including Hubpixed and HubSerialixed. It addressed two of the major concerns of Raspberry Pi Zero users - Lack of useful USB ports and lack of A/D Converters.

The key design element is the pogo pin that connects ArduinoPixed to the Raspberry Pi Zero using 4 provided Pogo Pins. There is no wire, cabling or soldering required. ArduinoPixed can be used as an Educational tool, where you can use a Keyboard and Mouse to hook to Pi Zero and ArduinoPixed to start learning programming. You will not only be able to learn C using Pi Zero, you can actually write programs to check real world sensors, like smoke detectors.

ArduinoPixed is priced competitively at $21 for early birds at Kickstarter ( Normal price is $23 each). If you buy in bulk it is $42 for a pack of two ( and $95 for a pack of 5).

Some FAQ

Q1 - One of the kickstarter enthusiast asked - If I connect it with Raspberry Pi zero W, would the Arduino be able to send data to cloud over WiFi (of R Pi)?

Answer - The way it can potentially work is - Arduino will be throwing the data to Raspberry Pi on its Serial Port. As soon as Pi Zero W receives it, it can upload it to cloud.

If I get time I will try some demo of it.


Order Hubserialixed

January 8th, 2018

Huberialixed is up for sale at Reference Designer

Order The Hubserialixed Blue: ( Shipping in US is $4 for first and $1 for each additional)

HubSerialixed - USB Hub + UART for Pi Zero
HubSerialixed - USB Hub + UART for Pi Zero
Hub + UART for Raspberry Pi Zero, Shipping is $4 in US

Out of US : The shipping is $6 for first and $3 for each additional unit.

HubSerialixed - USB Hub + UART for Pi Zero
HubSerialixed - USB Hub + UART for Pi Zero
Hub + UART for Raspberry Pi Zero, Shipping is $6 out US