The Rising Edge

Python, Parallel Processing, Graphics, Open Source, Embedded Systems

GPU

Dissecting the new .cubin format 1: elfread

written by wladimir, on Jun 27, 2010 1:29:00 PM.

Recently I received some messages about decuda and its current lack of ELF cubin support. With the release of CUDA 3.0, NVIDIA decided to change their GPU code executable object format from the proprietary text-based cubin format to 'industry standard' ELF. As it is a standard, there are quite a few utilities around to analyze the files. I subjected one of the .cubin files produced by the histogram256 example to elfread...

Read on »

Python

Driving AMBX led device from Python

written by wladimir, on Jun 25, 2010 4:36:00 PM.

Back when Philips still made PC hardware, there was the AMBX:

These devices are pretty neat, and cheap if you can find them second hand, as people are dumping them due to lack of Windows 7 support. I couldn't care less about that, and found a second hand AMBX kit for just €20 (originally they cost something like €100). The specs are:

  • One RGB led in the left tower
  • Three RGB leds in the 'wall washer' (the middle part)
  • One RGB led in the right tower

Read on »

Embedded

JTAG using USBee SX

written by wladimir, on Jun 19, 2010 10:56:00 AM.

JTAG (Joint Test Action Group) is a standard commonly used for debugging circuit boards and embedded systems. All kinds of interesting things are possible. For embedded microcontrollers it allows reading and writing memory, re-flashing, single stepping, and other vendor-dependent operations. It also makes so-called "boundary scan" possible, overriding the physical input and output pins of the chip to test other devices connected to it. Multiple integrated circuits on a board connected in a so-called JTAG chain. This allows them all to be tested using one physical access port. This page by Mark Whitis gives an excellent description of JTAG and how it works...

Read on »

Embedded

Unbricking the Belkin F5L049

written by wladimir, on Jun 4, 2010 1:01:00 PM.

In my last post I found out how to enter the bootloader, and execute some debugging commands through a serial console. However, it appears that the only way to write to the flash with the bootloader is with a proprietary protocol over raw ethernet with an unknown ethertype (0x8813). I have reverse-engineered it and written a flasher utility: sxflash (in their quest to make the bootloader as minimal as possible they decided not to simply go with TFTP over IP like most routers)...

Read on »

Embedded

Bricked F5L049, continued

written by wladimir, on Jun 4, 2010 11:54:00 AM.

I connected a FTDI USB to TTL 3.3v serial cable to the serial header on the device, and managed to get into the bootloader by a magic trick (holding the reset button at power-on and immediately releasing it). Using minicom, I got a kind of debug shell...

Read on »

Embedded

PWM on the USBee with custom firmware

written by wladimir, on May 28, 2010 3:26:00 PM.

In this article I described how to use the signal generator firmware to send out PWM signals generated on the PC. However, there is a better way. The USBee SX is based on a Cypress FX2lp, a microcontroller for which the firmware must be sent every time the device is connected. This gives an excellent oppertunity to experiment with custom firmwares that do fun stuff, such as driving led effects independently from the host...

Read on »

Embedded

Poor man's PWM generator

written by wladimir, on May 27, 2010 10:31:00 AM.

In the signal generator application packaged with USBee SX, every waveform has to be manually 'designed'. I wanted to implement a led fading "chase" effect using Pulse Width Modulation (PWM). It is far too much work to manually design the waveforms in that case. Also, as I wanted a solution that also works on Linux, I did not use the DLL API, but instead what I've learnt up to now about the USBee protocol and put it to use with Python and libusb, a convenient way to interface to USB devices without writing kernel modules or device drivers. This is the kind of effect I wanted to achieve (works browsers supporting HTML5 canvas only):

(js source)

Read on »

Embedded

Generating signals using the USBee SX

written by wladimir, on May 26, 2010 8:36:00 PM.

The signal generator program packaged with the USBee does not seem very intuitive to use on first sight. Initially I was unable to change anything, wondering why clicking anywhere in the waveform doesn't do anything. I was starting to doubt that the program was functional at all. Too bad, as this was my reason to get this device instead of the Salae.

  • The default function when clicking with the mouse on the signal is to zoom/unzoom, which is pointless if you don't have a waveform yet.
  • Clicking on anything in the "Edit Waveform" menu, or in the Help, doesn't give any feedback.
  • On the bottom of the window it is possible to move "cursors". These don't allow to set parts of the signal.

Read on »

Ubuntu

Citrix client on Ubuntu

written by wladimir, on May 25, 2010 6:31:00 PM.

Even though the download is in .deb format, installation of the Citrix linux client on Ubuntu (9.10 Karmic) is not trivial. The steps that I followed are:

First, download Citrix NetApp for Linux client version 11.100. After installation, I tried to launch a Citrix app from Firefox. Nothing at all happened, no error messages either. Saving the .ica file and launching it manually got me the following:

$ /usr/lib/ICAClient/wfica  /tmp/launch.asp 
Warning: Missing charsets in String to FontSet conversion
Warning: Unable to load any usable fontset
Error: Aborting: no fontset found

I googled around a bit and finally found out how to solve this error: at the beginning of /usr/lib/ICAClient/wfica.sh, add

export LANG=C

This solved the font problem. After trying again, the following error popped up:

"You have decided not to trust..."
This is caused by Citrix not having all the certificates by default. Copy the .crt files from Firefox:
cp /usr/share/ca-certificates/mozilla/*.crt /usr/lib/ICAClient/keystore/cacerts/

After these steps, it should be possible to use Citrix applications.

Server

Encrypted remote backup with Duplicity

written by wladimir, on May 25, 2010 3:36:00 PM.

I've been using Duplicity for a while now to backup my Linux (virtual) servers. Duplicity is a bandwidth-efficient tool to do encrypted incremental remote backups via SSH, rsync, webdav and many others, for example Amazon S3.

My experience with the tool has been very good. Unlike a lot of incremental backup systems which work on the file level, duplicity goes a level deeper and only backups the blocks of files that have changed. This results in compact backups even with crazy database systems (like InnoDB for MySQL) which put everything into one big file.

As the backup can run automatically from the crontab daily (or even more frequent if desired), it is an excellent no-hassle solution to have an extra level of safety for your files.

Amazon EC2 storage is pretty expensive, and if you only need secondary off-site backup, you can just as well use some cheap online backup hosting box such as Data Storage Unit. This works fine for me. As your backups are encrypted and pass over the line (doubly) encrypted, it doesn't matter whether you trust the backup host at all.