Note that many of the pins have several functions which are selected by setting the pinmux in the SoC - I'll discuss that in greater detail in the software section. Also be aware that pins 16 and 24 are also tied to buttons on the board, and many of the pins are also routed to some of the other connectors so don't try to use them for more than one function at a time. Refer to the schematic for further details about potential conflicts.
Note that many of the folks using the mini2440 have chosen to completely change their Linux installation. This means choosing a different kernel, a new root filesystem, and in some cases even replacing the Supervivi bootloader with an alternative like u-boot. I'm not interested in making such extensive changes - the QTopia linux works fine and seems to be fairly well integrated, so I'm happy to continue using it.
The most important part of setting up a development environment is to be familiar with working with the linux command line. That's well outside the scope of this document, so I'm assuming you've already got a Linux system up and running which you can use to base the rest of the process on. I use both Fedora 11 and Ubuntu 9.04, but all my mini2440 work has been done on the Ubuntu system. Given that you've got Linux running, the rest of the process consists of:
I found this blog entry extremely helpful for the process: Equally Bad: Project: How to setup the mini2440 dev tools
Take note of the software dependencies that are called out in the above blog. I've also been cautioned that on a vanilla Ubuntu 9.10 install you may also need to install the ncurses5 package if you haven't already.
The Linux kernel source I used is available on the FriendlyARM download site here: linux-126.96.36.199-mini2440_20100113.tgz. You'll want to use this rather than a generic Linux kernel since it contains customized code specific to the mini2440, including the LED, Button and ADC drivers.
Once you have the kernel source tarball, choose a place to extract it - the location isn't critical. Use the command 'tar -zxvf linux-188.8.131.52-mini2440_20100113.tgz' to do this and a new directory called 'linux-184.108.40.206' will be created. At this point you're ready to customize and/or compile your kernel. If you'd like to try building the kernel without changes just to test that everything is working, follow these steps:
Now you've got a compressed kernel image in ./arch/arm/boot that you can download into the NAND flash as described below.
As delivered, this board init file contains info about the UARTs, LCD, Ethernet, NAND, MMC and I2C buses. To use SPI bus 0 on the expansion connector we have to add information about it. I've done that already and the updated file can be found here: mach-mini2440.c.zip
Extract this file and copy it to the location above.
Extract this file and copy it into the linux-220.127.116.11 directory, then follow these steps:
This will only work if you happen to have the same T35 LCD that I do. If you have different LCD you'll need to configure your kernel by hand using the menuconfig tool. This requires you to find the pre-built config file for your hardware - primarily which LCD you've got - and copy it to '.config' in the kernel root directory. When you've done this, run 'make menuconfig' to build and run the ncurses-based configuration utility. Use the arrow and enter keys to navigate around the various kernel options and enable the following:
Once you've found and enabled these (they should all be under the devices menu), exit menuconfig and proceed with 'make zImage'.
NOTE: during the process of getting my kernel to work I had to download several times and I ran into some annoying USB driver behavior. It seems that the Windows USB driver for the mini2440 is buggy because it frequently fails to recognize the mini2440. The only solution I found was to disconnect the mini2440, uninstall the driver and reconnect/reinstall. Perhaps I should have tried downloading using the Linux approach - it might have been more reliable.
You'll need a Windows machine to run the download application provided by FriendlyARM on the DVD which ships with the board. The application is called DNW and is found at:
You'll also need the USB drivers for Supervivi which are found at:
These can also be found on the FriendlyARM download page here:
First connect the mini2440 RS-232 port to your Windows PC serial port (or use a USB/Serial adapter) with the serial cable that came with it. Bootloader commands are sent via this link. Connect the mini2440 USB to your PC as well - bulk data transfers take place over this connection. Flip the NAND/NOR switch on the mini2440 to the NOR position and power it up. Windows should recognize a new USB device and prompt you for the driver location. Point it at the USB driver mentioned above.
Run DNW. It should spot the USB connection and put the text [USB:OK] in the window's title bar. Select "Serial Port->Connect" from the menus and hit enter a few times. This should put the text [COM:115300] in the window's title bar as well and you should see the Supervivi help text scroll across the screen.
At this point you're ready to download your new kernel. Hit 'k' on the keyboard to download a kernel image. Now select 'USB Port->Transmit/Restore' from the menu. This brings up a file select dialog. Browse to the location of your new kernel file and proceed. A progress bar should appear as the file is sent - the process should only take a few seconds. Download is complete and you may now exit from DNW.
Power down the board and flip the NAND/NOR switch back to the NAND position. Power up - you should see the penguin screen and short progress messages, after which a QTopia desktop appears. Pull up a terminal window and type 'uname -a' - the kernel date should be only a few minutes old. You're done.
A simple shell-script approach is described for the Beagle board over at Make Magazine and this works on the mini2440 with our new kernel as well. Just cut/paste the script there and load it into the mini2440. The I/O number that the script requires can be computed for any of our GPIO pins by
GPIO_num = GPIO_port * 32 + GPIO_bit
Where GPIO_port is GPA = 0, GPB = 1, GPC = 2 ... GPH = 7, etc. So for example if you wanted to toggle pin 9 (GPF0) of the expansion header you would use the value 5*32+0 = 160.
You can find out more about the GPIO sysfs device driver by reading through the kernel documentation found at
in the kernel source
In the same directory you'll also find source code for some user-space applications. I've compiled one of them for my system and you can grab it here: spidev_test.zip.
To use it, just enter the command "./spidev_test -D /dev/spidev0.0" If you short pins 25 to 26 you'll loopback MOSI to MISO and the test data sent out should come back. Disconnect the two pins and the data will change.
Return to Embedded page.