Topics / Index / deutsch

WINAVR

Content (automatic)

My Code

I have my WINAVR source codes in several directories. See avr/topics.htm and avr/00idx.htm
Group of code
Dos/Windows
Linux
AVR include files
C:\home\cc\avrinc
~/home/cc/avrinc
My include files
C:\home\cc\include ~/home/cc/include
My reusable library source files
C:\home\cc\lq ~/home/cc/lq
Main program to check or demonstrate the usage of library source files
C:\home\cc\qq ~/home/cc/qq
My AVR- Projects
C:\home\cc\ts ~/home/cc/ts

Download and install of WinAVR

Download from http://winavr.sourceforge.net
Install as usual
Help will be in ../../../../WinAVR/WinAVR-user-manual.html
Have in PATH= C:\WinAVR\bin;C:\WinAVR\utils\bin; [Start] [Settings] [Control Panel] [System] [Advanced] [Environment Variables]
Need to copy the follow DLL from C:\WinAVR\

I suggest to download and install / compile as well the actual libaries from the CVS repository. See #cvs

Usage

[Start] [Programs] [WinAvr] [Programmers Notepad (WinAvr)]

Open one of the example programs, change to directory C:\home\cc\qq\avr\project\
double click on the project.pn file - (have .pn associated with C:\WinAVR\pn\pn.exe)

Open the makefile
Use "Tools" "make all"

The Compiler switches

D:\WinAVR\bin>avr-gcc --help
Usage: avr-gcc [options] file...
Options:
  -pass-exit-codes         Exit with highest error code from a phase
  --help                   Display this information
  --target-help            Display target specific command line options
  (Use '-v --help' to display command line options of sub-processes)
  -dumpspecs               Display all of the built in spec strings
  -dumpversion             Display the version of the compiler
  -dumpmachine             Display the compiler's target processor
  -print-search-dirs       Display the directories in the compiler's search path

  -print-libgcc-file-name  Display the name of the compiler's companion library
  -print-file-name=<lib>   Display the full path to library <lib>
  -print-prog-name=<prog>  Display the full path to compiler component <prog>
  -print-multi-directory   Display the root directory for versions of libgcc
  -print-multi-lib         Display the mapping between command line options and
                           multiple library search directories
  -print-multi-os-directory Display the relative path to OS libraries
  -Wa,<options>            Pass comma-separated <options> on to the assembler
  -Wp,<options>            Pass comma-separated <options> on to the preprocessor

  -Wl,<options>            Pass comma-separated <options> on to the linker
  -Xassembler <arg>        Pass <arg> on to the assembler
  -Xpreprocessor <arg>     Pass <arg> on to the preprocessor
  -Xlinker <arg>           Pass <arg> on to the linker
  -save-temps              Do not delete intermediate files
  -pipe                    Use pipes rather than intermediate files
  -time                    Time the execution of each subprocess
  -specs=<file>            Override built-in specs with the contents of <file>
  -std=<standard>          Assume that the input sources are for <standard>
  -B <directory>           Add <directory> to the compiler's search paths
  -b <machine>             Run gcc for target <machine>, if installed
  -V <version>             Run gcc version number <version>, if installed
  -v                       Display the programs invoked by the compiler
  -###                     Like -v but options quoted and commands not executed
  -E                       Preprocess only; do not compile, assemble or link
  -S                       Compile only; do not assemble or link
  -c                       Compile and assemble, but do not link
  -o <file>                Place the output into <file>
  -x <language>            Specify the language of the following input files
                           Permissible languages include: c c++ assembler none
                           'none' means revert to the default behavior of
                           guessing the language based on the file's extension

Options starting with -g, -f, -m, -O, -W, or --param are automatically
 passed on to the various sub-processes invoked by avr-gcc.  In order to pass
 other options on to these processes the -W<letter> options must be used.

For bug reporting instructions, please see:
<URL:http://gcc.gnu.org/bugs.html>.

D:\WinAVR\bin>

See also : ../cc/english/oskgcc.htm  /

Predefined preprocessor variables

__GNUC__ 3
__VERSION__

I (HJHerbert) predefine AVR in the file C:\home\cc\avrbat\makedefs

Selecting a device
A list of possible #define is in C:\WinAVR\avr\include\ .
see these lines as e.g. #elif defined(__AVR_ATmega8535__)

avr-ar : edit the libraries

Display their contents with t

example:

D:\HOME\CC\LQ\AVR>dir
...
2005-06-28  07:48p              12,116 liblq.a
...
D:\HOME\CC\LQ\AVR>avr-ar t liblq.a
vt.o

D:\HOME\CC\LQ\AVR>avr-ar tv liblq.a
rw-rw-rw- 0/0  11340 Jun 28 19:43 2005 vt.o

D:\HOME\CC\LQ\AVR>

This shows that the mdule (file) vt.o is in the library.

Extract a single Object-File out of the library

Use the x command
Examplel :
avr-ar x liblq.a vt.o

Display defined and requested Symbols

D:\HOME\CC\LQ\AVR>avr-objdump -t liblq.a
In archive liblq.a:

vt.o:     file format elf32-avr

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 vt.cpp
00000000 l    d  .text  00000000
00000000 l    d  .data  00000000
00000000 l    d  .bss   00000000
0000003f l       *ABS*  00000000 __SREG__
0000003e l       *ABS*  00000000 __SP_H__
0000003d l       *ABS*  00000000 __SP_L__
00000000 l       *ABS*  00000000 __tmp_reg__
00000001 l       *ABS*  00000000 __zero_reg__
00000005 l     O .data  00000004 attriblist
000000b2 l     O .bss   00000002 sOperatingsys
00000030 l     O .data  000000a2 _ZZ5vtkeyvE7pattern
000000d2 l     O .data  00000002 FSYSTEMCASESENSITIVE
000000d4 l     O .data  00000002 EPOCHTOTXT_BUFFER_SIZE
000000d6 l     O .data  00000004 DAYCOUNT_1970_1_1
00000000         *UND*  00000000 __do_copy_data
00000000         *UND*  00000000 __do_clear_bss
00000000 g     O .data  00000002 vt_xmax
00000002 g     O .data  00000002 vt_ymax
00000000 g     O .bss   00000001 vt_uses_screen
00000001 g     O .bss   00000050 screen
00000051 g     O .bss   00000050 act_screen
000000a1 g     O .bss   00000002 vt_curr_line
000000a3 g     O .bss   00000002 vt_curr_col
000000a5 g     O .bss   00000002 act_vt_curr_line
000000a7 g     O .bss   00000002 act_vt_curr_col
00000004 g     O .data  00000001 vt_current_attribute
000000a9 g     O .bss   00000002 vt_scrol_ymin
000000ab g     O .bss   00000002 vt_scrol_ymax
00000000 g     F .text  0000004a _Z8vtcolorshh
0000004a g     F .text  00000040 _Z6vtattrh
0000008a g     F .text  000000bc _Z5vtclsv
00000000         *UND*  00000000 strcmp
00000edc g     F .text  0000013a _Z8xxvtopenv
00000146 g     F .text  00000010 _Z8vtcurdisv
00000b4a g     F .text  00000344 _Z9vtrefreshv
00000156 g     F .text  00000050 _Z10vtsetscrolhh
000001a6 g     F .text  0000023a _Z6vtochac
00000000         *UND*  00000000 __mulhi3
00000890 g     F .text  0000020a _Z4vtnlv
00000000         *UND*  00000000 __iob
00000000         *UND*  00000000 fputc
000003e0 g     F .text  00000068 _Z6vtputsPKc
00000448 g     F .text  000000ae _Z8vtdeleolv
000004f6 g     F .text  00000074 _Z8vtdelbolv
0000056a g     F .text  00000178 _Z7vtcurdnv
000006e2 g     F .text  000001ae _Z7vtcurupv
00000a9a g     F .text  0000006e _Z8vtcurposjj
00000b08 g     F .text  00000042 _Z9vtgcurposPhS_
000000ad g     O .bss   00000005 vt_raw_sequence
00000000         *UND*  00000000 printf
00000e8e g     F .text  0000002c _Z7vtclosev
00000eba g     F .text  00000010 _Z14vtclose_forcedv
00000eca g     F .text  00000012 _Z6vtopenv
00001016 g     F .text  0000000e _Z7vtiskeyv
00001024 g     F .text  0000000e _Z11vtiskeyfastv
00001032 g     F .text  00000034 _Z13getrawkeycodev
00001066 g     F .text  000001d2 _Z5vtkeyv
00000000         *UND*  00000000 _Z7getmsecv
00000000         *UND*  00000000 _Z8diffmsecm
00000000         *UND*  00000000 _Z6iswordPKcS0_
00001238 g     F .text  00000098 _Z10xxvtcurposii

D:\HOME\CC\LQ\AVR>

Simulation


See ../../../../WinAVR/doc/simulavr-0.1.2.1/html/index.html
There are good and easy to understand examples.

Simulation with GUI

Enter in a first DOS-BOX :
C:\HOME\CC\QQ\AVR\QQMAIN>simulavr -d at90s8515 -g

Simulating a at90s8515 device.

MESSAGE: file ../../simulavr-0.1.2.1/src/decoder.c: line 3872: generating opcode
 lookup_table
MESSAGE: file ../../simulavr-0.1.2.1/src/main.c: line 413: Simulating clock freq
uency of 8000000 Hz
Waiting on port 1212 for gdb client to connect...
Connection opened by host 127.0.0.1, port 1358.
Waiting on port 1212 for gdb client to connect...


Enter in a second DOS-BOX : avr-insight
A GUI Windows opens, use

New library codes


get from nongnu.org, search for project avr-libc, there is a CVS

Some files are in http://cvsweb.netbsd.org/bsdweb.cgi/src/gnu/dist/gcc/gcc/config/avr/Attic/libgcc.S?rev=1.1.1.1&content-type=text/x-cvsweb-markup

Libraries

Libraries are linked , depending on target machine code from C:\WinAVR\avr\lib\avr5\libc.a , and if that file does not exist, then independ on target machine from C:\WinAVR\avr\lib\libc.a

See also

linavr.htm - How to compile with a Linux Computer
The documentation in C:\WinAVR\doc\avr-libc\avr-libc-user-manual-1.4.3.pdf
../../winlin/winavr/00idx.htm - The Unix utilities which come with WinAVR

www

http://www.microcontroller.net - German wiki and discussions
http://8515.avrfreaks.net - can upload / download projects from there
http://www.atmel.com - documents about all the different processors