Difference between revisions of "MINI2440 embedded projects"
Line 13: | Line 13: | ||
I'm going to use the Sourcery G++ Lite ARM that is available for free.<br> | I'm going to use the Sourcery G++ Lite ARM that is available for free.<br> | ||
You can get the last version from http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053<br> | You can get the last version from http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053<br> | ||
− | Downloading and unpacking | + | === Downloading and unpacking === |
− | + | <pre> | |
− | < | ||
mkdir mini2440 | mkdir mini2440 | ||
cd mini2440 | cd mini2440 | ||
Line 21: | Line 20: | ||
tar jxf arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 | tar jxf arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 | ||
export PATH=/home/ttts/mini2440/arm-2008q3/bin:$PATH | export PATH=/home/ttts/mini2440/arm-2008q3/bin:$PATH | ||
− | </ | + | </pre> |
− | + | The last line will add the bin directory the $PATH variable so that we can use the commands in that directory like normal commands.<br> | |
− | The last line will add the bin directory the $PATH variable so that we can use the commands in that directory like normal commands. | + | Every time you open a terminal, you have to enter that last line. (or you can add it to your .bashrc file) |
== Uboot == | == Uboot == | ||
− | Download uboot for mini2440 | + | === Download uboot for mini2440 === |
− | + | <pre> | |
− | < | ||
mkdir uboot | mkdir uboot | ||
cd uboot | cd uboot | ||
git clone git://repo.or.cz/u-boot-openmoko/mini2440.git | git clone git://repo.or.cz/u-boot-openmoko/mini2440.git | ||
− | </ | + | </pre> |
− | + | ||
− | + | === Compile uboot === | |
− | Compile uboot | + | <pre> |
− | |||
− | < | ||
export CROSS_COMPILE=arm-none-eabi- | export CROSS_COMPILE=arm-none-eabi- | ||
cd mini2440 | cd mini2440 | ||
make mini2440_config | make mini2440_config | ||
make all | make all | ||
− | </ | + | </pre> |
− | |||
When I tried to compile uboot I got an error about some weak declarations in lib_arm/board.c and common/main.c<br> | When I tried to compile uboot I got an error about some weak declarations in lib_arm/board.c and common/main.c<br> | ||
I'm using the 4.4.x gcc, and the 4.3.x does not cause that error. You can downgrade your gcc or remove the "weak" definitions in those files like I did | I'm using the 4.4.x gcc, and the 4.3.x does not cause that error. You can downgrade your gcc or remove the "weak" definitions in those files like I did | ||
− | + | === Compile upload tool === | |
− | Compile upload tool | + | <pre> |
− | |||
− | < | ||
cd ~/mini2440 | cd ~/mini2440 | ||
wget http://mini2440.googlecode.com/files/s3c2410_boot_usb-20060807.tar.bz2 | wget http://mini2440.googlecode.com/files/s3c2410_boot_usb-20060807.tar.bz2 | ||
Line 56: | Line 49: | ||
cd s3c2410_boot_usb | cd s3c2410_boot_usb | ||
make | make | ||
− | </ | + | </pre> |
− | + | When make fails because he can not find the file "usb.h" install the ubuntu/debian package libusb-dev. | |
− | When make fails because he can not find the file "usb.h" install the ubuntu/debian package libusb-dev. | + | |
+ | === Upload the file === | ||
Open a terminal to the serial connection of the mini2440 board.<br> | Open a terminal to the serial connection of the mini2440 board.<br> | ||
Put the NOR switch to NOR and power the board.<br> | Put the NOR switch to NOR and power the board.<br> | ||
Line 64: | Line 58: | ||
In this shell you typ "load flash 0 232188 u"<br> | In this shell you typ "load flash 0 232188 u"<br> | ||
Where "232188" is the size of the uboot.bin file you are going to send. (ls -la mini2240/uboot/mini2440 | grep u-boot.bin)<br> | Where "232188" is the size of the uboot.bin file you are going to send. (ls -la mini2240/uboot/mini2440 | grep u-boot.bin)<br> | ||
− | + | Send the file from your linux terminal: | |
− | + | <pre> | |
− | < | ||
./s3c2410_boot_usb ../uboot/u-boot.bin | ./s3c2410_boot_usb ../uboot/u-boot.bin | ||
− | </ | + | </pre> |
− | + | Sometimes the upload tool says that the upload is failed, but don't trust it :P<br> | |
− | Sometimes the upload tool says that the upload is failed, but don't trust it :P | + | The upload of uboot didn't work for my at first but just keep trying |
Revision as of 16:48, 12 January 2010
This page is currently under constructions, I'm doing this all over with the new versions of all the software
Contents
Toolchain
First of all, we need a toolchain containing some command-line tools for our ARM platform:
- C and C++ compilers
- assembler
- linker
- C and C++ runtime libraries
- GNU debugger
I'm going to use the Sourcery G++ Lite ARM that is available for free.
You can get the last version from http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Downloading and unpacking
mkdir mini2440 cd mini2440 wget http://www.codesourcery.com/sgpp/lite/arm/portal/package5353/public/arm-none-eabi/arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 tar jxf arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 export PATH=/home/ttts/mini2440/arm-2008q3/bin:$PATH
The last line will add the bin directory the $PATH variable so that we can use the commands in that directory like normal commands.
Every time you open a terminal, you have to enter that last line. (or you can add it to your .bashrc file)
Uboot
Download uboot for mini2440
mkdir uboot cd uboot git clone git://repo.or.cz/u-boot-openmoko/mini2440.git
Compile uboot
export CROSS_COMPILE=arm-none-eabi- cd mini2440 make mini2440_config make all
When I tried to compile uboot I got an error about some weak declarations in lib_arm/board.c and common/main.c
I'm using the 4.4.x gcc, and the 4.3.x does not cause that error. You can downgrade your gcc or remove the "weak" definitions in those files like I did
Compile upload tool
cd ~/mini2440 wget http://mini2440.googlecode.com/files/s3c2410_boot_usb-20060807.tar.bz2 tar jxf s3c2410_boot_usb-20060807.tar.bz2 cd s3c2410_boot_usb make
When make fails because he can not find the file "usb.h" install the ubuntu/debian package libusb-dev.
Upload the file
Open a terminal to the serial connection of the mini2440 board.
Put the NOR switch to NOR and power the board.
Now you get a "FriendlyARM BIOS"/supervivi menu, choose q to go to the supervivi shell.
In this shell you typ "load flash 0 232188 u"
Where "232188" is the size of the uboot.bin file you are going to send. (ls -la mini2240/uboot/mini2440 | grep u-boot.bin)
Send the file from your linux terminal:
./s3c2410_boot_usb ../uboot/u-boot.bin
Sometimes the upload tool says that the upload is failed, but don't trust it :P
The upload of uboot didn't work for my at first but just keep trying