Help/avrobj Format

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am also new in avr-gcc compiler and 1. looking for a help file describing all the switches that this compiler has.
2. Does anybody know how to produce an object file from the compiler that is supported by avr(in a format in order to download from AVR-Studio)

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you use a make file from the sample programs, it will create the proper file you need to download to your stk500 from AVR studio.
If you have an stk200, you have to use the AVR ISP application and you can download the .ROM file that it creates.

-jeff

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

See the avr-objcopy program that came (or should have come) with AVR-GCC. Then use it to convert the GCC output to 'Intel HEX'

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Usage: AVR-GCC.EXE [options] file...
Options:
--help Display this information
-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= Display the full path to library
-print-prog-name= Display the full path to compiler component
-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
-Wa, Pass comma-separated on to the assembler
-Wp, Pass comma-separated on to the preprocessor
-Wl, Pass comma-separated on to the linker
-Xlinker Pass on to the linker
-save-temps Do not delete intermediate files
-pipe Use pipes rather than intermediate files
-specs= Override builtin specs with the contents of
-B Add to the compiler's search paths
-b Run gcc for target , if installed
-V Run gcc version number , if installed
-v Display the programs invoked by the compiler
-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 Place the output into
-x Specify the language of the following input files
Permissable languages include: c c++ assembler none
'none' means revert to the default behaviour of
guessing the language based on the file's extension

Options starting with -g, -f, -m, -O or -W are automatically passed on to
the various sub-processes invoked by AVR-GCC.EXE. In order to pass other options
on to these processes the -W options must be used.
Usage: cpp.exe [switches] input output
Switches:
-include Include the contents of before other files
-imacros Accept definition of marcos in
-iprefix Specify as a prefix for next two options
-iwithprefix Add to the end of the system include paths
-iwithprefixbefore Add to the end of the main include paths
-isystem Add to the start of the system include paths
-idirafter Add to the end of the system include paths
-I Add to the end of the main include paths
-nostdinc Do not search the system include directories
-nostdinc++ Do not search the system include directories for C++
-o Put output into
-pedantic Issue all warnings demanded by strict ANSI C
-traditional Follow K&R pre-processor behaviour
-trigraphs Support ANSI C trigraphs
-lang-c Assume that the input sources are in C
-lang-c89 Assume that the input sources are in C89
-lang-c++ Assume that the input sources are in C++
-lang-objc Assume that the input sources are in ObjectiveC
-lang-objc++ Assume that the input sources are in ObjectiveC++
-lang-asm Assume that the input sources are in assembler
-lang-chill Assume that the input sources are in Chill
-+ Allow parsing of C++ style features
-w Inhibit warning messages
-Wtrigraphs Warn if trigraphs are encountered
-Wno-trigraphs Do not warn about trigraphs
-Wcomment{s} Warn if one comment starts inside another
-Wno-comment{s} Do not warn about comments
-Wtraditional Warn if a macro argument is/would be turned into
a string if -tradtional is specified
-Wno-traditional Do not warn about stringification
-Wundef Warn if an undefined macro is used by #if
-Wno-undef Do not warn about testing udefined macros
-Wimport Warn about the use of the #import directive
-Wno-import Do not warn about the use of #import
-Werror Treat all warnings as errors
-Wno-error Do not treat warnings as errors
-Wall Enable all preprocessor warnings
-M Generate make dependencies
-MM As -M, but ignore system header files
-MD As -M, but put output in a .d file
-MMD As -MD, but ignore system header files
-MG Treat missing header file as generated files
-g Include #define and #undef directives in the output
-D Define a with string '1' as its value
-D= Define a with as its value
-A () Assert the to
-U Undefine
-u or -undef Do not predefine any macros
-v Display the version number
-H Print the name of header files as they are used
-C Do not discard comments
-dM Display a list of macro definitions active at end
-dD Preserve macro definitions in output
-dN As -dD except that only the names are preserved
-dI Include #include directives in the output
-ifoutput Describe skipped code blocks in output
-P Do not generate #line directives
-$ Do not include '$' in identifiers
-remap Remap file names when including files.
-h or --help Display this information
Usage: cc1.exe input [switches]
Switches:
-ffixed- Mark as being unavailable to the compiler
-fcall-used- Mark as being corrupted by function calls
-fcall-saved- Mark as being preserved across functions
-fprefix-function-name Add a prefix to all function names
-fcheck-memory-usage Generate code to check every memory access
-fstrict-aliasing Assume strict aliasing rules apply
-fargument-noalias-global Assume arguments do not alias each other or globals
-fargument-noalias Assume arguments may alias globals but not each other
-fargument-alias Specify that arguments may alias each other & globals
-fstack-check Insert stack checking code into the program
-fpack-struct Pack structure members together without holes
-fregmove Enables a regoster move optimisation
-fgnu-linker Output GNU ld formatted global initialisers
-fverbose-asm Add extra commentry to assembler output
-ffunction-sections place each function into its own section
-finhibit-size-directive Do not generate .size directives
-fcommon Do not put unitialised globals in the common section
-ffast-math Improve FP speed by violating ANSI & IEEE rules
-fbranch-probabilities Use profiling information for branch porbabilities
-ftest-coverage Create data files needed by gcov
-fprofile-arcs Insert arc based program profiling code
-fasynchronous-exceptions Support asynchronous exceptions
-fsjlj-exceptions Use setjmp/longjmp to handle exceptions
-fnew-exceptions Use the new model for exception handling
-fexceptions Enable exception handling
-fpic Generate position independent code, if possible
-fschedule-insns2 Run two passes of the instruction scheduler
-fschedule-insns Reschedule instructions to avoid pipeline stalls
-fpretend-float Pretend that host and target use the same FP format
-frerun-loop-opt Run the loop optimiser twice
-fstructure-noalias Assume structure / array reference and fixed scalar cannot alias
-frerun-cse-after-loop Run CSE pass after loop optimisations
-fgcse Perform the global common subexpression elimination
-fdelayed-branch Attempt to fill delay slots of branch instructions
-freg-struct-return Return 'short' aggregates in registers
-fpcc-struct-return Return 'short' aggregates in memory, not registers
-fcaller-saves Enable saving registers around function calls
-fshared-data Mark data as shared rather than private
-fsyntax-only Check for syntax errors, then stop
-fkeep-static-consts Emit static const variables even if they are not used
-finline Pay attention to the 'inline' keyword
-fkeep-inline-functions Generate code for funcs even if they are fully inlined
-finline-functions Integrate simple functions into their callers
-ffunction-cse Allow function addresses to be held in registers
-fforce-addr Copy memory address constants into regs before using
-fforce-mem Copy memory operands into registers before using
-fpeephole Enable machine specific peephole optimisations
-fwritable-strings Store strings in writable data section
-freduce-all-givs Strength reduce all loop general induction variables
-fmove-all-movables Force all loop invariant computations out of loops
-funroll-all-loops Perofm loop onrolling for all loops
-funroll-loops Perform loop unrolling when interation count is known
-fstrength-reduce Perform strength reduction optimisations
-fthread-jumps Perform jump threading optimisations
-fexpensive-optimizations Perform a number of minor, expensive optimisations
-fcse-skip-blocks When running CSE, follow conditional jumps
-fcse-follow-jumps When running CSE, follow jumps to their targets
-fomit-frame-pointer When possible do not generate stack frames
-fdefer-pop Defer popping functions args from stack until later
-fvolatile-global Consider all mem refs to global data to be volatile
-fvolatile Consider all mem refs through pointers as volatile
-ffloat-store Do not store floats in registers
-O[number] Set optimisation level to [number]
-Os Optimise for space rather than speed
-pedantic Issue warnings needed by strict compliance to ANSI C
-pedantic-errors Like -pedantic except that errors are produced
-w Suppress warnings
-W Enable extra warnings
-Winline Warn when an inlined function cannot be inlined
-Wuninitialized Warn about unitialized automatic variables
-Wcast-align Warn about pointer casts which increase alignment
-Waggregate-return Warn about returning structures, unions or arrays
-Wswitch Warn about enumerated switches missing a specific case
-Wshadow Warn when one local variable shadows another
-Wunused Warn when a variable is unused
-Wid-clash- Warn if 2 identifiers have the same first chars
-Wlarger-than- Warn if an object is larger than bytes
-p Enable function profiling
-o Place output into
-G Put global and static data smaller than
bytes into a special section (on some targets)
-gcoff Generate COFF format debug output
-ggdb Generate default extended debug format output
-g Generate default debug format output
-aux-info Emit declaration info into .X
-quiet Do not display functions compiled or elapsed time
-version Display the compiler's version
-d[letters] Enable dumps from specific passes of the compiler
-dumpbase Base name to be used for dumps from specific passes
--help Display this information

Language specific options:
-ansi Compile just for ANSI C
-fallow-single-precisio Do not promote floats to double if using -traditional
-funsigned-bitfields Make bitfields by unsigned by default
-fsigned-char Make 'char' be signed by default
-funsigned-char Make 'char' be unsigned by default
-traditional Attempt to support traditional K&R style C
-fno-asm Do not recognise the 'asm' keyword
-fno-builtin Do not recognise any built in functions
-fhosted Assume normal C execution environment
-ffreestanding Assume that standard libraries & main might not exist
-fcond-mismatch Allow different types as args of ? operator
-fdollars-in-identifier Allow the use of $ inside indentifiers
-fno-ident Ignore #ident directives
-fshort-double Use the same size for double as for float
-fshort-enums Use the smallest fitting integer to hold enums
-Wall Enable most warning messages
-Wbad-function-cast Warn about casting functions to incompatible types
-Wcast-qual Warn about casts which discard qualifiers
-Wchar-subscripts Warn about subscripts whoes type is 'char'
-Wcomment Warn if nested comments are detected
-Wconversion Warn about possibly confusing type conversions
-Wformat Warn about printf format anomalies
-Wimplicit-function-dec Warn about implicit function declarations
-Wimplicit-int Warn when a declaration does not specify a type
-Wimport Warn about the use of the #import directive
-Wno-long-long Do not warn about using 'long long' when -pedantic
-Wmain Warn about suspicious declarations of main
-Wmissing-braces Warn about possibly missing braces around initialisers
-Wmissing-declarations Warn about global funcs without previous declarations
-Wmissing-prototypes Warn about global funcs without prototypes
-Wmultichar Warn about use of multicharacter literals
-Wnested-externs Warn about externs not at file scope level
-Wparentheses Warn about possible missing parentheses
-Wpointer-arith Warn about function pointer arithmetic
-Wredundant-decls Warn about multiple declarations of the same object
-Wsign-compare Warn about signed/unsigned comparisons
-Wunknown-pragmas Warn about unrecognised pragmas
-Wstrict-prototypes Warn about non-prototyped function decls
-Wtraditional Warn about constructs whoes meaning change in ANSI C
-Wtrigraphs Warn when trigraphs are encountered
-Wwrite-strings Mark strings as 'const char *'

There are undocumented language specific options as well.

Options for Objective C:
-gen-decls Dump decls to a .decl file
-fgnu-runtime Generate code for GNU runtime envrionment
-fnext-runtime Generate code for NeXT runtime environment
-Wselector Warn if a selector has multiple methods
-Wno-protocol Do not warn if inherited methods are unimplemented
-print-objc-runtime-inf Generate C header of platform specific features

Target specific options:
size Output instruction size's to the asm file
no-interrupts Don't output interrupt compatible code
int8 Assume int to be 8 bit integer
include-target Add line `#include "target.inc"' to front of outputed .s file
mcu= Specify the MCU name (at90s23xx,at90s44xx,at90s85xx,atmega603,atmega103)
init-stack= Specify the initial stack address

There are undocumented target specific options as well.

admin's test signature