06.02.2013 Views

AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel

AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel

AVR32795: Using the GNU Linker Scripts on AVR UC3 ... - Atmel

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

32158A-<strong>AVR</strong>-01/11<br />

<str<strong>on</strong>g><strong>AVR</strong>32795</str<strong>on</strong>g><br />

Q: How can I create a 32-bit <strong>AVR</strong>32 Studio project from an existing standal<strong>on</strong>e<br />

project that has its own makefile and linker script?<br />

A: Here is <str<strong>on</strong>g>the</str<strong>on</strong>g> step-by-step procedure to import your existing project into 32-bit<br />

<strong>AVR</strong>32 Studio and reuse <str<strong>on</strong>g>the</str<strong>on</strong>g> makefile and linker scripts of <str<strong>on</strong>g>the</str<strong>on</strong>g> project:<br />

1. Create an empty project:<br />

• Open <str<strong>on</strong>g>the</str<strong>on</strong>g> New wizard selecti<strong>on</strong>: menu File -> New -> O<str<strong>on</strong>g>the</str<strong>on</strong>g>r<br />

• Expand <str<strong>on</strong>g>the</str<strong>on</strong>g> C folder and highlight <str<strong>on</strong>g>the</str<strong>on</strong>g> <strong>AVR</strong>32 C project (Make) item<br />

• Click Next to open <str<strong>on</strong>g>the</str<strong>on</strong>g> New Project wizard<br />

• Select <str<strong>on</strong>g>the</str<strong>on</strong>g> Target MCU from <str<strong>on</strong>g>the</str<strong>on</strong>g> list, enter a project name, and click Finish<br />

2. Add <str<strong>on</strong>g>the</str<strong>on</strong>g> existing source code and makefile:<br />

• Open <str<strong>on</strong>g>the</str<strong>on</strong>g> New wizard selecti<strong>on</strong> again: menu File -> New -> O<str<strong>on</strong>g>the</str<strong>on</strong>g>r<br />

• Expand <str<strong>on</strong>g>the</str<strong>on</strong>g> General folder and highlight <str<strong>on</strong>g>the</str<strong>on</strong>g> Folder item<br />

• Click Next to open <str<strong>on</strong>g>the</str<strong>on</strong>g> New Folder wizard<br />

• Click <strong>on</strong> Advanced>>, and check <str<strong>on</strong>g>the</str<strong>on</strong>g> Link to folder in <str<strong>on</strong>g>the</str<strong>on</strong>g> file system box<br />

• Browse to <str<strong>on</strong>g>the</str<strong>on</strong>g> locati<strong>on</strong> of your existing stand-al<strong>on</strong>e project, and click Finish<br />

3. Create a make target:<br />

• In <str<strong>on</strong>g>the</str<strong>on</strong>g> Project Explorer view, browse to <str<strong>on</strong>g>the</str<strong>on</strong>g> folder that c<strong>on</strong>tains <str<strong>on</strong>g>the</str<strong>on</strong>g> makefile<br />

• Right-click <strong>on</strong> <str<strong>on</strong>g>the</str<strong>on</strong>g> makefile file, and select <str<strong>on</strong>g>the</str<strong>on</strong>g> Create make target item<br />

• Enter a name in <str<strong>on</strong>g>the</str<strong>on</strong>g> Target Name: field (for example, Build), and click<br />

Create<br />

NOTE O<str<strong>on</strong>g>the</str<strong>on</strong>g>r targets could be added by repeating <str<strong>on</strong>g>the</str<strong>on</strong>g> above steps.<br />

NOTE The make target creati<strong>on</strong>s depend <strong>on</strong> <str<strong>on</strong>g>the</str<strong>on</strong>g> keywords defined in <str<strong>on</strong>g>the</str<strong>on</strong>g> makefile:<br />

4. Build <str<strong>on</strong>g>the</str<strong>on</strong>g> make target:<br />

• In <str<strong>on</strong>g>the</str<strong>on</strong>g> Project Explorer view, right-click <strong>on</strong> <str<strong>on</strong>g>the</str<strong>on</strong>g> project name, and select <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

Build make target item<br />

• Select <str<strong>on</strong>g>the</str<strong>on</strong>g> make target to build, and click Finish<br />

19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!