Sunday, February 10, 2013

ARM presentation at Consultants Network of NH

On February 6 I made a presentation to the IEEE Consultants Network of New Hampshire (www.consultantsnh.org) entitled "Beagles and Berries: the World of Low-Cost ARM Computing," about the history of the ARM architecture and describing and demonstrating the Texas Instruments Beagleboard (www.beagleboard.org) and the Raspberry PI (www.raspberrypi.org).
My slides are available for download at https://sites.google.com/site/sensicommllc/Home .

Monday, January 21, 2013

My Debian tweaks

When doing a new Debian Linux installation, there are a set of basic configuration changes that I nearly always make. While the issues do not apply to everyone, I think they are common enough that many others may find them useful. As always, your mileage may vary, use at your own risk, etc.
My system is Debian Testing installed on a laptop that is typically shut down at night and that often runs disconnected from the Internet. So here are the problems I often see and my solutions:

  1. PC locked by fsck. The fsck partition check program typically runs every 30 reboots or so on EXT2/EXT3 filesystems (and maybe others). This automatically happens during the boot process and, per Murphy's law, it usually happens while setting up a critical demo or presentation. The problem is that it can't be interrupted, so the group gets to spend several minutes watching the progress bar slowly move. The fix is to add the lines:
    [options]
    allow_cancellation = true
    to the file /etc/e2fsck.conf. One site that discusses this fix and potential issues is wiki.archlinux.org/index.php/Fsck
  2. Boot pauses due to exim. When booting while not connected to the Internet, the exim mail handling program may hang for 60 seconds. I found that adding
    MAIN_HARDCODE_PRIMARY_HOSTNAME = mypc.example.com
    to /etc/exim4/exim4.conf.localmacros gets rid of the hang, where mypc.example.com should be changed to whatever is appropriate for that PC. Depending on other configuration options, this line might belong somewhere in  /etc/exim4/conf.d instead.
  3. Annoying computer beep.For some reason, many programs seem to think a loud "beep" on errors is a helpful feature. I'm one of the legions that disagree, so I disable the pcspkr device by adding
    blacklist pcspkr
    blacklist snd_pcsp
    to a file in the /etc/modprobe.d/blacklist directory. See www.thinkwiki.org/wiki/How_to_disable_the_pc_speaker_%28beep!%29 for example.
  4. Hardware Clock. Normal PC's have a hardware clock that keeps track of the date and time of day even when the PC is powered off, and Linux also has a system clock that keeps time when running. This system clock is initialized from the hardware clock while booting. In normal Debian setups the /etc/init.d/hwclock.sh script also copies the system clock back to the hardware clock during system shutdown. That's a problem in my system because it's using the less accurate clock to reset the more accurate clock. One fix is to install the ntpdate package; then the system time gets set whenever an Internet connection comes up. Another option I use sometimes is to edit hwclock.sh to disable the hardware clock update, and just set it manually. I'm planning a more detailed post on this issue.

Monday, December 24, 2012

Acer 5253 disk upgrade

 I'll start with the usual warnings: I'm not a PC repair expert; this is what I did, I'm reporting it in case it turns out to be useful for others. It might work for you or it might destroy your PC, wreck your marriage, or give you acne. Proceed at your own risk.


pc with disk drive bay cover removed.
Acer 5353 drive/memory bay. The holes for the locking tabs are clearly visible.

A locking tab looks like this if you pry too hard.

Found a good price on a new hard drive so I decided to upgrade my Acer 5253 notebook PC. The back of the PC has a cover with disk and memory symbols that's held on with 2 screws, so it looks obvious: remove the screws and replace the drive. Nope: take out the screws and pry, and the cover doesn't move. A Google search shows that lots of other folks have had the same problem: there's a series of small molded tabs that have to be pried loose. I used some cheap miniature screwdrivers to pry the tabs back. Only one of the tabs broke, which I think is a decent record.

Next step is to get the old drive out: it's mounted in a metal frame that's held in by one screw at the lower right and one small tab at the upper left. I took out the screw and slid the drive to the right. I found that it took a really hard push to get the drive to move: it seemed to hang up on the silvery tape under the top right frame end. After getting it out the first time, the drive slid in and out quite easily. For reassembly, I just reversed the steps: put the metal frame on the new drive (4 screws), engage the tab on the frame with the slot at the upper left edge of the mounting bay, slide into position, put the mounting screw back in, and finally put the plastic cover back on.
This tab at the upper left helps hold the drive in.
I found this YouTube video http://www.youtube.com/watch?v=ox1OkNVGBlg showing the whole process; it's a different model but the process looks about the same. Removing the cover and the old drive looks a lot easier for him than it was for me, though.
The tab slides down into this slot and then right.
The new drive is a white label unit from goharddrive.com, who I found via the pricewatch.com website. Just a one-time purchase from them, but shipping was prompt and the drive has been working fine so far.

Friday, January 27, 2012

STM32 STM32F4DISCOVERY arm eval board and Linux

Picked up this eval board at the last Embedded Systems Conference, and finally starting to work with it. The chip is a 168MHz ARM Cortex M4 with 12-bit A/D and D/A's . The eval board includes an accelerometer, microphone, and separate audio D/A chip, among other things. Pricing is really interesting. Here are Digikey quantity-1 prices:
STM32F4DISCOVERY $19.50
STM32F407VGT6     $16.00
STM32F103C8T6    $ 5.71
(The F407 is the main ARM chip, and the F103 is a smaller ARM chip used as a programming interface). So the eval board is actually cheaper than the chips on it.

The F407 chip has a built-in program loader using either the serial port or the USB port. Both are supported by Linux tools, so I'm ignoring the F103-based programming port and using the F407's USB port.

Connections: I have USB cables from my Linux box to both the F103's mini-USB connector at the top and the F407's micro-USB connector at the bottom. The mini-usb is just used to supply power to the board, and isn't necessary if an external supply is used.

The programming tool is dfu-util, from dfu-util.gnumonks.org . I downloaded and built the latest version from the git repository. To test it, I used the miniblink example program from the libopencm3 package at www.libopencm3.org/wiki/Downloads . libopencm3 uses the summon-arm toolchain, so I downloaded and built that as well so the example would compile easily. (This also means I now have 5 different versions of GNU GCC for ARM on my system: summon-arm (linaro-based), 2 from CodeSourcery, one from openembedded, and a built-from-scratch GCC. One of these days I'll simplify that).

To program, I connect a jumper between the 3V and boot0 pins on connector P2. After hitting the black reset button, lsusb shows USB devices connected as:
Bus 001 Device 011: ID 0483:df11 SGS Thomson Microelectronics STM Device in DFU Mode
Bus 001 Device 012: ID 0483:3748 SGS Thomson Microelectronics ST-LINK/V2
To use it without being root, I also added the line:
SYSFS{idVendor}=="0483", SYSFS{idProduct}=="df11", MODE="666" GROUP="plugdev" SYMLINK+="usb/stm32_dfu"
to plugdev (in Debian, I just created a new file in the /etc/udev/rules.d directory with this single line in it. Locations may be slightly different in other Linux distributions).
With that done, the command:
dfu-util  --device 0483:df11 --alt 0 \
        --dfuse-address 0x08000000 \
        --download /miniblink.bin
works. I removed the jumper and hit reset again, and a single LED blinks, as expected.

So that's "Hello, World" for the STM32F4DISCOVERY. Now I can start doing real work with it.

Wednesday, November 23, 2011

Desampling using a Cascaded Integrator Comb filter

Been working with a BeagleBoard for the last few months. Can't say much about the project but the Beagle is a nice ARM Linux platform. Finishing up, so now I have more time to update the MHZ100Q sourceforge project page.
I've now added a page describing the ideas behind the Cascaded Integrator-Comb (CIC) filter, and why it makes such a nice desampling filter for a high-rate data acquisition system. Input is 100MHz at 8 bits, and the output is any integer submultiple down to about 1kHz. The hardware resources in the FPGA are low: a set of 64-bit adders and registers, along with a reasonable amount of control logic.
The first version of the page is general description and overview. I plan to put more details of the math behind the CIC. In researching math and html, I found asciimathml.js . It's an open source JavaScript package that lets one embed equations into a webpage's text using simple LaTeX-like strings. I've used it internally and it's really nice to use. Should be live on the mhz100q page in the near future.

Friday, September 30, 2011

Embedded systems Conference

I was at the Embedded Systems Conference in Boston this week, and Vgo Communications www.vgocomm.com had their telepresence robot roaming around on the exhibits floor. It was pretty unobtrusive, just wandering around the booths along with the rest of us.
I don't have any connection with them, just think it's a cute device.

Tuesday, May 17, 2011

Acer Laptop and Linux

My old Averatec laptop started producing read errors on the hard drive - not good! I didn't lose anything important thanks to backups. PATA drives seem to be pretty much unavailable these days, so I ended up getting a new Acer 5253-BZ602 laptop. The first part of the fun with any new laptop is getting Linux installed and getting the peripherals working. Had to go with the latest Debian unstable distribution in order to get a working LAN driver. Most of the pieces are working now (graphics, wireless, ethernet, camera, etc). A web page with current status and driver info is at
http://www.sensicomm.com/main/linux/acer_5253/index.shtml .