Difference between revisions of "AVR"

From Free Pascal wiki
Jump to navigationJump to search
(→‎Resources: + Link to lzarusforum.de)
(+ →‎Building Cross compiler: and Subarchitecture)
Line 6: Line 6:
  
 
FPC considers AVR being a 16 bit CPU. So the type tregister actually describes a register pair being the second register implicitly named.
 
FPC considers AVR being a 16 bit CPU. So the type tregister actually describes a register pair being the second register implicitly named.
 +
 +
== Building Cross compiler ==
 +
 +
There are some requirements, you should know about
 +
* You should use the latest Free Pascal sources as there is the most recent support for more controllers.
 +
* Binutils for avr target
 +
* Latest ''stable'' Free Pascal Compiler
 +
 +
Then you can build your cross compiler. Please choose SUBARCH according to your Arduino board / AVR microprocessor.
 +
 +
<code lang="shell">
 +
make buildbase installbase CPU_TARGET=avr OS_TARGET=embedded SUBARCH=avr5 CROSSINSTALL=1 INSTALL_PREFIX=~/fpc NOGDB=1 PP=/usr/bin/fpc CROSSBINDIR=/usr/avr/bin
 +
</code>
 +
 +
== Subarchitecture ==
 +
 +
The operating system target ''embedded'' requires you to specify a aubarchicture when building a cross compiler. The subarchitectures are compatible to the ones used by gcc.
 +
 +
There is a list at: http://www.nongnu.org/avr-libc/user-manual/using_tools.html
  
 
== Resources ==
 
== Resources ==
Line 14: Line 33:
  
 
[[Category:Embedded]]
 
[[Category:Embedded]]
[[Category: Operating Systems and Platforms]]
+
[[Category:Operating Systems and Platforms]]
 
[[Category:Arduino]]
 
[[Category:Arduino]]

Revision as of 16:07, 8 November 2015

Arduino Logo.svg

This article applies to Arduino boards only.

See also: Multiplatform Programming Guide

General information

The FPC-AVR port is currently experimental and non working. It uses the GCC AVR tool chain and will be compatible with GCC regarding calling conventions etc.

Implementation details

FPC considers AVR being a 16 bit CPU. So the type tregister actually describes a register pair being the second register implicitly named.

Building Cross compiler

There are some requirements, you should know about

  • You should use the latest Free Pascal sources as there is the most recent support for more controllers.
  • Binutils for avr target
  • Latest stable Free Pascal Compiler

Then you can build your cross compiler. Please choose SUBARCH according to your Arduino board / AVR microprocessor.

make buildbase installbase CPU_TARGET=avr OS_TARGET=embedded SUBARCH=avr5 CROSSINSTALL=1 INSTALL_PREFIX=~/fpc NOGDB=1 PP=/usr/bin/fpc CROSSBINDIR=/usr/avr/bin

Subarchitecture

The operating system target embedded requires you to specify a aubarchicture when building a cross compiler. The subarchitectures are compatible to the ones used by gcc.

There is a list at: http://www.nongnu.org/avr-libc/user-manual/using_tools.html

Resources