How to set up to play with your Make Controller from a Linux desktop.
How to install the required software.
Note: These steps were performed on a PC running Ubuntu Linux. Some steps may be different depending on your installation. Rather than su root, we use sudo.
The Linux versions used:
- GCC 4.0.3
- Linux Kernel 2.6.15-26
Install the Toolchain
Get the toolchain from
GNUARM.org
% cd /tmp
% wget \
http://www.gnuarm.com/bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2
% cd /usr/local
% sudo tar jxvf \
/tmp/bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2
% export PATH=$PATH:/usr/local/gnuarm-3.4.3/bin
You can add the path in your .bashrc or wherever you prefer.
Install sam7utils
1. Get the tool itself.
% cd /tmp
% wget http://oss.tekno.us/sam7utils/sam7utils-0.1.0.tar.gz
2. Unpack and install the tool
% tar -zxvf sam7utils-0.1.0.tar.gz
% cd /tmp/sam7utils-0.1.0
% ./configure
% make
% sudo make install
Note that older distributions might fail during configuration complaining about missing readline library. They require the curses library to be added explicitly. This can be done by issuing the following prior to the ./configure step:
%export LDFLAGS=-lcurses
3. Build install the driver
If your kernel version is greater than 2.6.15, you may get an error when you make the driver. In this case comment out the .mode line in driver/at91.c:
// don't use the mode line if your kernel is version 2.6.15 or greater
// .mode= S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH,
% cd /tmp/sam7utils-0.1.0/driver
% make
% sudo /sbin/insmod at91.ko
On some distributions, you may also need to comment out the ".owner = THIS_MODULE" field.
Enter SAM-BA mode on your MAKE Controller Kit by briefly shorting the ERASE jumper, and then cycling power. If you are not powering your MAKE Controller Kit via USB, connect your computer to your MAKE Controller Kit via a USB cable. You should see a new device:
% ls /dev/at91_0
/dev/at91_0
To make the module reload next time you boot, don't forget to copy it somewhere neutral and add it to your /etc/modprobe.conf (or whatever passes for that on your distribution).
Test sam7util by running sam7 as root:
% sudo sam7
Chip Version: 0
Embedded Processor: ARM7TDMI
NVRAM Region 2 Size: 0 K
SRAM Size: 64 K
Series: AT91SAM7Xxx
Page Size: 256 bytes
Lock Regions: 16
sam7>
If you do not see all the interesting info above, then check to make sure you're board is in SAM-BA mode, check to make sure the USB connection is good.
Exit by typing <CTRL>D
How to compile firmware (not necessary if you're using the pre-built binaries).
1. Get the firwmare
(check the Downloads section for the latest version)
% cd
% wget http://downloads.sourceforge.net/makingthings/firmware-v1.2.0.zip
% unzip firmware-v1.2.0.zip
2. Build tiny
% cd ~/firmware-v1.2.0/tiny
% make clean; make
3. Enter SAM-BA mode
Enter SAM-BA mode by shorting the ERASE jumper and cycling the power.
4. Load tiny and reset the board to run from Flash - tiny, in this case.
% cd output
% sudo sam7
sam7> flash tiny.bin
sam7> boot_from_flash
sam7>
5. Run tiny
Power cycle your MAKE Controller Kit and observe the green LED on the processor board flashing.
6. Build heavy
% cd ~/firmware-v1.2.0/heavy
% make clean; make
7. Enter SAM-BA mode
Enter SAM-BA mode by shorting the ERASE jumper and cycling power
8. Load heavy and reset the board to run from Flash - tiny, in this case.
Note that flashing heavy.bin takes over 1 minute during which no progress is indicated.
% cd output
% sudo sam7
sam7> flash heavy.bin
sam7> boot_from_flash
sam7>
9. Run heavy
Power cycle your MAKE Controller Kit and observe the green LED on the processor board flashing at about once per second.
Connect your MAKE Controller Kit to a wired Ethernet network, and browse to http://192.168.0.200/. You should see a list of tasks that are running on the MAKE Controller Kit and the state of the inputs. If you have the Trimpot Jumper installed turn the trimpot and observe the changing values on input number 7. This page automatically refreshes every second.
How to compile a version of FreeRTOS, the operating system that runs on the Make Controller.
1. Get the FreeRTOS.org Demo from MakingThings.
This is based on a demo that is part of the standard FreeRTOS download called lwIP_Demo_Rowley_ARM7, but modified for the slightly different pin assignments of the Make Controller Board.
% cd
% wget http://www.makingthings.com/resources/downloads/FreeRTOSV4.1.zip
% unzip FreeRTOSV4.1.zip
2. Build the Make Controller Kit-specific demo
% cd ~/FreeRTOSV4.1.0/Demo/mc_lwIP_Demo_Rowley_ARM7
% make clean; make
3. Enter SAM-BA mode
Enter SAM-BA mode by shorting the ERASE jumper and cycling power
4. Load the FreeRTOS demo and reset the board to run FreeRTOS.
Note that flashing rtosdemo.bin takes awhile during which no progress is indicated.
% sudo sam7
sam7> flash rtosdemo.bin
sam7> boot_from_flash
sam7>
5. Run the FreeRTOS demo
Power cycle your MAKE Controller Kit and observe the 4 green LEDs on the application board implementing a 4 bit counter.
Connect your MAKE Controller Kit to a wired Ethernet network, and browse to http://192.168.0.205/. You should see a list of tasks that are running on the MAKE Controller Kit in the FreeRTOS environment. This page automatically refreshes every second.