Wednesday, May 27, 2009

quick HOWTO: Configure Ubuntu 8.10 for VPN access

Thanks to Sergio Aguirre a quick HOWTO: Configure Ubuntu 8.10 for VPN access (for Cisco vpn)

Basic Requirements:
Make sure you have the latest patches and updates for Ubuntu 8.10:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vpnc network-manager-vpnc

1. Go to System > Preferences > Network Configuration
2. Select VPN tab
3. Click on Add button at the right side of the list
4. choose a vpn connection type: Cisco compatible vpn(vpnc)
5. click on create
6. Enter the following configuration (Other than the specified, leave everything else unchecked):
Connection name: CorporateName
Connect automatically: enable the checkbox if you would like it to..
Group name: VPN GROUP
User password: my_user_id
Group password: myPassword
User name:
5. Click on 'OK'

Enabling/disabling VPN access:
1. Left click on network icon in upper bar (next to the clock)
2. Go to VPN connections
3. Select CorporateName for enabling, or Disconnect for disabling.

Tuesday, May 26, 2009

Linux Aware debugging with CCS!

yes, we have heard of openOCD, Lauterbach, yet till date, I personally have'nt been able to use CCS to debug linux.. This post gives an interesting saga for those interested
Warning: it is a little lengthy post, so as of the time of posting:
Summary - CCS4 has support for linux kernel aware debugging, and unfortunately there is a small glitch of support of kernels 2.6.26 and above - the ccs team is working on a fix at this point.. hopefully we will have a full soln soon.. Thanks to John in deligently following up on this..

Setting up Email forwarding System for GIT

The post is a derivative of the omapzoom wiki page. Disclaimer: my mastery of the wiki tags are dismal.. apologies... some day i hope to have time to post it here

Many new developers have been stumped when they need to use git-send-email in corporate environment – usually, if not as a norm, ms exchange servers form the backbone of such an email server system. This page was written based on one of such requirements.

To get started, we shall consider common scenarios:
a) Setting up a mail forwarding system with postfix on ubuntu
b) Setting up a mail forwarding system on a fedora machine
c) Using msmtp for using gmail
a. to send a patch using a gmail ID
b. to send a patch using your corporate ID but through gmail

Postfix on Ubuntu – mail forwarding
For setting up postfix, you need:
a) A mail relay server which will allow your machine to talk to it -> speak to your IT representatives/ other developers sitting next to you
b) Super user privileges on the machine you are working on.

Step 1: Check if the required packages are present
$ dpkg --get-selections grep postfix
postfix install

Step2: If postfix is already installed and not properly configured, uninstall the same:
$ sudo apt-get purge postfix

Do you want to continue Y/n?? y
(Reading database ... 260051 files and directories currently installed.)
Removing mailutils ...
Purging configuration files for mailutils ...
Removing postfix ...
* Stopping Postfix Mail Transport Agent postfix OK?
Purging configuration files for postfix ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Step3: Reinstall postfix:
$ sudo apt-get install postfix

When you install postfix, we go through a few screens as follows:

a) postfix gives a bit of help information -> read through it -> esp the idea of a “Satellite System” – this is what we will be using here.

b) postfix now asks you about what type of mail server do you wish to setup here -> say you want a “Satellite system”
c) now postfix will ask you for your machine’s domain name -> give the name of the machine you are using -> note, this is not the same as the relay server we will be using.
d) Post fix now asks for your email relay server information -> provide the complete machine information here

Postfix on Fedora – mail forwarding
Please refer 'Postfix Pre-Installation Steps', 'Installing Postfix on Fedora Linux' and 'Starting Postfix on Fedora Linux' sections of this link

Note: Before moving on to the 'Starting Postfix on Fedora Linux' section of the link, open /etc/postfix/ file and edit the following parameters only

myhostname = (Enter your hostname here)
relayhost = (Put the appropriate server here for your location)
Using msmtp as the email forwarding system for gmail

Note: If you successfully configured postfix you dont need to configure msmtp.
Step 1: You now need to make a choice -> if you would like to configure your gmail account to send emails on behalf of your corporate mail ID, you need to configure gmail for the same - else skip this step ;)
a) go to and log in with your user id and password
b) click on settings:
c) Select accounts

d) Click on “Add another email address you own”
e) A pop up appears: Fill up the required information and click on Send verification

f) Look in your mail account you added for the confirmation number:
g) Provide this to the pop up window
h) Set up gmail settings to always reply to the same email id which send the email as follows:
That is it. You can now send email from your gmail account as if it were send by your corporate account.

Step 2: Installing msmtp is as simple as “sudo apt-get install msmtp” or “sudo yum install msmtp” as required for your distro.. worst case you can build and install it yourself from

Step 3: You now need to configure msmtp -> create a ~/.msmtprc file with permissions for 400 (user readonly).. as follows:
# Example for a user configuration file
# Set default values for all
following accounts.
tls on
# The ca-bundle.crt is the file
with CA certificates for Fedora Core 6.
# for other distros you might have
to dig it up from somewhere else.
# On Ubuntu
/etc/ssl/certs/ca-certificates.crt should be used, for example.
# My
shortcut has been to use ‘locate ca-bundle.crt’ and use which ever one I think
is good ;)
tls_trust_file /etc/pki/tls/certs/ca-bundle.crt
# My email service
account gmail
port 587
#NOTE: if you are using your corporate email ID and have
configured gmail -> provide that below
auth on
#The following IS your gmail ID and password
password my-secret
# Set a default account
account default : gmail

The example here is for a Gmail account, but can easily be changed to use the local SMTP server as well.

Step 4: Now, by giving the full path name to the msmtp program as smtp server to git-send-email, you can send the patches through gmail or some other smtp account with TLS and/or user authentication.
git-send-email --smtp-server /usr/bin/msmtp
An alternative to setting --smtp-server each time is to set the global sendemail.smtpserver value.
git-config --global sendemail.smtpserver /usr/bin/msmtp
Another option is to configure a local smtp server on your machine, using a well-known SMTP server as smarthost. Then, all applications using localhost as a mail server (e.g. /usr/bin/mail) will work.

NOTE: On OS X with macports, msmtp can be installed with 'sudo port install msmtp', and '/usr/share/curl/curl-ca-bundle.crt' should work for tls_trust_file.
And your email forwarding system is setup:)

Monday, May 25, 2009

TI's e2e portal

TI has a engineer to engineer forum here: forums this allows folks to:
a) Get a direct and quick answer for a technical question
b) lookup and search for old solutions which might help current problems one might face.
Some of the interesting forums are:
Code Composer Studio
OMAP Application Processor
Power Management IC such as TWL5030 TPS derivatives

it even allows you to have a email notification and bunch of usual stuff..

gst dsp - an alternative to openmax IL

Felipe C recently published gst-dsp


This is an alternative to the gstreamer plugins of gstreamer on TI Davinci and OMAP and openmax for OMAP

gstreamer for TI Davinci and OMAP builds on top of dsplink while openMAX for OMAP builds on top of dspbridge -> interestingly gst-dsp builds on top of dspbridge. Try and do comment.. and dont forget to send your patches ;).. I have'nt had much chance to dig much into this new code yet -> but it sure looks sleek and full of potential

usb3 transciever

This news article was interesting.. hmm... how long before we see the first products in the market in the world of wireless devices?? munching time ;)

Wednesday, May 06, 2009

OMAP power management simplified(?)

Excerpts from the thread here
A detailed presentation done by Richard Woodruff can be found here

To start this discussion, think what OMAP really is.. OMAP is made of multiple small parts inside it (peripherals) - each peripheral can be individually shut off or switched on as need be.

OPP or Operating Points:
In fact OMAP could also be used like a car gear, if you need higher processing power, switch to a different "operating point". Each of these operating points is a set of voltage and frequencies that each peripherals and OMAP functions at -> usually the main peripherals of interest from a speed perspective are ARM and DSP, but like a car, when you speed up, you will consume more power..

[BUT unlike a car, during operation, OMAP's carbon footprint is pretty tiny]

Since OMAP is also made up of various peripherals, you can switch off many of these peripherals when not in use, in fact you can have many levels of "switch off" = retention and off modes are general terms for which I cannot think of exact equivalents in real world except, maybe - hibernation and suspend in a PC.. In off mode, OMAP is essentially down consuming pretty few uWatts of power or less, but the SDRAM contents are retained - so when you wake back up from off mode, you can "restore" your state precisely where you left it in a matter of few uSec or so.. retention you shut lesser parts of OMAP off, so when you wakeup, you would wakeup even faster (compared to offmode), yet, you wont incur the cost of keeping OMAP running continuously..

[In case you are thinking: why not support hibernation in OMAP linux kernel? unlike a desktop or a laptop PC where you have umpteen amount of disk space, in a typical embedded sytem, you probably have a few megabytes of flash memory for non volatile storage.. that kinda limits what you can put in it.. ofcourse, we can think of compressing the SDRAM contents when we store etc.. but I have'nt heard of anyone doing it (yet)..]

time to wakeup: retention < offmode < < << cold boot
power consumption: complete power off < offmode < retention < < < < omap running

Configuration Header: No more x-loader for NAND boot!!

[discussion thread here]

Few days back looking at OMAP3430 Public TRM I found the section 3427), it was exciting to see what possibilities lay here.. a little more digging later and few hours of coding later, figured out that by adding a certain data as a prefix to the real image, we can boot u-boot or for that matter any image straight from NAND flash into sdram.. essentially this is what x-loader does, only that OMAP3430 ROMCode already has that feature..

What exactly is Configuration Header(CH)?
CH is a set of register values to the critical OMAP registers that define how the clocks, sdram controller, gpmc controller, mmc controllers are configured.. it is more like an array of register values - you fill them up with the correct values, and store the load address you would like the resultant image to load up, bingo, we have the image booting off that location.. There are few of these structures that are defined in the TRM which has a detailed description on the real sequence of operation..

What does Configuration Header save us?
Time :)! Traditional NAND boot has always been:
  • ROMCode takes x-loader from NAND, put it in SRAM and boot it.
  • x-loader goes ahead and configures clock, sdram etc.. then proceeds to load u-boot from NAND to SDRAM and execute it
Instead we can now reduce this sequence to a single sequence:
  • ROMCode takes u-boot from NAND, put it in SDRAM and boots it.
Infact, my measurement with my digital wristwatch showed a 2 second saving of bootdelay! okay, my measurement is not exactly accurate, but it gives an approximation ;)

Aaah.. I am excited with Configuration Header and want to use it.. How do I do it?
You are in luck :).. my recent commit to omap u-boot-utils has the required code for signing a u-boot to use configuration header in a GP device.. there is even a sample.cfg file with the settings that worked for me on beagleboard :)..

Do a "gpsign -c conf/sample.cfg -f u-boot.bin" will generate a u-boot.bin.ift file. flash this image using h/w ecc (the "nandecc hw" command in u-boot) to offset 0x0 in nand and reset the board.. viola, it should boot straight into u-boot skipping the x-loader step :)

Apologies that I do not (at the time of this post) have a prebuilt omap-uboot-utils binaries, but hope to do it for v3.0 tag in the future, esp if folks have some further fixes or improvements -> for the time being it requires a git pull and a host machine build :(..

Caveat: there is somesort of a 128KiB limitation on MLO file signed like this for MMC Card with FAT filesystem, so I generally use x-loader still in MMC boot..

By the way, this feature is not available in the previous OMAP2 or OMAP1 devices..