Coder Social home page Coder Social logo

avr64db28's Introduction

Building an avr64db28 project with avr-gcc

  1. Download and install latest avr-gcc https://github.com/ZakKemble/avr-gcc-build/releases
  2. Download and unzip latest Atmel support package from http://packs.download.atmel.com/
    e.g. http://packs.download.atmel.com/Atmel.AVR-Dx_DFP.2.2.253.atpack
  3. Build c/c++ files with the following options:
    • C++:
      avr-g++ -D__AVR_DEV_LIB_NAME__=avr64db28 -I<Atmel.AVR-Dx_DFP>/include -mmcu=avr64db28 -B <Atmel.AVR-Dx_DFP>/gcc/dev/avr64db28
    • C:
      avr-gcc -D__AVR_DEV_LIB_NAME__=avr64db28 -I<Atmel.AVR-Dx_DFP>/include -mmcu=avr64db28 -B <Atmel.AVR-Dx_DFP>/gcc/dev/avr64db28
    • ASM:
      avr-g++ -c -D__AVR_DEV_LIB_NAME__=avr64db28 -I<Atmel.AVR-Dx_DFP>/include -mmcu=avr64db28 -B <Atmel.AVR-Dx_DFP>/gcc/dev/avr64db28
    • Linker:
      avr-g++ -mmcu=avr64db28 -B <Atmel.AVR-Dx_DFP>/gcc/dev/avr64db28 -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -Wl,--defsym,__DATA_REGION_LENGTH__=0x6000

Note
__DATA_REGION_LENGTH__=0x6000 is needed to workaround address 0x806001 of avr64db section .bss is not within region data caused by mismatching avr-gcc linker script and the chip definition from the support package.

Details
Address 0x806000 is set by spec-avr64db28

*link_data_start:
	%{!Tdata:-Tdata 0x806000}

While the linker script avrxmega2.x defines

data   (rw!x) : ORIGIN = 0x802000, LENGTH = __DATA_REGION_LENGTH__

Datasheet defines SRAM memory map

Data space Range
(Reserved) 0x1600-0x3FFF
SRAM 16 KB 0x4000-0x7FFF

Perhaps 0x802000 is a base address for the entire xmega2 family, while 0x806000 could be a valid start for the data section in avr64db28. However, the memory range communicated to the linker:

data             0x0000000000802000 0x0000000000002000 rw !x

is not valid for avr64db28. The __DATA_REGION_LENGTH__=0x6000 parameter makes it

data             0x0000000000802000 0x0000000000006000 rw !x

Now data includes 0x806000 and the linker succeeds. Although it is not clear what is the use of 0x4000-0x5FFF memory range

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.