Difference between revisions of "TideClock"
(→U-boot) |
|||
Line 55: | Line 55: | ||
== Building the Linux Kernel == | == Building the Linux Kernel == | ||
+ | Download kernel 2.6.33 from kernel.org. Get patch for AT91 from http://maxim.org.za/at91_26.html. Uncompress and apply patch: | ||
+ | <pre> | ||
+ | cd linux-2.6.33.7 | ||
+ | patch -p1 < ../2.6.33-at91.patch | ||
+ | </pre> | ||
+ | |||
+ | We'll need to have mkimage in the path to create the uImage file, and we'll need the cross-compiler in the path: | ||
+ | <pre> | ||
+ | export PATH=${PATH}:~/dev/uboot/tools: | ||
+ | export PATH=~/x-tools/arm-unknown-linux-gnueabi/bin:${PATH} | ||
+ | export CROSS_COMPILE=arm-unknown-linux-gnueabi- | ||
+ | </pre> | ||
+ | |||
+ | Configure the kernel for compiling with the desired options: | ||
+ | <pre> | ||
+ | make ARCH=arm ecbat91_defconfig | ||
+ | make ARCH=arm menuconfig | ||
+ | </pre> | ||
+ | In the kernel config menu, turn on/off these features as indicated. Some are optional, some you must do for it to work: | ||
+ | * turn on Kernel Features->"Use the ARM EABI to compile the kernel" (MUST) | ||
+ | * turn off "Kernel .config support" | ||
+ | * turn off Bus Support->"PCCard" | ||
+ | * turn off Kernel Features->"Allow old ABI Binaries to run with this kernel" | ||
+ | * turn off Networking Support->Wireless->"cfg80211 - wirelss configuration API" | ||
+ | * turn off Network Device Support->"Wireless LAN" | ||
+ | * turn off Network Device Support->"PPP support" | ||
+ | * turn on "I2C Core Debugging messages" | ||
+ | * turn on Real Time Clock->"Intersil ISL1208" (MUST if you want to use the external RTC) | ||
+ | * turn on RAMDISK support, so we can put kernel+rfs into flash and run the whole thing out of RAM. During booting the kernel+flash image is uncompressed into RAM and the rfs image mounted as / | ||
+ | ** in “Main menu”->“Device Drivers”->“Block devices” make sure “RAM disk support” is selected. | ||
+ | ** for the “Default RAM disk size” enter 14000 (this seems OK, in first tests we seemed to need a bit over 7 MB for the rfs.) | ||
+ | ** in “Main menu”->“General setup.” select “Initial RAM filesystem and RAM disk (initramfs/initrd) support” | ||
+ | *** enter the location of the RFS cpio archive, or RFS path (see below in RFS, read Help section if needed, or check linuxstamp page on OpenCircuits). | ||
+ | |||
+ | Build the kernel; in kernel directory ~/dev/kernel/linux-2.6.33.7: | ||
+ | <pre> | ||
+ | make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- uImage | ||
+ | ... | ||
+ | Image arch/arm/boot/uImage is ready | ||
+ | </pre> | ||
+ | |||
+ | If you entered the location of the RFS cpio archive in the make menuconfig, this uImage will include the RFS, else it will be just the kernel itself and you will need to provide the RFS via NFS or on SD card. | ||
+ | |||
+ | Load the kernel using Linuxstamp's bootloader and minicom's xmodem send option. | ||
== Root Filesystem (RFS) == | == Root Filesystem (RFS) == |
Revision as of 20:40, 28 January 2012
Contents
- 1 Description
- 2 Status
- 3 Features
- 4 License
- 5 Cost
- 6 Hardware design files
- 7 Power
- 8 Console and Debug port
- 9 nfs & tftp
- 10 Cross Compiler
- 11 Booting
- 12 U-Boot
- 13 Busybox
- 14 Building the Linux Kernel
- 15 Root Filesystem (RFS)
- 16 GPIO / Hardware Pin I/O
- 17 Links
- 18 USB Info
- 19 Discussion
- 20 Contact
- 21 other Related Projects
Description
Tideclock is an electromechanical clock that displays local tides in bargraph form. The 'bars' are currently implemented as 12 moving pointers on lead-screws approximately 30cm long, but there are many other neat ways one can display a 'bar'. How about columns of water? or a string that is supported at a dozen places?
Being software-controlled, many parameters that are easily altered, such as:
- interval between the 'bars' (presently 1 hour, thus showing the upcoming tides for 12 hours)
- location for which the tides are calculated
- display scaling, or units
One can even display currents instead of tide heights if preferred.
TideClock uses a Linuxstamp by Paul Thomas (see its page here in OpenCircuits) for the processing.
Tide calculations are performed by xtide [[1]] compiled to run on the Linuxstamp.
Motion control and power supply is performed by a custom PCB. The design details are below.
Status
The Software works. A prototype PCB has been assembled and 90% tested. The major remaining tasks are assembling the lead screws and putting the whole thing in a nice wooden cabinet.
Features
- 12 individually-controlled 'bars' for displaying the tide height 12 or 24 hours in the future
- Low power (60 mW between updates; 1.2W when updating the graph)
- configurable Update interval (how often graph is refreshed)
- configurable Scale (meters, feet, fathoms, etc)
- Displays Tide Height or Current Speed
License
All files for this project are licensed under the GNU GPL V2
Cost
The prototypes (4 are in various stages of construction) have cost about $500 each for materials. Labour not included...
Hardware design files
Warning!!! Use this design at your own risk.
Power
Energy is stored by an ~1100 mA-Hr Li-ion cell, which is sufficient for about 30 hours of use when disconnected from external power sources. It is recharged by either 5V from a USB-charger wall-wart, or a solar panel. Average power consumption is approximately 150 mW, so it shouldn't need too large of a panel.
The internal real-time clock (which is how the software knows what time it is, for the calculations) is powered by a 0.47F supercapacitor that charges from the the Li-ion cell. The TideClock should retain its internal time for at least two weeks after discharge of the main battery.
Console and Debug port
A USB connector provides a serial port for console access to the Linux OS. This is used for updating or changing the software, changing the time, or changing other parameters.
nfs & tftp
Cross Compiler
Booting
U-Boot
I left u-boot as-is on the Linuxstamp.
Busybox
Building the Linux Kernel
Download kernel 2.6.33 from kernel.org. Get patch for AT91 from http://maxim.org.za/at91_26.html. Uncompress and apply patch:
cd linux-2.6.33.7 patch -p1 < ../2.6.33-at91.patch
We'll need to have mkimage in the path to create the uImage file, and we'll need the cross-compiler in the path:
export PATH=${PATH}:~/dev/uboot/tools: export PATH=~/x-tools/arm-unknown-linux-gnueabi/bin:${PATH} export CROSS_COMPILE=arm-unknown-linux-gnueabi-
Configure the kernel for compiling with the desired options:
make ARCH=arm ecbat91_defconfig make ARCH=arm menuconfig
In the kernel config menu, turn on/off these features as indicated. Some are optional, some you must do for it to work:
- turn on Kernel Features->"Use the ARM EABI to compile the kernel" (MUST)
- turn off "Kernel .config support"
- turn off Bus Support->"PCCard"
- turn off Kernel Features->"Allow old ABI Binaries to run with this kernel"
- turn off Networking Support->Wireless->"cfg80211 - wirelss configuration API"
- turn off Network Device Support->"Wireless LAN"
- turn off Network Device Support->"PPP support"
- turn on "I2C Core Debugging messages"
- turn on Real Time Clock->"Intersil ISL1208" (MUST if you want to use the external RTC)
- turn on RAMDISK support, so we can put kernel+rfs into flash and run the whole thing out of RAM. During booting the kernel+flash image is uncompressed into RAM and the rfs image mounted as /
- in “Main menu”->“Device Drivers”->“Block devices” make sure “RAM disk support” is selected.
- for the “Default RAM disk size” enter 14000 (this seems OK, in first tests we seemed to need a bit over 7 MB for the rfs.)
- in “Main menu”->“General setup.” select “Initial RAM filesystem and RAM disk (initramfs/initrd) support”
- enter the location of the RFS cpio archive, or RFS path (see below in RFS, read Help section if needed, or check linuxstamp page on OpenCircuits).
Build the kernel; in kernel directory ~/dev/kernel/linux-2.6.33.7:
make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- uImage ... Image arch/arm/boot/uImage is ready
If you entered the location of the RFS cpio archive in the make menuconfig, this uImage will include the RFS, else it will be just the kernel itself and you will need to provide the RFS via NFS or on SD card.
Load the kernel using Linuxstamp's bootloader and minicom's xmodem send option.
Root Filesystem (RFS)
GPIO / Hardware Pin I/O
Links
I won't repeat the ones listed on the OpenCircuits pages for the Linuxstamp and Linuxstamp II 9260.
USB Info
Discussion
You could try the <Discussion> button at the top of this page, or contact me at the address below:
Contact
For questions or comments please contact Bjarne (bjarneh /at/ shaw /dot/ ca)