프로젝트옵션설정(1) e w avrewavr 5.1x–프로젝트옵션설정(3,4) 8. project ->...

15
Embedded Workbench AVR 무료강의 www.mvtool.co.kr EWAVR 5.1x프로젝트 옵션 설정(1) 1. Project -> Option -> General Options General Options General Options Target Target 은 IAR Compiler 를 사용 프로세서에 맞추는 가장 중요한 초기화 과정이다. Processor configuration Processor configuration 에서 V0~ V6 설정은 Code/ Data Memory 를 기준으로 사용되는 전체 옵션을 설정하는 것 이며, 혹은 실제 사용하는 디바이스에 맞춰서 이미 설정된 기본 값으로 Compiler 전체 시스템을 자동 변경 시켜준다. 일반적으로 User 라면, 프로세서를 직접 선택하는 것이 올바른 사항이다. V옵션은 메모리 설정 이외에 프로세서별 Stack, Heap 사이즈를 XCL 파일을 직접 조절해야 한다. 전체 V 옵션이 6가지인데 불구하고 40가지 이상의 프로세서가 혼용해서 사용하기 위해서는 부득이한 사항이다. 하지만, XCL 파일을 직접 다루기란 쉽지가 않다. Ex) 8535 SRAM(512 byte), Code (8K) -> V1, Max 64Kbyte data, 8Kbyte code Enhanced core Enhanced core 내부에 Hardware Multiplier 가 있는 디바이스의 경우에 자동 선택하여 준다. System Configuration 기본 XCL 파일 사용유무와 Heap Configuration 과 System 사용 유무를 결한다. 기본설정은 Enable

Upload: others

Post on 24-Feb-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x– 프로젝트 옵션 설정(1)

1. Project -> Option -> General Options

General Options General Options –– TargetTarget IAR Compiler 사 프 에 맞추는 가 한 초 과정 다.

“ Processor configurationProcessor configuration “ 에 V0~ V6 정 Code/ Data Memory 사 는 전체 정하는 것

, 실제 사 하는 스에 맞춰 미 정 본 값 Compiler 전체 시스 동 경 시 다.

적 User 라 , 프 접 택하는 것 사항 다. V 정 에 프Stack, Heap 사 XCL 접 조절해야 한다. 전체 V 6가 하고 40가 상 프 가

해 사 하 해 는 득 한 사항 다. 하 만, XCL 접 다루 란 쉽 가 않다.

Ex) 8535 SRAM(512 byte), Code (8K) -> V1, Max 64Kbyte data, 8Kbyte code

“ Enhanced coreEnhanced core “ 는 내 에 Hardware Multiplier 가 는 스 경 에 동 택하여 다.

“ System Configuration “ 본 XCL

사 무 Heap Configuration 과System 사 무 결한다.

본 정 Enable

Page 2: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(1_2)

2. Project 2. Project --> Option > Option --> General Option > General Option --> Output / Library Configuration > Output / Library Configuration

OutputOutput 컴 에 실행 참조하게

들 생 는 Output files 저 는 폴 시한다.

Output files : Output files : Executable type 과 Library type 택

Output Directories :Output Directories :Executable(Libraries) /Object /List (MAP) files 생

Library ConfigurationLibrary Configuration 사 하게 Library file 결정한다.

미, 본적 참조하게 Library file Target 정에

해 동 택 다.

-- Library (Normal or Full ) Library (Normal or Full ) -- Memory ModelMemory Model

-- Processor Configuration OptionsProcessor Configuration Options

Page 3: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(1_3)

3. Project 3. Project --> Option > Option --> General Option > General Option --> Library Options> Library Options

Library Options Library Options printf /scanf formatter Level 정할 수 다.

PrintfPrintf formatter :formatter :Large/ Small (default) / Tiny

ScanfScanf formatter :formatter :Large / Small (default)

* : * : Library ConfigurationLibrary Configuration 정에 라 ON/OFF

( Normal - No/ Full – Yes )

* EWAVR Compiler guide “ diagnostics ” 참조

Page 4: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정

(1_4)

General 에 본 XCL 참조하 않겠다고 언했다 , XCL 정 내 들 같 하게 정할 수다. Heap Size 각각 Stack 사 RAM, ROM Flash 시 (Base) 사

정할 수가 다.

또한, 헤 에 define 어 는 비트 사 하 해 “ Enable bit definitions in I/O-include files. “ 체크

해 야 하 , 보 주 는 에 하나 니 심하 하 . ( 초 값 Disable )

“ Initialize unused interrupt…. “ 는 사 하 않는 럽트 루틴 수행 라 동 복 할 수 해 다.

Target 에 Processor configuration v0, v1 등과 같 적 택했 경 Dynamic memory allocation 않는다.

4. Project 4. Project --> Option > Option --> General Option > General Option --> Heap Configuration / System> Heap Configuration / System

Page 5: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(1_5)

4. Project 4. Project --> Option > Option --> General option > General option --> MISRA C> MISRA C

MISRA C MISRA C 는 동차 산업 개 추가 Option 틸 다. What is MISRA C?What is MISRA C?

The Motor Industry Software Reliability Association (MISRA) is an organization in the UK that promotes safety in automotive software.

In 1998, MISRA published its “Guidelines for the Use of the C Language in Vehicle Based Software”. The

guidelines address the ambiguities of the C languageand establish coding rules for the automotive industry.

MISRA C includes 127 rules. 93 of these are requiredand the remaining 34 are advisory. All rules apply to the source code and not to the object code generated by the compiler.

Who should use MISRA C?Who should use MISRA C?

Compliance with the MISRA C guidelines is a require-ment in many automotive companies but could be beneficial in any development organization.

The guidelines enforce sound coding practices and address the ambiguities of C; they help developers write code in a consistent manner and avoid confusingconstructions.

How does it work?How does it work?

The IAR MISRA C Checker is completely integrated with the IAR C Compiler. From IAR Embedded Workbench, you can control which MISRA C rules are checked; the settings will be used for both the compiler and the linker.

Page 6: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(2_1)

5. Project 5. Project --> Option > Option --> C/C++ Compiler > C/C++ Compiler --> Language > Language

C/C++ 컴 러에 본적 정한다.

Language : [C]Language : [C]

사 하게 컴 러 종 에 해 결정한다.

Default C language 정 어 다.

Require prototypes : [Disable]Require prototypes : [Disable]

함수에 한 프 타 정하여 업.

* EWAVR_User Guide “ Require prototypes ” 참조

Language conformance : [ Allow IAR extensions ]Language conformance : [ Allow IAR extensions ]

정 language 상태 가 본적 Strict

ISO/ANSI Type 할 , Core 컴 러에

해 language 할 정한다.

* Compiler Reference Guide “ IAR language extension ” 참조

Plain Plain ‘‘charchar’’ is : [Unsigned]is : [Unsigned]

(Unsigned) “ Char “ 수 타 경할 수 다. Enable Enable MultibyteMultibyte Support :Support : [ Disable ][ Disable ]

Multibyte 사 무 결정 할 수 다.

Page 7: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(2_2)

6. Project 6. Project --> Option > Option --> C/C++ Compiler > C/C++ Compiler --> Optimization> Optimization

C/C++ 컴 러에 본적 정한다.

Optimization : [ Size ]Optimization : [ Size ]

ARM IAR C/C++ 컴 러에 는 본적 2가

Optimization model( SizeSize or Speed Speed ) 에 라 , 각각

4가 Optimization Level 택할 수 다.

Optimization Level : Optimization Level :

- None [ Best debug support ]

- Low

- Medium

- High [ Maximum optimization ]

Enabled transformation :Enabled transformation :

- Common Sub-expression elimination - Loop unrolling- Function in-lining- Code motion- Type-based alias analysis- Static variable clustering- Instruction scheduling

* EWAVR compiler Guide “ Efficient coding for … ” 참조

- Common sub-expression : 복 는 함수, 계산식 삭제하여 실행시간드 사 단축

- Function inline : 간단한 함수 inline 하여,시행 시간 단축시 다.

- Code Motion : 고정적 복 루프 삭제하여 실행시간 사 단축

Page 8: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(2_3)

7. Project 7. Project --> Option > Option --> C/C++ Compiler > C/C++ Compiler --> Output / List> Output / List

Output Output 컴 program module[default] 과

Library module 하여 컴 정한다.

생 module 적 정 가능하 ,

스 정보 포함 무에 해 정할 수 다.

* EWAVR compiler Guide “ segment reference ” 참조

List List 는 list (*.lst)과 ASM source (*.s79) 생 할

수 만들어 주는 정 다.

각각 file 생 에 가적 Assembler

mnemonics diagnostics 가 포함 생

Source include Compiler call frame information

포함 가능해 다. (Demo 제한)

* EWAVR User guide “ compiler – list ” 참조

Page 9: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(2_4)

8. Project 8. Project --> Option > Option --> C/C++ Compiler > C/C++ Compiler --> Preprocessor> Preprocessor

Ignore standard include directories : [ Disable ]Ignore standard include directories : [ Disable ]

본 치 C:\…AVR\inc 폴

( $TOOLKIT_DIR&\INC\ ) 본 참조 include

directory 정한다.

Additional include directories : (one per line)Additional include directories : (one per line)

정 본 include 에

해 추가 할 수 다.

Ex) $PROJ_DIR$\srciar\

$PROJ_DIR$\..\..\

PrePre--include : include :

include 전처 처럼 컴 러 상에

정할 수 다.

Ex) test_source.h

test_asm.s79

Preprocessor Preprocessor 는 컴 러 고 능 하나 전처 능 다.

Defined symbols : (one per line)Defined symbols : (one per line)

Source 내에 사 Define symbol 해 넣는다.

Preprocessor output to file 하여 저 가능하다.

Ex) TESTVER = 1

Page 10: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(2_5)

7. Project 7. Project --> Option > Option --> C/C++ Compiler > C/C++ Compiler --> Diagnostics/ Extra Options> Diagnostics/ Extra Options

Diagnostics Diagnostics 는 컴 과정에 생 는 Remark/

Warning/ Error Message 에 한 처 돕는다.

* EWAVR User guide “ diagnostics ” 참조

* EWAVR Compiler guide “ diagnostics ” 참조

Extra Options Extra Options 는 GUI 경에 할 수 없는 컴 러

여러 가 다 Option 들에 해 사 에 해

적 정할 수 해 Option 정 창 다.

* GUI : Graphic User Interface

Page 11: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(3,4)

8. Project 8. Project --> Option > Option --> Customer Build> Customer Build

Customer BuildCustomer Build 능 최근에 추가 Option ,

IAR 사에 제공 는 S/W 다 S/W Tool 에 해 ,

Tool chain 사 해 컴 경 제공하는 능 다.

Ex) Lex , YACC

* EWAVR User guide “ Extending the tool chain ” 참조

* EWAVR Compiler guide “ diagnostics ” 참조

Build Actions Build Actions 는 필 에 해 build 전 에 pre-build /

post-build 하 해 정하는 다.

* EWAVR User guide “ building ” 참조

9. Project 9. Project --> Option > Option --> Build Actions> Build Actions

Page 12: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(5_1)

10. Project 10. Project --> Option > Option --> Linker > Linker --> Output> Output

Output :Output :

정 Format 에 라 실행 태

가 택 , 본적 실행 최초 프 젝트

어 다.

Ex) project.dbg ( For C-SPY Debugging format)project.d90 ( For External Debugging format )project.a90 ( For Hex image format )

Format :Format :

Debug information for CDebug information for C--SPY : [ Disable ] SPY : [ Disable ] 정보 C-SPY Format 경

With runtime control modules : [ Enable ]With runtime control modules : [ Enable ]Program abort, exit, assertions etc.

With I/O emulation modules : [ Enable ] With I/O emulation modules : [ Enable ] Terminal I/O handling 정 ( stdin stdout )

Buffered terminal output : [ Disable ] Buffered terminal output : [ Disable ] Terminal 시 Buffer 역할 해 다.

Allow CAllow C--SPYSPY--specific extra output file:[Enable] specific extra output file:[Enable] Extra Output page enable Option

Output Output 실행 Format 태 Output file 타 정할 수 다.

Output : [Disable]Output : [Disable]C-SPY Format 에 다 Format 필 할 경 사 한다.

Output format : Output format : - Intel-standard/extended : HEX file 필 한 경- UBROF8 : 다 H/W tool Debugger 사 할 경

ModuleModule--local : local : Symbol Symbol 출출 시시 제약제약 Option Option 다다. .

Page 13: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(5_2)

11. Project 11. Project --> Option > Option --> Linker > Linker --> Extra output / List> Extra output / List

Extra output Extra output OutputOutput 에 정 Format 실행

에 다 실행 출 하고 할 경 사 한다.

단, “ OptionsOptions – LinkerLinker - OutputOutput - (Format) Allow CAllow C--

SPYSPY--specific extra output filespecific extra output file option EnableEnable 시킨

에 사 할 수 다.

List List 는 MAP (*.map) 수 만들어 주는 정 다.

C/C++ Compiler 에 List 생 과는 틀 다.

Linking 끝난 상태에 만 생 , SymbolSymbol Option 정

에 라 global / local symbol 포함여 결정할 수 다.

Module summaryModule summary : module 사 량 시

Include suppressed entries :Include suppressed entries : List 에 생략segment 에 든 정보 해 볼 수 다.

Static overlay map :Static overlay map : Static overlay system 정보 추가

Page 14: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(5_3)

12. Project 12. Project --> Option > Option --> Linker > Linker --> > ConfigConfig

Linker command file :Linker command file :

본적 iar_avr.xcl 택 , XCL

에는 본적 , 사 하는 CPU 정 비 하여,

Interrupt Vertor 사 역 정과 ROM과 RAM

그 트가 크 어드 스 정 등 내

포함하고 다.

Override default program entry :Override default program entry :

Cstartup code 에 정 어 는 entry point 치

정해 다.

__program_start 라 문제가 않 만, 그 않경 드시 경해 주어야만 한다.

Search paths : (one per line) Search paths : (one per line)

라 브러 path 정

ConfigConfig 는 XCL 과 Startup code entry point 등 정 다.

Page 15: 프로젝트옵션설정(1) E W AVREWAVR 5.1x–프로젝트옵션설정(3,4) 8. Project -> Option -> Customer Build Customer Build기능은최근에추가된Option 으로써, IAR

Embedded WorkbenchAVR무료강의

www.mvtool.co.kr

EWAVR 5.1x – 프로젝트 옵션 설정(5_4)

13. Project 13. Project --> Option > Option --> Linker > Linker --> Processing> Processing

Fill unused code Memory : [ Disable ]Fill unused code Memory : [ Disable ]

Fill pattern : Fill pattern :

사 하 않는 공간에 채워넣 넣는다.

Ex) 0xFF

Generate checksum : [ Disable ]Generate checksum : [ Disable ]

Size : [ 1/2/4 bytes ]Size : [ 1/2/4 bytes ]

Arithmetic sumArithmetic sum정해 사 에 라 연 적 한 결과 값저 ( 없 )

CRC16 ( 0x11021 )CRC16 ( 0x11021 )CRC 다항식 사 한

CRC32 ( 0x4C11DB7 )CRC32 ( 0x4C11DB7 )CRC 다항식 사 한

CrcCrc polynomial : polynomial : CRC 다항식( 접 ) 사 한

Complement : Complement : 1과 2 보수 택 사

Bit Order : Bit Order : 상 (MSB)/하 (LSB) 비트 순 정.

Processing Processing 컴 사 하 않는 Code Memory 역 처 해 사 다.