Setting up AVR build environment
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3679 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
4d9bd3fe67
commit
aeabb08460
321
configs/amber/README.txt
Normal file
321
configs/amber/README.txt
Normal file
@ -0,0 +1,321 @@
|
|||||||
|
README
|
||||||
|
^^^^^
|
||||||
|
|
||||||
|
This is the README file for the port of NuttX to the Amber Web Server from
|
||||||
|
SoC Robotics (http://www.soc-robotics.com/index.htm). The
|
||||||
|
Amber Web Server is based on an Atmel ATMega128. As of this writing,
|
||||||
|
documentation for the Amber Web Server board is available here:
|
||||||
|
|
||||||
|
http://www.soc-robotics.com/product/Amber_Specs/Amber_Processor.html
|
||||||
|
|
||||||
|
and
|
||||||
|
|
||||||
|
http://www.soc-robotics.com/pdfs/Amber%201-5a%20Hardware%20Reference%20Guide.pdf
|
||||||
|
|
||||||
|
Contents
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
o Amber Web Server Features
|
||||||
|
o Toolchains
|
||||||
|
o Windows Native Toolchains
|
||||||
|
o NuttX buildroot Toolchain
|
||||||
|
o avr-libc
|
||||||
|
o Amber Web Server Configuration Options
|
||||||
|
o Configurations
|
||||||
|
|
||||||
|
Amber Web Server Features
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Toolchains
|
||||||
|
^^^^^^^^^^
|
||||||
|
|
||||||
|
Buildroot:
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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 not 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.
|
||||||
|
|
||||||
|
Support has been added for making dependencies with the windows-native
|
||||||
|
toolchains. That support can be enabled by modifying your Make.defs
|
||||||
|
file as follows:
|
||||||
|
|
||||||
|
- MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||||
|
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh --winpaths "$(TOPDIR)"
|
||||||
|
|
||||||
|
If you have problems with the dependency build (for example, if you are
|
||||||
|
not building on C:), then you may need to modify tools/mkdeps.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>
|
||||||
|
|
||||||
|
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
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
Build Notes:
|
||||||
|
|
||||||
|
In any case, avr-libc is required. http://www.nongnu.org/avr-libc/.
|
||||||
|
An 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
|
||||||
|
avr-libc from binaries.
|
||||||
|
|
||||||
|
Below are instructions for building avr-lib from fresh sources (I started
|
||||||
|
this before I realized at tha avr-lib is included in the WinAVR install):
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
Include Path:
|
||||||
|
|
||||||
|
After configuration, the Make.def file installed in the top-level NuttX
|
||||||
|
directory will need to be modified to include the path to the where ever
|
||||||
|
the include/avr directory was installed (no other avr-libc header files
|
||||||
|
are needed). For, for example, if WinAVR is installed at C:/WinAVR, the
|
||||||
|
AVR header files will be at C:/WinAVR/avr/include/avr
|
||||||
|
|
||||||
|
AVRLIBC_INCPATH=${cygpath -u "C:/WinAVR/avr/include/avr"}
|
||||||
|
|
||||||
|
Amber Web Server Configuration Options
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
||||||
|
be set to:
|
||||||
|
|
||||||
|
CONFIG_ARCH=avr
|
||||||
|
|
||||||
|
CONFIG_ARCH_family - For use in C code:
|
||||||
|
|
||||||
|
CONFIG_ARCH_AVR=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_architecture - For use in C code:
|
||||||
|
|
||||||
|
CONFIG_ARCH_ATMEGA=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP=atmega
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
||||||
|
chip:
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP_ATMEGA128=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
||||||
|
hence, the board that supports the particular chip or SoC.
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD=amber
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_name - For use in C code
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_AMBER=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
||||||
|
of delay loops
|
||||||
|
|
||||||
|
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
||||||
|
endian)
|
||||||
|
|
||||||
|
CONFIG_DRAM_SIZE - Describes the installed DRAM. One of:
|
||||||
|
|
||||||
|
CONFIG_DRAM_SIZE=(8*1024) - (8Kb)
|
||||||
|
|
||||||
|
CONFIG_DRAM_START - The start address of installed DRAM
|
||||||
|
|
||||||
|
CONFIG_DRAM_START=0x10000000
|
||||||
|
|
||||||
|
CONFIG_DRAM_END - Last address+1 of installed RAM
|
||||||
|
|
||||||
|
CONFIG_DRAM_END=(CONFIG_DRAM_START+CONFIG_DRAM_SIZE)
|
||||||
|
|
||||||
|
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
|
||||||
|
have LEDs
|
||||||
|
|
||||||
|
CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
|
||||||
|
stack. If defined, this symbol is the size of the interrupt
|
||||||
|
stack in bytes. If not defined, the user task stacks will be
|
||||||
|
used during interrupt handling.
|
||||||
|
|
||||||
|
CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
||||||
|
|
||||||
|
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
|
||||||
|
|
||||||
|
CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that
|
||||||
|
cause a 100 second delay during boot-up. This 100 second delay
|
||||||
|
serves no purpose other than it allows you to calibratre
|
||||||
|
CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to measure
|
||||||
|
the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
|
||||||
|
the delay actually is 100 seconds.
|
||||||
|
|
||||||
|
Individual subsystems can be enabled:
|
||||||
|
|
||||||
|
CONFIG_AVR_INT0=n
|
||||||
|
CONFIG_AVR_INT1=n
|
||||||
|
CONFIG_AVR_INT2=n
|
||||||
|
CONFIG_AVR_INT3=n
|
||||||
|
CONFIG_AVR_INT4=n
|
||||||
|
CONFIG_AVR_INT5=n
|
||||||
|
CONFIG_AVR_INT6=n
|
||||||
|
CONFIG_AVR_INT7=n
|
||||||
|
CONFIG_AVR_USBHOST=n
|
||||||
|
CONFIG_AVR_USBDEV=n
|
||||||
|
CONFIG_AVR_WDT=n
|
||||||
|
CONFIG_AVR_TIMER0=n
|
||||||
|
CONFIG_AVR_TIMER1=n
|
||||||
|
CONFIG_AVR_TIMER2=n
|
||||||
|
CONFIG_AVR_TIMER3=n
|
||||||
|
CONFIG_AVR_SPI=n
|
||||||
|
CONFIG_AVR_UART0=y
|
||||||
|
CONFIG_AVR_UART1=n
|
||||||
|
CONFIG_AVR_ANACOMP=n
|
||||||
|
CONFIG_AVR_ADC=n
|
||||||
|
CONFIG_AVR_TWI=n
|
||||||
|
|
||||||
|
ATMEGA specific device driver settings
|
||||||
|
|
||||||
|
CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
|
||||||
|
console and ttys0 (default is the UART0).
|
||||||
|
CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
|
||||||
|
This specific the size of the receive buffer
|
||||||
|
CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
|
||||||
|
being sent. This specific the size of the transmit buffer
|
||||||
|
CONFIG_UARTn_BAUD - The configure BAUD of the UART. Must be
|
||||||
|
CONFIG_UARTn_BITS - The number of bits. Must be either 7 or 8.
|
||||||
|
CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
||||||
|
CONFIG_UARTn_2STOP - Two stop bits
|
||||||
|
|
||||||
|
Configurations
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Each Amber Web Server configuration is maintained in a sudirectory and can
|
||||||
|
be selected as follow:
|
||||||
|
|
||||||
|
cd tools
|
||||||
|
./configure.sh amber/<subdir>
|
||||||
|
cd -
|
||||||
|
. ./setenv.sh
|
||||||
|
|
||||||
|
Where <subdir> is one of the following:
|
||||||
|
|
||||||
|
ostest:
|
||||||
|
This configuration directory, performs a simple OS test using
|
||||||
|
apps/examples/ostest.
|
@ -8,8 +8,19 @@ NuttX was ported using the AT90USB647 version. As of this writing,
|
|||||||
documentation for the Micropendous board is available here:
|
documentation for the Micropendous board is available here:
|
||||||
http://code.google.com/p/micropendous/wiki/Micropendous3
|
http://code.google.com/p/micropendous/wiki/Micropendous3
|
||||||
|
|
||||||
Micropendous 3 Features
|
Contents
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^
|
||||||
|
|
||||||
|
o Micropendous3 Features
|
||||||
|
o Toolchains
|
||||||
|
o Windows Native Toolchains
|
||||||
|
o NuttX buildroot Toolchain
|
||||||
|
o avr-libc
|
||||||
|
o Micropendous3 Configuration Options
|
||||||
|
o Configurations
|
||||||
|
|
||||||
|
Micropendous3 Features
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
o Based on the 64-pin USB AVR Microcontrollers: AT90USB646, AT90USB647,
|
o Based on the 64-pin USB AVR Microcontrollers: AT90USB646, AT90USB647,
|
||||||
AT90USB1286, or AT90USB1287.
|
AT90USB1286, or AT90USB1287.
|
||||||
@ -34,33 +45,37 @@ Micropendous 3 Features
|
|||||||
o Size LxWxH (including headers): 3.15" x 0.8" x 0.6" =~ 8cm x 2cm x 1.5cm
|
o Size LxWxH (including headers): 3.15" x 0.8" x 0.6" =~ 8cm x 2cm x 1.5cm
|
||||||
o Completely OpenHardware Design
|
o Completely OpenHardware Design
|
||||||
|
|
||||||
Contents
|
|
||||||
^^^^^^^^
|
|
||||||
|
|
||||||
o Toolchains
|
|
||||||
o Windows Native Toolchains
|
|
||||||
o avr-libc
|
|
||||||
|
|
||||||
Toolchains
|
Toolchains
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
||||||
Buildroot:
|
Buildroot:
|
||||||
|
|
||||||
There is a buildroot version for the AVR boards here:
|
There is a DIY buildroot version for the AVR boards here:
|
||||||
http://sourceforge.net/projects/nuttx/files/buildroot/. However, that
|
http://sourceforge.net/projects/nuttx/files/buildroot/. See the
|
||||||
toolchain cannot be recommended at this time because it lacks certain
|
following section for details on building this toolchain.
|
||||||
important patches.
|
|
||||||
|
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:
|
WinAVR:
|
||||||
|
|
||||||
For Cygwin development environment on Windows machines, you can use
|
For Cygwin development environment on Windows machines, you can use
|
||||||
WinAVR: http://sourceforge.net/projects/winavr/files/
|
WinAVR: http://sourceforge.net/projects/winavr/files/
|
||||||
|
|
||||||
It is assumed in some places that WinAVR is installed at C:/WinAVR.
|
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
|
After configuring NuttX, make sure that CONFIG_AVR_WINAVR=y is set in your
|
||||||
.config file.
|
.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:
|
Linux:
|
||||||
|
|
||||||
For Linux, there are widely available avr-gcc packages. On Ubuntu, use:
|
For Linux, there are widely available avr-gcc packages. On Ubuntu, use:
|
||||||
@ -108,6 +123,43 @@ Windows Native Toolchains
|
|||||||
If you have problems with the dependency build (for example, if you are
|
If you have problems with the dependency build (for example, if you are
|
||||||
not building on C:), then you may need to modify tools/mkdeps.sh
|
not building on C:), then you may need to modify tools/mkdeps.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 micropendous3/<sub-dir>
|
||||||
|
|
||||||
|
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
|
avr-libc
|
||||||
^^^^^^^^
|
^^^^^^^^
|
||||||
|
|
||||||
@ -116,7 +168,9 @@ Build Notes:
|
|||||||
In any case, avr-libc is required. http://www.nongnu.org/avr-libc/.
|
In any case, avr-libc is required. http://www.nongnu.org/avr-libc/.
|
||||||
An snapshot of avr-lib is included in the WinAVR installation. For Linux
|
An snapshot of avr-lib is included in the WinAVR installation. For Linux
|
||||||
development platforms, avr-libc package is readily available (and would
|
development platforms, avr-libc package is readily available (and would
|
||||||
be installed in the apt-get command shown above).
|
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
|
||||||
|
avr-libc from binaries.
|
||||||
|
|
||||||
Below are instructions for building avr-lib from fresh sources (I started
|
Below are instructions for building avr-lib from fresh sources (I started
|
||||||
this before I realized at tha avr-lib is included in the WinAVR install):
|
this before I realized at tha avr-lib is included in the WinAVR install):
|
||||||
@ -159,3 +213,133 @@ Include Path:
|
|||||||
AVR header files will be at C:/WinAVR/avr/include/avr
|
AVR header files will be at C:/WinAVR/avr/include/avr
|
||||||
|
|
||||||
AVRLIBC_INCPATH=${cygpath -u "C:/WinAVR/avr/include/avr"}
|
AVRLIBC_INCPATH=${cygpath -u "C:/WinAVR/avr/include/avr"}
|
||||||
|
|
||||||
|
Micropendous3 Configuration Options
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
CONFIG_ARCH - Identifies the arch/ subdirectory. This should
|
||||||
|
be set to:
|
||||||
|
|
||||||
|
CONFIG_ARCH=avr
|
||||||
|
|
||||||
|
CONFIG_ARCH_family - For use in C code:
|
||||||
|
|
||||||
|
CONFIG_ARCH_AVR=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_architecture - For use in C code:
|
||||||
|
|
||||||
|
CONFIG_ARCH_AT90USB=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP=at90usb
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP_name - For use in C code to identify the exact
|
||||||
|
chip. This should be exactly one of
|
||||||
|
|
||||||
|
CONFIG_ARCH_CHIP_AT90USB646=y
|
||||||
|
CONFIG_ARCH_CHIP_AT90USB647=y
|
||||||
|
CONFIG_ARCH_CHIP_AT90USB1286=y
|
||||||
|
CONFIG_ARCH_CHIP_AT90USB1287=y
|
||||||
|
|
||||||
|
Depending on which Micropendous3 version you have.
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD - Identifies the configs subdirectory and
|
||||||
|
hence, the board that supports the particular chip or SoC.
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD=micropendous3
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_name - For use in C code
|
||||||
|
|
||||||
|
CONFIG_ARCH_BOARD_MICROPENOUS3=y
|
||||||
|
|
||||||
|
CONFIG_ARCH_LOOPSPERMSEC - Must be calibrated for correct operation
|
||||||
|
of delay loops
|
||||||
|
|
||||||
|
CONFIG_ENDIAN_BIG - define if big endian (default is little
|
||||||
|
endian)
|
||||||
|
|
||||||
|
CONFIG_DRAM_SIZE - Describes the installed DRAM. One of:
|
||||||
|
|
||||||
|
CONFIG_DRAM_SIZE=(4*1024) - (4Kb)
|
||||||
|
CONFIG_DRAM_SIZE=(8*1024) - (8Kb)
|
||||||
|
|
||||||
|
CONFIG_DRAM_START - The start address of installed DRAM
|
||||||
|
|
||||||
|
CONFIG_DRAM_START=0x10000000
|
||||||
|
|
||||||
|
CONFIG_DRAM_END - Last address+1 of installed RAM
|
||||||
|
|
||||||
|
CONFIG_DRAM_END=(CONFIG_DRAM_START+CONFIG_DRAM_SIZE)
|
||||||
|
|
||||||
|
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to boards that
|
||||||
|
have LEDs
|
||||||
|
|
||||||
|
CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt
|
||||||
|
stack. If defined, this symbol is the size of the interrupt
|
||||||
|
stack in bytes. If not defined, the user task stacks will be
|
||||||
|
used during interrupt handling.
|
||||||
|
|
||||||
|
CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
||||||
|
|
||||||
|
CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to board architecture.
|
||||||
|
|
||||||
|
CONFIG_ARCH_CALIBRATION - Enables some build in instrumentation that
|
||||||
|
cause a 100 second delay during boot-up. This 100 second delay
|
||||||
|
serves no purpose other than it allows you to calibratre
|
||||||
|
CONFIG_ARCH_LOOPSPERMSEC. You simply use a stop watch to measure
|
||||||
|
the 100 second delay then adjust CONFIG_ARCH_LOOPSPERMSEC until
|
||||||
|
the delay actually is 100 seconds.
|
||||||
|
|
||||||
|
Individual subsystems can be enabled:
|
||||||
|
|
||||||
|
CONFIG_AVR_INT0=n
|
||||||
|
CONFIG_AVR_INT1=n
|
||||||
|
CONFIG_AVR_INT2=n
|
||||||
|
CONFIG_AVR_INT3=n
|
||||||
|
CONFIG_AVR_INT4=n
|
||||||
|
CONFIG_AVR_INT5=n
|
||||||
|
CONFIG_AVR_INT6=n
|
||||||
|
CONFIG_AVR_INT7=n
|
||||||
|
CONFIG_AVR_USBHOST=n
|
||||||
|
CONFIG_AVR_USBDEV=n
|
||||||
|
CONFIG_AVR_WDT=n
|
||||||
|
CONFIG_AVR_TIMER0=n
|
||||||
|
CONFIG_AVR_TIMER1=n
|
||||||
|
CONFIG_AVR_TIMER2=n
|
||||||
|
CONFIG_AVR_TIMER3=n
|
||||||
|
CONFIG_AVR_SPI=n
|
||||||
|
CONFIG_AVR_UART1=y
|
||||||
|
CONFIG_AVR_ANACOMP=n
|
||||||
|
CONFIG_AVR_ADC=n
|
||||||
|
CONFIG_AVR_TWI=n
|
||||||
|
|
||||||
|
AT90USB specific device driver settings
|
||||||
|
|
||||||
|
CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
|
||||||
|
console and ttys0 (default is the UART0).
|
||||||
|
CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
|
||||||
|
This specific the size of the receive buffer
|
||||||
|
CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
|
||||||
|
being sent. This specific the size of the transmit buffer
|
||||||
|
CONFIG_UARTn_BAUD - The configure BAUD of the UART. Must be
|
||||||
|
CONFIG_UARTn_BITS - The number of bits. Must be either 7 or 8.
|
||||||
|
CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
||||||
|
CONFIG_UARTn_2STOP - Two stop bits
|
||||||
|
|
||||||
|
Configurations
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Each Micropendous3 configuration is maintained in a sudirectory and can
|
||||||
|
be selected as follow:
|
||||||
|
|
||||||
|
cd tools
|
||||||
|
./configure.sh micropendous3/<subdir>
|
||||||
|
cd -
|
||||||
|
. ./setenv.sh
|
||||||
|
|
||||||
|
Where <subdir> is one of the following:
|
||||||
|
|
||||||
|
ostest:
|
||||||
|
This configuration directory, performs a simple OS test using
|
||||||
|
apps/examples/ostest.
|
||||||
|
@ -38,19 +38,31 @@ include ${TOPDIR}/.config
|
|||||||
# Setup for the selected toolchain
|
# Setup for the selected toolchain
|
||||||
|
|
||||||
ifeq ($(CONFIG_AVR_WINAVR),y)
|
ifeq ($(CONFIG_AVR_WINAVR),y)
|
||||||
# WinAVR toolchain under Windows
|
# WinAVR toolchain under Windows/Cygwin
|
||||||
CROSSDEV = avr-
|
CROSSDEV = avr-
|
||||||
WINTOOL = y
|
WINTOOL = y
|
||||||
MAXOPTIMIZATION = -O2
|
MAXOPTIMIZATION = -O2
|
||||||
ARCHCPUFLAGS = -mcu=at90usb647
|
ARCHCPUFLAGS = -mmcu=at90usb647
|
||||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||||
|
AVRLIBC_INCPATH=${cygpath -u "C:/WinAVR/avr/include/avr"}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_AVR_LINUXGCC),y)
|
ifeq ($(CONFIG_AVR_LINUXGCC),y)
|
||||||
# GCC toolchain under Linx
|
# GCC toolchain under Linux
|
||||||
CROSSDEV = avr-
|
CROSSDEV = avr-
|
||||||
MAXOPTIMIZATION = -O2
|
MAXOPTIMIZATION = -O2
|
||||||
ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data
|
ARCHCPUFLAGS = -mmcu=at90usb647
|
||||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||||
|
AVRLIBC_INCPATH= #Where?
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_AVR_BUILDROOT),y)
|
||||||
|
# NuttX buildroot GCC toolchain under Linux or Cygwin
|
||||||
|
CROSSDEV = avr-elf-
|
||||||
|
MAXOPTIMIZATION = -O2
|
||||||
|
ARCHCPUFLAGS = -mmcu=at90usb647
|
||||||
|
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||||
|
AVRLIBC_INCPATH= #Where?
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
@ -58,14 +70,14 @@ ifeq ($(WINTOOL),y)
|
|||||||
DIRLINK = $(TOPDIR)/tools/winlink.sh
|
DIRLINK = $(TOPDIR)/tools/winlink.sh
|
||||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||||
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -I "${shell cygpath -w $(AVRLIBC_INCPATH)}"
|
||||||
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
ARCHXXINCLUDES = $(ARCHINCLUDES) -w $(TOPDIR)/include/cxx}"
|
||||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
|
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
|
||||||
else
|
else
|
||||||
# Linux/Cygwin-native toolchain
|
# Linux/Cygwin-native toolchain
|
||||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||||
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
ARCHINCLUDES = -I. -isystem "$(TOPDIR)/include" -I "$(AVRLIBC_INCPATH)"
|
||||||
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
ARCHXXINCLUDES = $(ARCHINCLUDES) -isystem "$(TOPDIR)/include/cxx"
|
||||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
|
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -92,33 +92,34 @@ CONFIG_ARCH_DMA=n
|
|||||||
#
|
#
|
||||||
# Identify toolchain and linker options
|
# Identify toolchain and linker options
|
||||||
#
|
#
|
||||||
CONFIG_AVR_WINAVR=y
|
CONFIG_AVR_WINAVR=n
|
||||||
CONFIG_AVR_LINUXGCC=n
|
CONFIG_AVR_LINUXGCC=n
|
||||||
|
CONFIG_AVR_BUILDROOT=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# Individual subsystems can be enabled:
|
# Individual subsystems can be enabled:
|
||||||
#
|
#
|
||||||
|
|
||||||
CONFIG_AT90USB_INT0=n
|
CONFIG_AVR_INT0=n
|
||||||
CONFIG_AT90USB_INT1=n
|
CONFIG_AVR_INT1=n
|
||||||
CONFIG_AT90USB_INT2=n
|
CONFIG_AVR_INT2=n
|
||||||
CONFIG_AT90USB_INT3=n
|
CONFIG_AVR_INT3=n
|
||||||
CONFIG_AT90USB_INT4=n
|
CONFIG_AVR_INT4=n
|
||||||
CONFIG_AT90USB_INT5=n
|
CONFIG_AVR_INT5=n
|
||||||
CONFIG_AT90USB_INT6=n
|
CONFIG_AVR_INT6=n
|
||||||
CONFIG_AT90USB_INT7=n
|
CONFIG_AVR_INT7=n
|
||||||
CONFIG_AT90USB_USBHOST=n
|
CONFIG_AVR_USBHOST=n
|
||||||
CONFIG_AT90USB_USBDEV=n
|
CONFIG_AVR_USBDEV=n
|
||||||
CONFIG_AT90USB_WDT=n
|
CONFIG_AVR_WDT=n
|
||||||
CONFIG_AT90USB_TIMER0=n
|
CONFIG_AVR_TIMER0=n
|
||||||
CONFIG_AT90USB_TIMER1=n
|
CONFIG_AVR_TIMER1=n
|
||||||
CONFIG_AT90USB_TIMER2=n
|
CONFIG_AVR_TIMER2=n
|
||||||
CONFIG_AT90USB_TIMER3=n
|
CONFIG_AVR_TIMER3=n
|
||||||
CONFIG_AT90USB_SPI=n
|
CONFIG_AVR_SPI=n
|
||||||
CONFIG_AT90USB_UART1=y
|
CONFIG_AVR_UART1=y
|
||||||
CONFIG_AT90USB_ANACOMP=n
|
CONFIG_AVR_ANACOMP=n
|
||||||
CONFIG_AT90USB_ADC=n
|
CONFIG_AVR_ADC=n
|
||||||
CONFIG_AT90USB_TWI=n
|
CONFIG_AVR_TWI=n
|
||||||
|
|
||||||
#
|
#
|
||||||
# AT90USB specific serial device driver settings
|
# AT90USB specific serial device driver settings
|
||||||
|
@ -32,20 +32,30 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ "$(basename $0)" = "setenv.sh" ] ; then
|
if [ "$(basename $0)" = "setenv.sh" ]; then
|
||||||
echo "You must source this script, not run it!" 1>&2
|
echo "You must source this script, not run it!" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
|
|
||||||
|
|
||||||
WD=`pwd`
|
WD=`pwd`
|
||||||
|
if [ ! -x "setenv.sh" ]; then
|
||||||
|
echo "This script must be executed from the toplevel NuttX build directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${PATH_ORIG}" ]; then
|
||||||
|
export PATH_ORIG="${PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
# This the Cygwin path to the location where I installed the WinAVR
|
# This the Cygwin path to the location where I installed the WinAVR
|
||||||
# toolchain under windows. This is *not* the default install
|
# toolchain under windows. This is *not* the default install
|
||||||
# location so you will probably have to edit this. You will also have
|
# location so you will probably have to edit this. You will also have
|
||||||
# to edit this if you install the Linux AVR toolchain as well
|
# to edit this if you install the Linux AVR toolchain as well
|
||||||
export TOOLCHAIN_BIN="/cygdrive/c/WinAVR/bin"
|
#export TOOLCHAIN_BIN="/cygdrive/c/WinAVR/bin"
|
||||||
|
|
||||||
|
# This the Cygwin path to the location where I build the buildroot
|
||||||
|
# toolchain.
|
||||||
|
export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_avr/staging_dir/bin"
|
||||||
|
|
||||||
# Add the path to the toolchain to the PATH varialble
|
# Add the path to the toolchain to the PATH varialble
|
||||||
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||||
|
@ -76,7 +76,7 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_AT90USB_SPI1) || defined(CONFIG_AT90USB_SPI2)
|
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
|
||||||
EXTERN void weak_function at90usb_spiinitialize(void);
|
EXTERN void weak_function at90usb_spiinitialize(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ void at90usb_boardinitialize(void)
|
|||||||
* function at90usb_spiinitialize() has been brought into the link.
|
* function at90usb_spiinitialize() has been brought into the link.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(CONFIG_AT90USB_SPI1) || defined(CONFIG_AT90USB_SPI2)
|
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
|
||||||
if (at90usb_spiinitialize)
|
if (at90usb_spiinitialize)
|
||||||
{
|
{
|
||||||
at90usb_spiinitialize();
|
at90usb_spiinitialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user