hacking on ARM Cortex-M3 with openocd/gdb

rule #1: thou shalt remember to use the cross-compiled GDB when debugging remote embedded targets! in other words, use “arm-none-eabi-gdb” not “gdb”

random gdb commands

starting:

arm-none-eabi-gdb ELF-FILENAME

connect to openocd:
<code>
target remote localhost:3333

control the processor:

monitor halt
monitor reset
monitor resume
continue
Ctrl-C

sniffing around:

info registers
info locals
x/32wx ADDRESS

FTDI drivers

To add a specific vid/pid combination to the ftdi_sio driver, without having to recompile it:

echo "VID PID" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id

Random video-manipulation tools

Recording screen to mp4 on ubuntu with ffmpeg/avconv

avconv -f x11grab -r 25 -s 900x900 -i :0.0+1280,100 -vcodec libx264 -pre lossless_ultrafast -threads 0 test.mp4

Extract DV from mpeg-4, to go to iMovie:

ffmpeg -y -i INPUT.m4v -map 0.0:0.0 -f dv -vcodec dvvideo -b 25000 -aspect 16:9 -r ntsc -g 240 -qmin 2 -qmax 15 -acodec pcm_s16le -ab 1411 -ar 48000 -ac 2 -map 0.1:0.1 -target ntsc-dv -ss START_TIME -t LENGTH OUTPUT.dv

Extract images from a movie (at a reduced framerate):

ffmpeg -i INPUT.avi -r 2 -f image2 %05d.png

Assemble images into a movie:

ffmpeg -i %05d.png -sameq OUTPUT.mp4

Encode movie without audio:

ffmpeg -i INPUT -an [LOTS_OF_FLAGS] OUTPUT

Take screenshots with mplayer:

mplayer -vf screenshot MOVIEFILE

MPEG4 encoding using ffmpeg:

ffmpeg -i INPUT -mbd rd -flags +4mv+aic -b BITRATE -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2 -ss 0.5 OUTPUT.mp4

Windows Media encoding using ffmpeg (for powerpoint, etc.)

ffmpeg -i INPUT -b BITRATE -vcodec wmv2 -acodec wmav2 OUTPUT.wmv

Export an openshot sequence as a series of images. Actually, this doesn't seem to work, as the audio stream seems to be interpolated in the image stream. The GUI works, though.

openshot-render -i -F OUTPUT_DIRNAME -f png -o "OUTPUT_STEM_%d" INPUT.osp 

Assemble sequence of images into a widescreen mp4:

ffmpeg -i INPUT_STEM_%05d.png -b BITRATE -aspect 16:9 -trellis 2 -cmp 2 -subcmp 2 -g 300 -ss 0.5 OUTPUT.mp4

Assemble sequence of images into a widescreen mp4, add a soundtrack file, and stop encoding when the video is done (since the soundtrack/music may be longer than the video):

ffmpeg -i INPUT_IMAGE_STEM_%05d.png -i AUDIO_FILE -map 0:0 -map 1:0 -b 4000000 -aspect 16:9 -trellis 2 -cmp 2 -subcmp 2 -g 300 -ss 0.5 -acodec libmp3lame -t 64 OUTPUT.mp4

SVN

View a specific revision of a file

svn cat -r REVISION filename | vim -

Add users to apache auth:

sudo htpasswd PASSWD-FILE USERNAME

PR2

roslaunch /etc/ros/robot.cturtle.launch
rosrun pr2_tuckarm tuck_arms.py b
roslaunch pr2_teleop teleop_joystick.launch

on laptop:

export ROS_MASTER_URI=http://stair4a:11311/
rosrun rviz rviz