Skip to content

Commit 21d7b0e

Browse files
committed
docs/avr/at90usb: Migrate README.txt
Migrated teensy 2.0 README.txt to RST format. Moved common tool-chain information to the chip page and provided back-link. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
1 parent e167809 commit 21d7b0e

File tree

4 files changed

+547
-841
lines changed

4 files changed

+547
-841
lines changed

Documentation/platforms/avr/at90usb/boards/micropendous3/index.rst

Lines changed: 5 additions & 270 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ Then you can use FLIP to load code into FLASH (available at the Atmel Web Site).
162162
The DFU USB driver for the DFU bootload is available in the usb subdirectory in
163163
the FLIP installation location.
164164

165+
Toolchains
166+
==========
167+
168+
Read about the tool chains at :doc:`../../index`.
169+
165170
Serial Console
166171
==============
167172

@@ -188,279 +193,9 @@ PIN SIGNAL BOARD CONNECTION
188193
28 (TXD1/INT3) PD3 J3-39 D3
189194
=== ======================= =============================================
190195

191-
Toolchains
192-
==========
193-
194-
There are several toolchain options. However, testing has been performed using
195-
*only* the NuttX buildroot toolchain described below. Therefore, the NuttX
196-
buildroot toolchain is the recommended choice.
197-
198-
The toolchain may be selected using the kconfig-mconf tool (via ``make
199-
menuconfig``), by editing the existing configuration file (``defconfig``), or by
200-
overriding the toolchain on the make commandline with
201-
``CONFIG_AVR_TOOLCHAIN=<toolchain>``.
202-
203-
The valid values for ``<toolchain>`` are ``BUILDROOT``, ``CROSSPACK``,
204-
``LINUXGCC`` and ``WINAVR``.
205-
206-
Buildroot
207-
---------
208-
209-
There is a DIY buildroot version for the AVR boards here:
210-
http://bitbucket.org/nuttx/buildroot/downloads/. See the following section for
211-
details on building this toolchain.
212-
213-
Before building, make sure that the path to the new toolchain is included in
214-
your ``PATH`` environment variable.
215-
216-
After configuring NuttX, make sure that ``CONFIG_AVR_BUILDROOT_TOOLCHAIN=y`` is
217-
set in your ``.config`` file.
218-
219-
WinAVR
220-
------
221-
222-
For Cygwin development environment on Windows machines, you can use WinAVR:
223-
http://sourceforge.net/projects/winavr/files/
224-
225-
Before building, make sure that the path to the new toolchain is included in
226-
your ``PATH`` environment variable.
227-
228-
After configuring NuttX, make sure that ``CONFIG_AVR_WINAVR_TOOLCHAIN=y`` is set
229-
in your ``.config`` file.
230-
231-
.. warning::
232-
233-
There is an incompatible version of ``cygwin.dll`` in the ``WinAVR/bin``
234-
directory! Make sure that the path to the correct ``cygwin.dll`` file
235-
precedes the path to the WinAVR binaries!
236-
237-
Linux
238-
-----
239-
240-
For Linux, there are widely available avr-gcc packages. On Ubuntu, use:
241-
sudo apt-get install gcc-avr gdb-avr avr-libc
242-
243-
After configuring NuttX, make sure that CONFIG_AVR_LINUXGCC_TOOLCHAIN=y is set in your
244-
.config file.
245-
246-
macOS
247-
-----
248-
249-
For macOS, the CrossPack for AVR toolchain is available from:
250-
http://www.obdev.at/products/crosspack/index.html
251-
252-
This toolchain is functionally equivalent to the Linux GCC toolchain.
253-
254-
Windows Native Toolchains
255-
=========================
256-
257-
The WinAVR toolchain is a Windows native toolchain. There are several
258-
limitations to using a Windows native toolchain in a Cygwin environment. The
259-
three biggest are:
260-
261-
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
262-
performed automatically in the Cygwin makefiles using the ``cygpath`` utility
263-
but you might easily find some new path problems. If so, check out ``cygpath
264-
-w``
265-
266-
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
267-
are used in NuttX (e.g., ``include/arch``). The make system works around
268-
these problems for the Windows tools by copying directories instead of
269-
linking them. But this can also cause some confusion for you: For example,
270-
you may edit a file in a "linked" directory and find that your changes had no
271-
effect. That is because you are building the copy of the file in the "fake"
272-
symbolic directory. If you use a Windows toolchain, you should get in the
273-
habit of making like this:
274-
275-
.. code:: console
276-
277-
$ make clean_context all
278-
279-
An alias in your ``.bashrc`` file might make that less painful.
280-
281-
An additional issue with the WinAVR toolchain, in particular, is that it
282-
contains an incompatible version of the Cygwin DLL in its ``bin/`` directory.
283-
You must take care that the correct Cygwin DLL is used.
284-
285-
NuttX buildroot toolchain
286-
=========================
287-
288-
If NuttX buildroot toolchain source tarball cne can be downloaded from the NuttX
289-
Bitbucket download site (https://bitbucket.org/nuttx/nuttx/downloads/). This GNU
290-
toolchain builds and executes in the Linux or Cygwin environment.
291-
292-
1. You must have already configured NuttX in ``<some-dir>/nuttx``.
293-
294-
.. code:: console
295-
296-
$ tools/configure.sh micropendous3:<sub-dir>
297-
298-
.. note::
299-
300-
You also must copy avr-libc header files into the NuttX include directory
301-
with a command perhaps like:
302-
303-
.. code:: console
304-
305-
$ cp -a /cygdrive/c/WinAVR/include/avr include/.
306-
307-
2. Download the latest buildroot package into ``<some-dir>``
308-
309-
3. Unpack the buildroot tarball. The resulting directory may have versioning
310-
information on it like ``buildroot-x.y.z``. If so, rename
311-
``<some-dir>/buildroot-x.y.z`` to ``<some-dir>/buildroot``.
312-
313-
.. code:: console
314-
315-
$ cd <some-dir>/buildroot
316-
$ cp boards/avr-defconfig-4.5.2 .config
317-
$ make oldconfig
318-
$ make
319-
320-
4. Make sure that the ``PATH`` variable includes the path to the newly built
321-
binaries.
322-
323-
See the file ``boards/README.txt`` in the buildroot source tree.That has more
324-
detailed PLUS some special instructions that you will need to follow if you are
325-
building a toolchain for Cygwin under Windows.
326-
327-
avr-libc
328-
========
329-
330-
Header Files
331-
------------
332-
333-
In any case, header files from avr-libc are required:
334-
http://www.nongnu.org/avr-libc/. A snapshot of avr-lib is included in the WinAVR
335-
installation. For Linux development platforms, avr-libc package is readily
336-
available (and would be installed in the apt-get command shown above). But if
337-
you are using the NuttX buildroot configuration on Cygwin, then you will have to
338-
build get avr-libc from binaries.
339-
340-
Header File Installation
341-
------------------------
342-
343-
The NuttX build will required that the AVR header files be available via the
344-
NuttX include directory. This can be accomplished by either copying the
345-
avr-libc header files into the NuttX include directory:
346-
347-
.. code:: console
348-
349-
$ cp -a <avr-libc-path>/include/avr <nuttx-path>/include/.
350-
351-
Or simply using a symbolic link:
352-
353-
.. code:: console
354-
355-
$ ln -s <avr-libc-path>/include/avr <nuttx-path>/include/.
356-
357-
Build Notes
358-
-----------
359-
360-
It may not be necessary to have a built version of avr-lib; only header files
361-
are required. But if you choose to use the optimized library functions of the
362-
floating point library, then you may have to build avr-lib from sources. Below
363-
are instructions for building avr-lib from fresh sources:
364-
365-
1. Download the avr-libc package from
366-
http://savannah.nongnu.org/projects/avr-libc/. I am using
367-
avr-lib-1.7.1.tar.bz2
368-
369-
2. Unpack the tarball and ``cd`` into it:
370-
371-
.. code:: console
372-
373-
$ tar jxf avr-lib-1.7.1.tar.bz2
374-
$ cd avr-lib-1.7.1
375-
376-
3. Configure avr-lib. Assuming that WinAVR is installed at the following
377-
location:
378-
379-
.. code:: console
380-
381-
$ export PATH=/cygdrive/c/WinAVR/bin:$PATH
382-
$ ./configure --build=`./config.guess` --host=avr
383-
384-
This takes a *long* time.
385-
386-
4. Make avr-lib.
387-
388-
.. code:: console
389-
390-
$ make
391-
392-
This also takes a long time because it generates variants for nearly
393-
all AVR chips.
394-
395-
5. Install avr-lib.
396-
397-
.. code:: console
398-
399-
$ make install
400-
401196
Micropendous 3 Configuration Options
402197
====================================
403198

404-
* ``CONFIG_ARCH``: Identifies the ``arch/`` subdirectory. This should be set
405-
to:
406-
407-
* ``CONFIG_ARCH=avr``
408-
409-
* ``CONFIG_ARCH_family``: For use in C code:
410-
411-
* ``CONFIG_ARCH_AVR=y``
412-
413-
* ``CONFIG_ARCH_architecture``: For use in C code:
414-
415-
* ``CONFIG_ARCH_CHIP_AT90USB=y``
416-
417-
* ``CONFIG_ARCH_CHIP``: Identifies the ``arch/*/chip`` subdirectory
418-
419-
* ``CONFIG_ARCH_CHIP=at90usb``
420-
421-
* ``CONFIG_ARCH_CHIP_name``: For use in C code to identify the exact chip. This
422-
should be exactly one of:
423-
424-
* ``CONFIG_ARCH_CHIP_AT90USB646=y``
425-
* ``CONFIG_ARCH_CHIP_AT90USB647=y``
426-
* ``CONFIG_ARCH_CHIP_AT90USB1286=y``
427-
* ``CONFIG_ARCH_CHIP_AT90USB1287=y``
428-
429-
Depending on which Micropendous3 version you have.
430-
431-
* ``CONFIG_ARCH_BOARD``: Identifies the ``boards/`` subdirectory and hence, the
432-
board that supports the particular chip or SoC.
433-
434-
* ``CONFIG_ARCH_BOARD=micropendous3``
435-
436-
* ``CONFIG_ARCH_BOARD_name``: For use in C code
437-
438-
* ``CONFIG_ARCH_BOARD_MICROPENOUS3=y``
439-
440-
* ``CONFIG_ARCH_LOOPSPERMSEC``: Must be calibrated for correct operation of
441-
delay loops
442-
443-
* ``CONFIG_ENDIAN_BIG``: define if big endian (default is little endian)
444-
445-
* ``CONFIG_RAM_SIZE``: Describes the installed DRAM. One of:
446-
447-
* ``CONFIG_RAM_SIZE=(4*1024)``: (4Kb)
448-
* ``CONFIG_RAM_SIZE=(8*1024)``: (8Kb)
449-
450-
* ``CONFIG_RAM_START``: The start address of installed SRAM
451-
452-
* ``CONFIG_RAM_START=0x800100``
453-
454-
* ``CONFIG_ARCH_LEDS``: Use LEDs to show state. Unique to boards that have LEDs
455-
456-
* ``CONFIG_ARCH_INTERRUPTSTACK``: This architecture supports an interrupt stack.
457-
If defined, this symbol is the size of the interrupt stack in bytes. If not
458-
defined, the user task stacks will be used during interrupt handling.
459-
460-
* ``CONFIG_ARCH_STACKDUMP``: Do stack dumps after assertions
461-
462-
* ``CONFIG_ARCH_LEDS``: Use LEDs to show state. Unique to board architecture.
463-
464199
Individual subsystems can be enabled:
465200

466201
* ``CONFIG_AVR_INT0=n``

0 commit comments

Comments
 (0)