Update README for MoteinoMEGA (ATMEGA1284P) port.
This commit is contained in:
parent
43c5a6f8f1
commit
257dc3718a
@ -1,9 +1,7 @@
|
|||||||
README
|
README
|
||||||
^^^^^^
|
^^^^^^
|
||||||
|
|
||||||
**********************************************************************
|
This port conributed by jeditekunum.
|
||||||
**** PRELIMINARY - Port in progress ****
|
|
||||||
**********************************************************************
|
|
||||||
|
|
||||||
This is the README file for the port of NuttX to the MoteinoMEGA from
|
This is the README file for the port of NuttX to the MoteinoMEGA from
|
||||||
LowPowerLab (http://www.lowpowerlab.com). The MoteinoMEGA is based
|
LowPowerLab (http://www.lowpowerlab.com). The MoteinoMEGA is based
|
||||||
@ -19,9 +17,6 @@ Contents
|
|||||||
o Pin Connections
|
o Pin Connections
|
||||||
o DualOptiboot Bootloader
|
o DualOptiboot Bootloader
|
||||||
o Toolchains
|
o Toolchains
|
||||||
o Windows Native Toolchains
|
|
||||||
o NuttX buildroot Toolchain
|
|
||||||
o avr-libc
|
|
||||||
o MoteinoMEGA Configuration Options
|
o MoteinoMEGA Configuration Options
|
||||||
o Configurations
|
o Configurations
|
||||||
|
|
||||||
@ -35,83 +30,62 @@ MoteinoMEGA Features
|
|||||||
o 2 High Speed Serial Ports
|
o 2 High Speed Serial Ports
|
||||||
o 8Ch 10bit Analog Input port
|
o 8Ch 10bit Analog Input port
|
||||||
|
|
||||||
Pin Connections (PCB Rev ?)
|
Pin Connections
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
-------------------- -----------------------------
|
-------------------- -----------------------------
|
||||||
ATMega1284P Pinout MoteinoMEGA board connection
|
ATMega1284P Pinout MoteinoMEGA board connection
|
||||||
-------------------- -----------------------------
|
-------------------- -----------------------------
|
||||||
**********************************************************************
|
|
||||||
**** INVALID - Port in progress ****
|
|
||||||
**********************************************************************
|
|
||||||
(left)
|
(left)
|
||||||
1 PEN Pulled-up
|
1 AREF AR
|
||||||
2 PE0 (RXD0/PDI) MAX202ECWED T1IN or J7-1, ISP-PDI (via 74HC5053), J5-26
|
2 PA7 A7
|
||||||
3 PE1 (TXD0/PDO) MAX202ECWED A1OUT or J7-9, ISP-PDO (via 74HC5053), J5-25
|
3 PA6 A6
|
||||||
4 PE2 (XCK0/AIN0) MAX202ECWED T2IN, J5-24
|
4 PA5 A5
|
||||||
5 PE3 (OC3A/AIN1) MAX202ECWED A2OUT, J5-23
|
5 PA4 A4
|
||||||
6 PE4 (OC3B/INT4) J5-22
|
6 PA3 A3
|
||||||
7 PE5 (OC3C/INT5) J5-21, RTL8019AS INT 0, TP5 PE5
|
7 PA2 A2
|
||||||
8 PE6 (T3/INT6) J5-20
|
8 PA1 A1
|
||||||
9 PE7 (ICP3/INT7) J5-19
|
9 PA0 A0
|
||||||
10 PB0 (SS) Pull up of SS SPI master
|
10 PB0 0
|
||||||
11 PB1 (SCK) J7-7, ISP_SCK (via 74HC4053) and AT45D011 SCK, J5-17
|
11 PB1 1
|
||||||
12 PB2 (MOSI) AT45D011 SI. J5-16
|
12 PB2 (INT2) 2/i2 (used by optional radio)
|
||||||
13 PB3 (MISO) AT45D011 SO, J5-15
|
13 PB3 (PWM0) 3
|
||||||
14 PB4 (OC0) AT45D011 CS\, J5-14
|
14 PB4 (PWM1/SS) 4/SS (used by optional radio)
|
||||||
15 PB5 (OC1A) J5-13
|
15 PB5 (MOSI) 5/MO (used by optional radio/flash)
|
||||||
16 PB6 (OC1B) J5-12
|
16 PB6 (MISO/PWM2) 6/MI (used by optional radio/flash)
|
||||||
|
17 PB7 (SCK/PWM3) 7/SCK (used by optional radio/flash)
|
||||||
|
18 VOUT 3v3
|
||||||
|
19 VIN VIN
|
||||||
|
20 GND GND
|
||||||
(bottom)
|
(bottom)
|
||||||
17 PB7 (OC2/OC1C) J5-11
|
21 DTR/RTS DTR
|
||||||
18 PG3/TOSC2 32.768KHz XTAL
|
22 TX0 v
|
||||||
19 PG4/TOSC1 32.768KHz XTAL
|
23 RX0 ^
|
||||||
20 RESET RESET
|
24 VIN
|
||||||
21 VCC
|
25
|
||||||
22 GND GND
|
26 GND GND
|
||||||
23 XTAL2 14.7456MHz XTAL
|
(right)
|
||||||
24 XTAL1 14.7456MHz XTAL
|
27 GND GND
|
||||||
25 PD0 (SCL/INT0) J5-10
|
28 VIN VIN
|
||||||
26 PD1 (SDA/INT1) J5-9
|
29 VOUT 3v3
|
||||||
27 PD2 (RXD1/INT2) J5-8, MAX488CSA RO (RS-485)
|
30 RESET RST
|
||||||
28 PD3 (TXD1/INT3) J5-7, MAX488CSA DI (RS-485)
|
31 PD0 (RX0) 8/Serial 0 ^
|
||||||
29 PD4 (ICP1) J5-6
|
32 PD1 (TX0) 9/Serial 0 v
|
||||||
30 PD5 (XCK1) J5-5
|
33 PD2 (RX1/INT0) 10/Serial 0 ^/i0
|
||||||
31 PD6 (T1) J5-4
|
34 PD3 (TX1/INT1) 11/Serial 1 v/i1
|
||||||
32 PD7 (T2) J5-3
|
35 PD4 (PWM4) 12
|
||||||
(left)
|
36 PD5 (PWM5) 13
|
||||||
48 PA3 (AD3) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
37 PD6 (PWM6) 14
|
||||||
47 PA4 (AD4) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
38 PD7 (PWM7) 15/LED
|
||||||
46 PA5 (AD5) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
39 PC0 (SCL) 16/SCL
|
||||||
45 PA6 (AD6) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
40 PC1 (SDA) 17/SDA
|
||||||
44 PA7 (AD7) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
41 PC2 (TCK) 18
|
||||||
43 PG2 (ALE) J5-1, 74HC5730, 62246DLP-7, RTL8019AS
|
42 PC3 (TMS) 19
|
||||||
42 PC7 (A15) TP4 A15, J5-27, 74HC5730
|
43 PC4 (TDO) 20
|
||||||
41 PC6 (A14) J5-28, 74HC5730, 62246DLP-7, RTL8019AS
|
44 PC5 (TDI) 21
|
||||||
40 PC5 (A13) J5-29, 74HC5730, 62246DLP-7, RTL8019AS
|
45 PC6 22
|
||||||
39 PC4 (A12) J5-30, 74HC5730, 62246DLP-7, RTL8019AS
|
46 PC7 23 (used by optional flash)
|
||||||
38 PC3 (A11) J5-31, 74HC5730, 62246DLP-7, RTL8019AS
|
|
||||||
37 PC2 (A10) J5-32, 74HC5730, 62246DLP-7, RTL8019AS
|
|
||||||
36 PC1 (A9) J5-33, 74HC5730, 62246DLP-7, RTL8019AS
|
|
||||||
35 PC0 (A8) J5-34, 74HC5730, 62246DLP-7, RTL8019AS
|
|
||||||
34 PG1 (RD) TP2 RD\, J5-52, 62246DLP-7, RTL8019AS
|
|
||||||
33 PG0 (WR) TP3 WR\, J5-51, 62246DLP-7, RTL8019AS
|
|
||||||
(top)
|
|
||||||
64 AVCC
|
|
||||||
63 GND GND
|
|
||||||
62 AREF (analog supply)
|
|
||||||
61 PF0 (ADC0) J6-5, PDV-P9 Light Sensor
|
|
||||||
60 PF1 (ADC1) J6-7, Thermister
|
|
||||||
59 PF2 (ADC2) J6-9, MXA2500GL Dual Axis Accesserometer, AOUTX
|
|
||||||
58 PF3 (ADC3) J6-11, MXA2500GL Dual Axis Accesserometer, AOUTY
|
|
||||||
57 PF4 (ADC4/TCK) J6-13, MXA2500GL Dual Axis Accesserometer, TOUT
|
|
||||||
56 PF5 (ADC5/TMS) J6-15
|
|
||||||
55 PF6 (ADC6/TDO) J6-17
|
|
||||||
54 PF7 (ADC7/TDI) J6-19
|
|
||||||
53 GND GND
|
|
||||||
52 VCC
|
|
||||||
51 PA0 (AD0) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
|
||||||
50 PA1 (AD1) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
|
||||||
49 PA2 (AD2) J5-?, 74HC5730, 62246DLP-7, RTL8019AS
|
|
||||||
|
|
||||||
DualOptiboot Bootloader
|
DualOptiboot Bootloader
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -149,183 +123,8 @@ the toolchain on the make commandline with CONFIG_AVR_TOOLCHAIN=<toolchain>.
|
|||||||
|
|
||||||
The valid values for <toolchain> are BUILDROOT, CROSSPACK, LINUXGCC and WINAVR.
|
The valid values for <toolchain> are BUILDROOT, CROSSPACK, LINUXGCC and WINAVR.
|
||||||
|
|
||||||
Buildroot:
|
This port was tested using the OS X / CROSSPACK tool chain, GCC version 4.8.1.
|
||||||
|
Please see other NuttX documentation for toolchain details.
|
||||||
There is a DIY buildroot version for the AVR boards here:
|
|
||||||
http://sourceforge.net/projects/nuttx/files/buildroot/. See the
|
|
||||||
following section for details on building this toolchain.
|
|
||||||
|
|
||||||
It is assumed in some places that buildroot toolchain is available
|
|
||||||
at ../misc/buildroot/build_avr. Edit the setenv.sh file if
|
|
||||||
this is not the case.
|
|
||||||
|
|
||||||
After configuring NuttX, make sure that CONFIG_AVR_BUILDROOT=y is set in your
|
|
||||||
.config file.
|
|
||||||
|
|
||||||
WinAVR:
|
|
||||||
|
|
||||||
For Cygwin development environment on Windows machines, you can use
|
|
||||||
WinAVR: http://sourceforge.net/projects/winavr/files/
|
|
||||||
|
|
||||||
It is assumed in some places that WinAVR is installed at C:/WinAVR. Edit the
|
|
||||||
setenv.sh file if this is not the case.
|
|
||||||
|
|
||||||
After configuring NuttX, make sure that CONFIG_AVR_WINAVR=y is set in your
|
|
||||||
.config file.
|
|
||||||
|
|
||||||
WARNING: There is an incompatible version of cygwin.dll in the WinAVR/bin
|
|
||||||
directory! Make sure that the path to the correct cygwin.dll file precedes
|
|
||||||
the path to the WinAVR binaries!
|
|
||||||
|
|
||||||
Linux:
|
|
||||||
|
|
||||||
For Linux, there are widely available avr-gcc packages. On Ubuntu, use:
|
|
||||||
sudo apt-get install gcc-avr gdb-avr avr-libc
|
|
||||||
|
|
||||||
After configuring NuttX, make sure that CONFIG_AVR_LINUXGCC=y is set in your
|
|
||||||
.config file.
|
|
||||||
|
|
||||||
Mac OS X:
|
|
||||||
|
|
||||||
For Mac OS X, the CrossPack for AVR toolchain is available from:
|
|
||||||
|
|
||||||
http://www.obdev.at/products/crosspack/index.html
|
|
||||||
|
|
||||||
This toolchain is functionally equivalent to the Linux GCC toolchain.
|
|
||||||
|
|
||||||
Windows Native Toolchains
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
The WinAVR toolchain is a Windows native toolchain. There are several
|
|
||||||
limitations to using a Windows native toolchain in a Cygwin environment.
|
|
||||||
The three biggest are:
|
|
||||||
|
|
||||||
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
|
|
||||||
performed automatically in the Cygwin makefiles using the 'cygpath'
|
|
||||||
utility but you might easily find some new path problems. If so, check
|
|
||||||
out 'cygpath -w'
|
|
||||||
|
|
||||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic
|
|
||||||
links are used in Nuttx (e.g., include/arch). The make system works
|
|
||||||
around these problems for the Windows tools by copying directories
|
|
||||||
instead of linking them. But this can also cause some confusion for
|
|
||||||
you: For example, you may edit a file in a "linked" directory and find
|
|
||||||
that your changes had no effect. That is because you are building the
|
|
||||||
copy of the file in the "fake" symbolic directory. If you use a
|
|
||||||
Windows toolchain, you should get in the habit of making like this:
|
|
||||||
|
|
||||||
make clean_context all
|
|
||||||
|
|
||||||
An alias in your .bashrc file might make that less painful.
|
|
||||||
|
|
||||||
3. Dependencies are not made when using Windows versions of the GCC. This
|
|
||||||
is because the dependencies are generated using Windows pathes which do
|
|
||||||
not work with the Cygwin make.
|
|
||||||
|
|
||||||
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
|
||||||
|
|
||||||
An additional issue with the WinAVR toolchain, in particular, is that it
|
|
||||||
contains an incompatible version of the Cygwin DLL in its bin/ directory.
|
|
||||||
You must take care that the correct Cygwin DLL is used.
|
|
||||||
|
|
||||||
NuttX buildroot Toolchain
|
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
If NuttX buildroot toolchain source tarball cne can be downloaded from the
|
|
||||||
NuttX SourceForge download site (https://sourceforge.net/projects/nuttx/files/).
|
|
||||||
This GNU toolchain builds and executes in the Linux or Cygwin environment.
|
|
||||||
|
|
||||||
1. You must have already configured Nuttx in <some-dir>/nuttx.
|
|
||||||
|
|
||||||
cd tools
|
|
||||||
./configure.sh amber/<sub-dir>
|
|
||||||
|
|
||||||
NOTE: you also must copy avr-libc header files into the NuttX include
|
|
||||||
directory with command perhaps like:
|
|
||||||
|
|
||||||
cp -a /cygdrive/c/WinAVR/include/avr include/.
|
|
||||||
|
|
||||||
2. Download the latest buildroot package into <some-dir>
|
|
||||||
|
|
||||||
3. unpack the buildroot tarball. The resulting directory may
|
|
||||||
have versioning information on it like buildroot-x.y.z. If so,
|
|
||||||
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
|
|
||||||
|
|
||||||
4. cd <some-dir>/buildroot
|
|
||||||
|
|
||||||
5. cp configs/avr-defconfig-4.5.2 .config
|
|
||||||
|
|
||||||
6. make oldconfig
|
|
||||||
|
|
||||||
7. make
|
|
||||||
|
|
||||||
8. Edit setenv.h, if necessary, so that the PATH variable includes
|
|
||||||
the path to the newly built binaries.
|
|
||||||
|
|
||||||
See the file configs/README.txt in the buildroot source tree. That has more
|
|
||||||
detailed PLUS some special instructions that you will need to follow if you
|
|
||||||
are building a toolchain for Cygwin under Windows.
|
|
||||||
|
|
||||||
avr-libc
|
|
||||||
^^^^^^^^
|
|
||||||
|
|
||||||
Header Files
|
|
||||||
|
|
||||||
In any case, header files from avr-libc are required: http://www.nongnu.org/avr-libc/.
|
|
||||||
A snapshot of avr-lib is included in the WinAVR installation. For Linux
|
|
||||||
development platforms, avr-libc package is readily available (and would
|
|
||||||
be installed in the apt-get command shown above). But if you are using
|
|
||||||
the NuttX buildroot configuration on Cygwin, then you will have to build
|
|
||||||
get avr-libc from binaries.
|
|
||||||
|
|
||||||
Header File Installation
|
|
||||||
|
|
||||||
The NuttX build will required that the AVR header files be available via
|
|
||||||
the NuttX include directory. This can be accomplished by either copying
|
|
||||||
the avr-libc header files into the NuttX include directory:
|
|
||||||
|
|
||||||
cp -a <avr-libc-path>/include/avr <nuttx-path>/include/.
|
|
||||||
|
|
||||||
Or simply using a symbolic link:
|
|
||||||
|
|
||||||
ln -s <avr-libc-path>/include/avr <nuttx-path>/include/.
|
|
||||||
|
|
||||||
Build Notes:
|
|
||||||
|
|
||||||
It may not necessary to have a built version of avr-lib; only header files
|
|
||||||
are required. Bu if you choose to use the optimized libraru functions of
|
|
||||||
the flowing point library, then you may have to build avr-lib from sources.
|
|
||||||
Below are instructions for building avr-lib from fresh sources:
|
|
||||||
|
|
||||||
1. Download the avr-libc package from:
|
|
||||||
|
|
||||||
http://savannah.nongnu.org/projects/avr-libc/
|
|
||||||
|
|
||||||
I am using avr-lib-1.7.1.tar.bz2
|
|
||||||
|
|
||||||
2. Upack the tarball and cd into the
|
|
||||||
|
|
||||||
tar jxf avr-lib-1.7.1.tar.bz2
|
|
||||||
cd avr-lib-1.7.1
|
|
||||||
|
|
||||||
3. Configure avr-lib. Assuming that WinAVR is installed at the following
|
|
||||||
loction:
|
|
||||||
|
|
||||||
export PATH=/cygdrive/c/WinAVR/bin:$PATH
|
|
||||||
./configure --build=`./config.guess` --host=avr
|
|
||||||
|
|
||||||
This takes a *long* time.
|
|
||||||
|
|
||||||
4. Make avr-lib.
|
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
This also takes a long time because it generates variants for nearly
|
|
||||||
all AVR chips.
|
|
||||||
|
|
||||||
5. Install avr-lib.
|
|
||||||
|
|
||||||
make install
|
|
||||||
|
|
||||||
MoteinoMEGA Configuration Options
|
MoteinoMEGA Configuration Options
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -364,9 +163,6 @@ MoteinoMEGA Configuration Options
|
|||||||
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
||||||
of delay loops
|
of delay loops
|
||||||
|
|
||||||
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
|
||||||
endian)
|
|
||||||
|
|
||||||
CONFIG_RAM_SIZE - Describes the installed DRAM. One of:
|
CONFIG_RAM_SIZE - Describes the installed DRAM. One of:
|
||||||
|
|
||||||
CONFIG_RAM_SIZE=(16*1024) - (16Kb)
|
CONFIG_RAM_SIZE=(16*1024) - (16Kb)
|
||||||
@ -460,10 +256,6 @@ Common Configuration Notes
|
|||||||
Where <subdir> is one of the configuration sub-directories described in
|
Where <subdir> is one of the configuration sub-directories described in
|
||||||
the following paragraph.
|
the following paragraph.
|
||||||
|
|
||||||
NOTE: You must also copy avr-libc header files, perhaps like:
|
|
||||||
|
|
||||||
cp -a /cygdrive/c/WinAVR/include/avr include/.
|
|
||||||
|
|
||||||
2. These configurations use the mconf-based configuration tool. To
|
2. These configurations use the mconf-based configuration tool. To
|
||||||
change a configurations using that tool, you should:
|
change a configurations using that tool, you should:
|
||||||
|
|
||||||
@ -473,13 +265,6 @@ Common Configuration Notes
|
|||||||
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||||
reconfiguration process.
|
reconfiguration process.
|
||||||
|
|
||||||
3. By default, all configurations assume the NuttX Buildroot toolchain
|
|
||||||
under Cygwin with Windows. This is easily reconfigured:
|
|
||||||
|
|
||||||
CONFIG_HOST_WINDOWS=y
|
|
||||||
CONFIG_WINDOWS_CYGWIN=y
|
|
||||||
CONFIG_AVR_BUILDROOT=y
|
|
||||||
|
|
||||||
Configuration Sub-Directories
|
Configuration Sub-Directories
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user