modified on 11 April 2012 at 16:33 ••• 201,087 views

Electrum FAQ

From Manuals

Jump to: navigation, search


Frequently Asked Questions - Hardware

How much current is required by the Electrum controllers?

On typical operating conditions, the current requirements are as follows. Note that I/O devices may increase total current requirements so the complete system should be considered when sizing power requirements.

Electrum 100: +5V@300mA
Electrum 200: +5V@400mA

Are digital inputs compatible with 5V logic?

No. PIOs on AT91SAM9 microcontrollers support 3.3V logic. Level shifters should be used to interface to 5V logic.

How can I set the real time clock (RTC)?

From a Linux command line you can use the 'date' command to set the system date and then 'hwclock' to copy the system date to the hardware clock. The RTC battery option is required to keep time after power off.

# date 063011222010
Wed Jun 30 11:22:00 UTC 2010
# hwclock --systohc

To set the timezone use 'tzselect' and edit the UTC value on /etc/default/rcS. To sync time with NTP servers install 'ntpdate' using 'apt'.

How can I change the MAC address of the board?

The Micromint Electrum is assigned a MAC address during production from the Micromint block 00:21:a3:xx:yy:zz. This address is stored on the U-Boot configuration as the 'ethaddr' environment variable. To prevent accidental changes to the MAC address, the bootloader console does not allow changing the MAC address once it is set. If you need to substitute the assigned MAC address you can clear the bootloader environment by executing the commands below from the bootloader console. After rebooting, you will be able to change the 'ethaddr' variable. Note that you will need to apply any other changes you made to the bootloader configuration.

Electrum> mw.b 0x20100000 0 4
Electrum> cp.b 0x20100000 0xD0002100 4
Copy to DataFlash... done
Electrum> reset

What character LCD is recommended for use with the Electrum 100's LCD connector?

AZ Displays ACM2004D series is recommended for use with the Electrum 100.

What keypad is recommended for use with the Electrum 100's keypad connector?

A Grayhill 4x4 matrix keypad or equivalent keypad will work with the Electrum 100. For example Grayhill’s part number 96BB2-006-F.

Frequently Asked Questions - Software

How can 'apt' be used to install new packages on the NAND filesystem?

'apt' requires umap/mmap to write to the cache. This is not supported by the JFFS2 filesystem in NAND. A common workwaround is to use a 'tmpfs' filesystem in RAM for the 'apt' cache. We provide the 'apt-setup' and 'apt-purge' scripts to simplify this process. Run 'apt-setup' before installing your packages and 'apt-purge' afterwards. You can ignore any 'fopen' warnings from 'apt-get'. If the cache required by your updates exceeds the available RAM you will need to divide the updates in parts and execute 'apt-setup' and 'apt-purge' before/after each part. Note that this workaround is only required when using a JFFS2 filesystem in NAND as your root filesystem. It is not required if you are using a microSD card as your root filesystem.

What driver is required to use the AT91 USB device port with the Atmel SAM-BA utility?

Current versions of the SAM-BA utility for Windows or Linux handle the USB device port as a serial device with the USB CDC driver. If you are using the older atm6124.sys driver for Windows, it should be removed and replaced with the AT91 USB CDC driver for Windows.

Can the Atmel SAM-BA utility be used to update the NAND filesystem?

No. The NAND geometry assumed by SAM-BA is different than the one used by the NAND on the Electrum controllers. You can update the NAND filesystem using U-Boot as explained in the manual. Windows and Linux versions of SAM-BA can be used to update the Dataflash.

How can I find out the installed kernel and Debian versions?

These are the commands to check the installed versions:

# uname -r

# cat /etc/debian_version

How can the JFFS2 root filesystem be copied to a directory for NFS mounts?

The JFFS2 image can be mounted on a Linux system and copied to the directory exported via NFS. Below are the typical commands used, The image is assumed to be at /home/electrum100 and the exported directory at /home/electrum100/rootfs so you should modify it when using other locations.

[ -b /dev/mtdblock0 ] || mknod /dev/mtdblock0 b 31 0
[ -d /media/jffs2 ] || mkdir -p /media/jffs2
[ -d /home/electrum100/rootfs ] || mkdir -p /home/electrum100/rootfs
modprobe loop
losetup /dev/loop0 /home/electrum100/rootfs.armel.jffs2
modprobe mtdblock
modprobe block2mtd
echo "/dev/loop0,128KiB" > /sys/module/block2mtd/parameters/block2mtd
modprobe jffs2
mount -t jffs2 /dev/mtdblock0 /media/jffs2

cp -pr /media/jffs2/* /home/electrum100/rootfs

umount /media/jffs2
modprobe -r jffs2
modprobe -r block2mtd
modprobe -r mtdblock
losetup -d /dev/loop0
modprobe -r loop

To generate a JFFS2 image from the exported directory you can use the mkfs.jffs2 command from the mtd-utils package. This assumes an erase block size of 128KB and a page size of 2KB. The directory should not be mounted when building the image. The updated JFFS2 image can be copied to NAND using the bootloader as explained in the manual. Using a JFFS2 image is a common alternative for deploying the same NAND filesystem to multiple installations. You can also consider deploying the updated root filesystem on the microSD card.

mkfs.jffs2 -l -n -p -q -e 0x20000 -s 0x800 -d /home/electrum100/rootfs -o /home/electrum100/rootfs.armel.jffs2

How can I compile applications on the board?

You can use 'apt-get install' to install gcc, gdb and any other packages you need for your projects. This allows you to do all your software development on the board. The board should have Internet access so 'apt' is able to download and install packages from the Debian armel repositories. The command below installs a base development system. You should execute 'apt-setup' and 'apt-purge' before/after installing packages if your root filesystem is in NAND.

# apt-get install --no-install-recommends binutils cpp cpp-4.3 gcc gcc-4.3 gdb libc6-dev make

Install g++ if you will be compiling C++ applications. Test the installation by compiling a simple "Hello, world" program.

/* hello.c */
#include <stdio.h>

int main(void)
    printf("Hello, World!\n");
# gcc hello.c -o hello
# ./hello
Hello, World!

Note that cross-compiling on a multi-core PC with Debian or Ubuntu Linux is significantly faster. The manual explains how to set up an ARM cross-toolchain. If your project build times are significant, that would be a more productive route. To avoid file transfers during development you can share a filesystem between the PC and the board using NFS.

How can I mount a file with a JFFS2 filesystem on a Linux PC?

A simple way to mount a file with a JFFS2 filesystem on a Linux PC is to use the loop and block2mtd modules. Example commands are listed below using loop0 and mtdblock0. Change the directory names to match your PC.

# losetup /dev/loop0 /home/electrum100/rootfs.armel.jffs2
# echo /dev/loop0 >/sys/module/block2mtd/parameters/block2mtd

# mkdir -p /home/electrum100/rootfs
# mount -t jffs2 /dev/mtdblock0 /home/electrum100/rootfs

These commands assume you have the MTD utilities installed, the relevant modules loaded and the mtdblock0 node available. These would be representative commands to check if mtd-utils is installed, load the modules and create the mtdblock0 node.

# dpkg --get-selections |grep mtd
mtd-tools install
mtd-utils install

# modprobe loop
# modprobe mtdblock
# modprobe block2mtd
# modprobe jffs2
# mknod /dev/mtdblock0 b 31 0

Some developers prefer to copy the JFFS2 filesystem to a local directory. Afterwards you can recreate the JFFS2 using the mkfs.jffs2 utility in mtd-utils.

# mkfs.jffs2 -l -n -p -q -e 0x20000 -s 0x800 -d /home/electrum100/rootfs -o rootfs.armel.jffs2

For developers that prefer compressed tar archives, the Electrum wiki has the microSD card filesystem in tar.bz2 format. You can extract the compressed tar archive to a local directory to use via NFS, which is simpler than mounting the JFFS2 image.