REVO & warpx.io Team ELC Portland 2017

The warpx.io team will be at ELC showing off our ultra low power i.mx6sl platform. Contact us for a meetup in Portland! #lfelc #ELC2017

For more info about Warp, visit the community site: http://warpx.io

Powering Warp from USB

Warp CAN be powered by USB and the battery is not required! However… not all USB ports are made equal, and some USB ports just can’t supply enough power for Warp during certain operations.

We’ve seen this issue come up with USB  2.0 ports in particular. The max limit of USB 2.0 is typically around 500mA at 5V and sometimes the surge currents just can’t be supplied. The mode of failure varies: sometimes the board will fail an operation like an eMMC write but continue operating, other times the system might hang or reboot.

In our office, we use USB 3.0 hubs or charging ports that can supply at least 1A and they seem to all power Warp fine.

If you’re using the Interposer board, you can use two USB cables to power Warp just fine from USB 2.0. Just make sure you have the right jumpers enabled (Install the jumper for “Use Debug VBUS” & and set “WARP Battery Source” to “DCIN”). Of course you could also use the 12V DCIN but you might already be using two USB cables.

FYI when powering off battery, you won’t see these issues either. Even when connected via USB 2.0 with limited supply, the battery can help as a backup power source and allow the board to run fine.

Come learn about WaRP @ Wearables TechCon 2016

WTC2016-LOGOREVO and Kynetics will be presenting at Wearables TechCon 2016! We’ll be showing off some cool capabilities of the WaRP platform and talking about how to develop a project using a platform like ours. We’ve also been busy building up some stock of WaRP boards ourselves and are planning to have them available at the show! We hope to see you there, and definitely let us know if you’re be attending so we can meet up with our friends and followers.

Find out more about Wearables TechCon here!

WaRP Talk @ JavaOne 2015

Hi everyone, Aaron and Nicola will be talking about running Java on the WaRP at JavaOne 2015. The session is: CON10282 – “Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, Using WaRP” and will be on Wed 10/28/2015 @ 11:30AM Hilton Continental Ballroom 7/8/9. We’re going to be talking about how to add sensors to the WaRP platform using the dev kit and look at how to access those sensors from Java to get it connected up to the Cloud.

If you’re at the conference and want to come learn more about WaRP, come to our session! We’ll also be around and be glad to share/discuss WaRP and everything else at the show.

See you there!

Quick Guidelines for Warp Daughterboard Design

We just posted the Daughterboard Design “Quicksheet”. This describes all the interfaces available from the WaRP Mainboard and should help in designing/developing custom daughterboards. Let us know if you have any questions, and we’ll be updating this document in the future with more details so keep checking back!

Head over to the Warp->Downloads section or grab the link from here:
http://revotics.com/assets/warp/WaRP-DaughterboardDesignQuicksheet_v1.5.pdf

Setting up an Android build environment for WaRP

Building Android for the first time can be an aggravating and time consuming process. Following these step-by-step instructions should result in a working build environment and a successful Android build with all the images that are needed to run Android on WaRP, including the bootloader, kernel and Android system and recovery partition.

This guide was written starting from installation of Ubuntu Desktop 14.04.2 LTS on a VM. Users

Important Notes

  • Building Android requires approximately 50GB of free disk space.
  • Downloading all the pre-requisite files during the ‘repo sync’ step can take more than an hour depending on connection speed.
  • Building Android can take a few hours, depending on the speed of your machine.

Getting Started

This guide was written using a VM (VMWare or VirtualBox should both work fine).

VMWare Workstation (Free Trial)

VirtualBox (Free)

64-bit Ubuntu Desktop 14.04.2 LTS (64-bit version required. 32-bit version will not build Android)

On first boot of Ubuntu, install system updates

If using VMWare, install VMWare Tools now.

Install OpenJDK6

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
sudo apt-get install bison git gperf libxml2-utils make zlib1g-dev:i386 zip
sudo apt-get install g++-multilib 
sudo apt-get install liblzo2-dev:i386

Install gcc and g++

sudo apt-get install gcc
sudo apt-get install g++

Configure git user and email

git config --global user.name "FirstName LastName"
git config --global user.email username@domain.com

Installing vim/gvim
I use gvim for source editing. Because this is a fresh Ubuntu install, go ahead and install your text editor of choice.

sudo apt-get install vim-gtk

Install repo

mkdir ~/bin
PATH=~/bin:$PATH

curl https://storage.googleapis.com/git-repo-downloads/repo &> ~/bin/repo
chmod a+x ~/bin/repo

Initialize and download Android repository (source code)

Warning: ‘repo sync’ step downloads the source repository and can take a long time depending on connection speed.

mkdir WaRP_Android
repo init -u https://github.com/warpboard/platform_manifest/ -b warp/imx_open_jb4.3_1.1.0-ga
repo sync

Set up environment variables

Add the following lines to ~/.bashrc to define the machine architecture and cross compiler.

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
export PATH=~/bin:$PATH

# Android build specific defines
export USE_CCACHE=1

Not required, but I like to use these grep and find aliases when working with the kernel. They can be added to ~/.bashrc

alias sgrep='grep --include={*.c,*.h} -rn "./" -i -e'
alias kgrep='grep --include={Makefile,Kconfig} -rn "./" -i -e'
alias sfind='find . | grep'

Build Android
We should be all ready to build now!

source build/envsetup.sh
lunch warpboard-eng
make -j4

Build outputs
Congratulations, you should now have successfully built images that you can load onto your WaRP board.
Images should be located in the directory:

~/WaRP_Android/out/target/product/warp
U-Boot bootloader binary:
u-boot.imx
Binaries for system:
boot.img
recovery.img
system.img

Additional External Resources
Official Android Instructions for Initializing a Build Environment

A Look at Sensor Hub JSON Messaging on WaRP

For WaRP we wanted a simple communication protocol for talking to hardware. Something that would be easy for software developers to use and interact with. Our first requirement was that the messages be human readable for development purposes to avoid trying to decode bit-streams and packets. The second requirement was to allow for variable payloads that could easily be parsed in software.

We choose to use a messaging protocol based on JSON. The lightweight data-interchange format is commonly used in modern programming languages and is portable across platforms. JSON messages are used to send commands and read data back from various peripherals on the Daughterboard.

The messages developed on the Daughterboard are specific to the peripherals on it, but can easily be extended using our protocol.

Viewing  Messages from Daughterboard

A simple way to view the UART data stream coming from the Daughterboard is to cat the UART device /dev/ttymxc2. Performing this operation in the background using the ampersand (&) at the end of the command will cause messages received by the WaRP on ttymxc2 to be printed to the terminal, but still allow typing into the command line.

cat /dev/ttymxc2 &

To kill the background process, use the jobs command to identify the job number and then the kill command to stop it.

root@warp:/ # jobs

[1] + Running   cat /dev/ttymxc2

root@warp:/ # kill %1

Note that interacting with /dev/ttymxc2 from multiple points (e.g. command line and pedometer app or button handler) can cause corruption of the data stream and may result in dropped event signals.

Sending Messages to the Daughterboard

The pedometer example application periodically sends a request for up to date data from the daughterboard by issuing the GET command to the MMA9553L daughterboard device:

{"MMA9553L":"GET"}

While the pedometer app does this programatically, interacting with the daughterboard from the command line is also straight forward. In the terminal simply echo the command to ttymxc2, escaping any special characters as shown below.

Request:

root@warp:/ # echo "{\"MMA9553L\":\"GET\"}" > /dev/ttymxc2

Response:

{"MMA9553L":"Status","data":{"steps":0,"distance":0,"speed":0,"calories":0}}

JSON Messaging Interface

The JSON interface available at release is as follows. Additional functionality can of course be added or exposed by modifying the daughterboard firmware, which is a lesson for another time.

Messages to KL16 from WaRP

Pedometer data request
{“MMA9553L”:”GET”}
Buzzer on/off control
{“BUZZER”:”ON”}
{“BUZZER”:”OFF”}

Messages from KL16 to WaRP

System message from daughterboard
{“SYSMSG”:”System message string”}
Status packet from MMA9553L pedometer
{“MMA9553L”:”Status”,”data”:{“steps”:0,”distance”:0,”speed”:0,”calories”:0}}
Button state messages
{“BTN0”:0}
{“BTN0”:1}
{“BTN1”:0}
{“BTN1”:1}
Push Button 0 Down Event
Push Button 0 Up Event
Push Button 1 Down Event
Push Button 1 Up Event

Troubleshooting WaRP Button Issues

There are a variety of reasons why the push buttons on the WaRP may not be behaving as intended. This guide will help determine if the cause is due to configuration, firmware, software or a hardware issue.

First, from a serial console adb shell, check that /dev/ttymxc2 is configured correctly:

root@warp:/ # stty -F /dev/ttymxc2
stty -F /dev/ttymxc2
speed 115200 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint -icrnl -imaxbel
-opost
-isig -icanon -iexten -echo

If the baudrate is not 115200 or if other settings are different, communication between the DB and WaRP is likely not working. This can be set manually, but a better solution is to flash the system with the latest Android images.

Next, check whether button presses are being received by the WaRP from the daughterboard by using cat on /dev/ttymxc2. Put it in the background so that it continues displaying UART data received while you move onto the next step.

root@warp:/ # cat /dev/ttymxc2 &
cat /dev/ttymxc2 &

Pressing the daughterboard buttons should now result in the WaRP mainboard receiving and printing messages indicating button down [0] and button up [1] events:

{"BTN0":0}
{"BTN0":1}
{"BTN1":0}
{"BTN1":1}

If messages are not being received, the daughterboard may not be functioning correctly or may have an old firmware. To check the firmware version we can toggle the daughterboard RESET# line using the iMX6SL gpio from the command line, which will cause the daughterboard to report a start-up condition and the firmware version running.

 

Note that GPIO93 (KEY_ROW2) is valid only for revision 1.10 of the WaRP (pre-production boards). Production boards will use GPIO95 instead.

  1. Set up GPIO93 for control from command line
  2. Set GPIO93 as an output
  3. Set the value of GPIO93 low to initiate a reset
  4. Set the value of GPIO93 high to release the reset signal
  5. KL16 will reset and send start-up messages, including version number to /dev/ttymxc2
root@warp:/ # echo 93 > /sys/class/gpio/export
root@warp:/ # echo out > /sys/class/gpio/gpio93/direction
root@warp:/ # echo 0 > /sys/class/gpio/gpio93/value
root@warp:/ # echo 1 > /sys/class/gpio/gpio93/value

Start-up message:

{"SYSMSG":"WaRP Daughterboard Started","Version":"0.1beta-20150302"}
{"MMA9553L":"Status","data":{"steps":0,"distance":0,"speed":0,"calories":0}}

WaRP Schematics Posted

We just posted the first public release of the WaRP Mainboard and Daughterboard schematics. Head over to the Downloads subsection to find them.

These schematics are the current production versions so get a head start on learning whats under the hood powering WaRP.