Wednesday, February 11, 2009

stupid little alarm program (bash script)

almost missing office hour due to jetlag is not a nice idea.. hence wrote this nonsense little script, which would stream a shoutcast stream while waiting to kick me up screaming..
Now, why should I suffer alone? :D..
#!/bin/bash
#Choose your favourite stations from shoutcast.com (net radio)
LINK="http://yp.shoutcast.com/sbin/tunein-station.pls?id=6063"
if [ $# -eq 0 ]; then
echo "usage $0 wakeup_duration"
echo "wakeup_duration: wakeup after how long? 6 hours, 1 hour, 20 mins etc. or even 5am tomorrow.."
exit 1
fi
NOW_SEC=$(date +%s)
WAKEUP_SEC=$(date +%s --date="$*")
if [ $? -ne 0 ]; then
echo "oopss.. i dont think date understands $*"
exit 2
fi
if [ $NOW_SEC -gt $WAKEUP_SEC ]; then
SLEEP_SEC=$(( $NOW_SEC - $WAKEUP_SEC))
echo "Do you wish to wakeup $SLEEP_SEC seconds previously??.."
echo "Sorry cant help you with that.. :("
exit 3
fi
SLEEP_SEC=$(( $WAKEUP_SEC - $NOW_SEC))
echo "NOW=$NOW_SEC WAKE=$WAKEUP_SEC DIFF=$SLEEP_SEC"
echo wakeup at `date --date="$*"`

#Trap CTRL+C and cleanup - set mute back..
trap cleanup 1 2 3 4 5 6
cleanup()
{
echo "Caught Signal from user- muting myself"
amixer -c 0 -- sset Master playback 0%
amixer -c 0 -- sset Master mute
amixer -c 0 set PCM 0%
exit 1
}

# unmute all
amixer -c 0 -- sset Master unmute
# Set my music volume
amixer -c 0 -- sset Master playback 30%
amixer -c 0 set PCM 100%
totem "$LINK" &
sleep $SLEEP_SEC
killall totem

# Set my announce volume
amixer -c 0 -- sset Master playback 100%
amixer -c 0 set PCM 100%
i=0
# have I Really GONE BONKERS?
while [ $i -ne 5000 ]
do
echo "Attempt $i - CTRL+C to stop me screaming"
# You may want your favorite statement here..
echo '(SayText "Nishanth, wakeup dude.. time to go to office..")'|festival
i=`expr $i + 1`
done

Now, dont blame me if this wakes you up... or hate me for writing this silly lil script.. (needs festival, totem, plugins for totem, internet connection and a really sleepy mind..

Tuesday, February 03, 2009

NAND not booting on a new OMAP3 board? check this list out

The following check list was compiled based on a discussion here
a) Did you check if the device id of the device is in TRM under
supported devices? -> ROM Code should support this device if it should ever boot..
b) Did you read your CTRL_STATUS register and verify the SYSBOOT boot sequence in TRM -> is NAND in the sequence and nothing else preventing it from being hit?
c) what is the status of your EMU0-1 JTAG pins are they both high or in tristate condition during OMAP boot? -> the wrong setting would prevent boot sequence from being executed
d) is it on CS0? -> well OMAP boots out of CS0
e) Do you have an 8 bit or a 16 bit NAND? is your config file in
x-loader, u-boot handling this correctly? -> accessing wrong width is not very helpful.. ;)
f) Did you sign x-loader.bin.ift with signGP.c? Try this in x-loader
directory: grep _start System.map|cut -d' ' -f1|xargs signGP x-load.bin -> x-loader loads up at the address we tell it to, few variants of x-loaders seem to use different base addresses.. just to be sure..sign the x-loader correctly
g) Finally did you use nandecc hw for flashing x-loader.bin.ift? - well.. that is the only ECC formatting that OMAP ROM Code understands..
h) what is the result of nand dump 0? the OOB area? - this verifies the ECC organization
i) you could in theory write a very small piece of assembly to shut down watchdog timer, and basically loop for ever -> flash this instead of x-loader then once the board boots up, connect with JTAG and see if your infinite loop is running in SRAM.. if so, you have your flashing correct, but mebbe x-loader is goofing up somewhere..
-> this is just my fav way of debug..

Sunday, February 01, 2009

OMAP support in U-boot-v1

Finally! After months of effort by many, mostly Dirk driving hard, we have omap3 support in:
a) beagleboard
b) overo
c) evm
d) pandora
e) zoom1.

This should ideally make omapzoom git based u-boot redundant. Lets see if this happens in the upcoming days.. v2009.02 will have official support :).. Hip Hip Hooraah!!