iar compiler e w - mvtool.co.kr - (주)마이크로비젼 · embedded workbench430 iar embedded...

35
Embedded Workbench 430 www.mvtool.co.kr IAR Embedded Workbench IAR Embedded Workbench 소개 소개 IAR Compiler EW Compiler Series는 전세계적으로 임베디드 시스템 개발자들이 가장 많이 사용하는 C/C++ Compiler 및 Debugging Tool 입니다. 8/ 16/ 32 bit Microprocessor 와 DSP 등 30가지 이상의 Compiler 시리즈를 지원하며, 세계적인 기업인 컴파일러 개발 전문 회사 IAR 사 ( www.iar.com ) 제품으로써, 안정된 Tool 과 최적의 개발자 환경은, 이미 미국/유럽/ 아시아 각지의 Microcontroller Vender (ATMEL , Hitachi, TI, SAMSUNG 등)들을 통해서 인정을 받고 있습니다. 국내기업 SAMSUNG 에서 의뢰되어 만들어진 SAM8 compiler (SAM8 : Samsung 8 bit Microprocessor ) 또한, IAR 사 EW Series 중에 하나이며, 현재까지도 계속적인 Upgrade 와 지원으로 삼성을 포함한 국내외 많은 사용자들에 의해서 꾸준히 사용되고 있습니다. ( 제품명, EWSAM8 Compiler ) EW430 컴파일러는 TI 의 MSP430 전 시리즈를 지원하고 있으며, USB 방식의 H/W Debugger Tool (FET430-USB) 와 빠른 Debugging 환경을 제공하고 있습니다. 뿐만 아니라, 각종 Evaluation boards 를 위한 별도의 Example Project Source 와 IAR Compiler 를 활용하여 기본적인 주변 Peripheral 간단하게 제어 할 수 있는 예제 소스를 제공하여, 사용자 편의를 도모한다. - IAR Compiler Series 와 지원 Vander EWARM , EWAVR, (New) EWAVR32,, EWMSP430, EWSAM8, EW8051, EWx96, EWH8/300H & H8S, EWCRCP3000/CR16C & SC14 , EWZ80, EWeZ80, EWPIC12/16/17, EWPIC18, (New) EWdsPIC, EW68HC11, EWM16C/10-60, EWM32C & M16C/80, EW68HC12 & HCS12, (NEW) EWHCS12, EW78K0/78K0S/78K0R, EWV850, EWMK5, EWR8C/Tiny, EW65C02, EWMAXQ 등 . ( 2009. 2월 현재) Analog Devices, ARM architecture, Atmel, Cirrus Logic, Cypress, Freescale Semiconductor, Infineon, Luminary Maxim/Dallas, Microchip , NEC, OKI Semiconductor, NXP Semiconductors, Renesas Technology, Samsung, Sharp, Silicon Laboratories, STMicroelectronics, Texas Instruments, Toshiba, WDC, ZiLOG 등.. ( 2009. 2월 현재)

Upload: vanphuc

Post on 06-May-2018

281 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

IAR Embedded Workbench IAR Embedded Workbench 개개

IAR Compiler

EW Compiler Series는 전 계적 드 시스템 개 들 가 많 하는 C/C++ Compiler Debugging

Tool 니다. 8/ 16/ 32 bit Microprocessor DSP 등 30가 Compiler 시 원하 , 계적 기업

컴파 러 개 전문 회 IAR ( www.iar.com ) 제 , 안정 Tool 과 적 개 환경 , 미 미 / 럽/

아시아 각 Microcontroller Vender (ATMEL , Hitachi, TI, SAMSUNG 등)들 통해 정 고 습니다.

내기업 SAMSUNG 에 어 만들어 SAM8 compiler (SAM8 : Samsung 8 bit Microprocessor ) 또한, IAR

EW Series 에 하나 , 현 까 계 적 Upgrade 원 포함한 내 많 들에 해

꾸 히 고 습니다. ( 제 , EWSAM8 Compiler )

EW430 컴파 러는 TI MSP430 전 시 원하고 , USB 식 H/W Debugger Tool (FET430-USB)

빠 Debugging 환경 제공하고 습니다. 뿐만 아니라, 각종 Evaluation boards 한 Example Project

Source IAR Compiler 활 하여 기본적 주 Peripheral 간단하게 제어 할 수 는 제 스 제공하여,

편 한다.

- IAR Compiler Series 원 Vander

EWARM , EWAVR, (New) EWAVR32,, EWMSP430, EWSAM8, EW8051, EWx96, EWH8/300H & H8S, EWCRCP3000/CR16C & SC14 , EWZ80, EWeZ80, EWPIC12/16/17, EWPIC18, (New) EWdsPIC, EW68HC11, EWM16C/10-60, EWM32C & M16C/80, EW68HC12 & HCS12, (NEW) EWHCS12, EW78K0/78K0S/78K0R, EWV850, EWMK5, EWR8C/Tiny, EW65C02, EWMAXQ 등 . ( 2009. 2월 현 )

Analog Devices, ARM architecture, Atmel, Cirrus Logic, Cypress, Freescale Semiconductor, Infineon, Luminary Maxim/Dallas, Microchip , NEC, OKI Semiconductor, NXP Semiconductors, Renesas Technology, Samsung, Sharp, Silicon Laboratories, STMicroelectronics, Texas Instruments, Toshiba, WDC, ZiLOG 등.. ( 2009. 2월 현 )

Page 2: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

Highlights in EW430 Version 4.20

MISRA C:2004 support

Multiple inheritance

Improved hardware multiplier support

Advanced cycle counter for MSP430F5xx

Evaluation version of IAR PowerPac for MSP430

Symbols window

Start the debugger without download

Updated user guide

Highlights in EW430 Version 4.20

CC430F5133, CC430F5135, CC430F5137, CC430F6125,

CC430F6126, CC430F6127, CC430F6135, CC430F6137, MSP430x1xx

MSP430x2xx

MSP430x3xx

MSP430x4xx

MSP430x5xx

Devices with extended memory: CC430F6125, CC430F6126, CC430F6135, CC430F6137, CC430F5133, CC430F5135, CC430F5137, MSP430F2416, MSP430F2417, MSP430F2418, MSP430F2419, MSP430F2616, MSP430F2617, MSP430F2618…

Compiler SPEC

Highlights in EW430 Version 4.21

New devices support

Information Center

Debugging multiple images

New extended keyword __ramfunc

Auto refresh in the debugger memory window

New cspybat features

New C-SPY macro __delay(milliseconds)

New icons in Project Manager window

Code templates

Page 3: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

- EW430 Download -

• 크 비젼 : http://www.microvision.co.kr

- Products > Compiler > IAR Embedded Workbench > Embedded Workbech 제 종 > 430 Demo (30days) Download

• IAR : http://www.iar.com

- Products > Compilers and debuggers > 430 > Download > 30 days Evaluation edition OR 4/8KB KickStart edition

EW430 Demo :EW430 Demo : 1. Evaluation Version ( Time limited for 30 Days )

2. KickStart Version ( Code limited for 4/8KByte )

* 전 하기 해 는 드시 등 과정 거쳐야 하 , 등 과 동시에 등 고객 e-mail 주 통하여

급 License Key License Number 가 어야 만, Install 가능하므 드시 기 해야만 합니다.

( 다 드 시간 : 약 2~3 )

EWARM package EWARM package 종종

1. EW430-Full : EWARM C Compiler/Assembler + C-SPY + SUA

2. EW430-LE : EWARM C Compiler/Assembler + SUA

3. EW430-BL : EWARM C Compiler/Assembler ( 16KB Code Limited )

4. EW430 DEMO : EWARM C Compiler/Assembler ( 4 / 8 (extended device) KB or 30Days) + C-SPY

* LE : Limited Edition * SUA : Support and Upgrade Agreement

Compiler Download

Page 4: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

Ver 4.20 Patch (2~7)

Page 5: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

< IAR Embedded Workbench IDE > < IAR Embedded Workbench IDE >

EW 환경 소개

Menu ToolBar

Project1

Sources

Output

Project2

Project3

….

Messages

Windows

Source Windows

Book Mark Build All Debug

Message Windows

Workspace windows

Page 6: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

C-SPY 환경 소개

Debugging Windows

Book Mark Build All Build and Debug

Workspace windows

Menu ToolBar

DebuggingIcon

< Windows >Break pointsDisassemblyMemoryRegisterWatchLocalsAutoLive WatchQuick WatchCall StackTerminal I/OCode CoverageProfiling

< IAR Embedded Workbench IDE < IAR Embedded Workbench IDE –– CSPY >CSPY >

Page 7: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

IAR Information Center

Getting Started Getting Started

프 젝트 생 터, 스 크, 컴파 , 킹, 깅 등

IAR 툴 에 개합니다.

User GuidesUser Guides

컴파 러 매뉴얼과 각종 료 개합니다.

Example ProjectsExample Projects

프 Example 제공합니다.

Tutorials Tutorials

간단한 테스트 제 스 제공합니다.

SupportSupport

기술 원 청 시 활 할 수 습니다.

Release NotesRelease Notes

신 전에 한 Release 료 확 해 볼수 습니다.

Page 8: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

< IAR Embedded Workbench 새 프로젝트 만들기 >

새 프로젝트 만들기

Note) 생성되는 파일들.

*.EWW *.EWP *.EWD *.ESDT Setting Folder… 등

Create New Project 창이 뜨면, Empty ProjectEmpty Project 를 선택한 후에,

OKOK를 누르면 New project 가 생성되어 Workspace 에 추가

됩니다. ( “ Project name.ewp “ 생성 )

Page 9: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

Page 10: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

새 소스 일 등록하기(1)

File File --> New > New --> File> File 를 선택하면 새로운 텍스트 문서창이 열리며 Untitled1, Untitled2… 등으로 기본 파일이 생성됩니다.

< IAR Embedded Workbench < IAR Embedded Workbench 새새 소스소스 파일파일 프로젝트에프로젝트에 링크링크 시키기시키기 >>

생성된 텍스트 문서를 어떤 파일로 사용할 지 결정한 후에

File -> Save As… 를 눌러 원하는 source-name.C 를 입력하고 저장합니다.

이렇게 생성된 파일은 Project 에 추가 ( Add ) 가 되야, 비로서 컴파일

하기 위한 기본 틀이 완성이 되는 것이다.

생성된 텍스트 문서를 어떤 파일로 사용할 지 결정한 후에

File -> Save As… 를 눌러 원하는 sourcesource--name.Cname.C 를 입력하고 저장합니다.

이렇게 생성된 파일은 Project 에 추가 ( Add ) 가 되야, 비로서 컴파일

하기 위한 기본 틀이 완성이 되는 것이다.

Page 11: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

Project Project --> Add Files> Add Files…… 을 누르면 아래의 창이 뜨며, 원하는 소스를 선택하여 열기 버튼을 누르면, 현재 커서가 위치해 있는 프로젝트에 소스가 등록이 된다. (Active Project 가 기준이 아님을 명심하자.)

새 소스 일 등록하기(2)

Project Windows 에 원하는 소스 파일과 기본 Group 들이 자동 등록 된 것을확인할 수 있다. (우측 그림)

마지막으로, File – Save Workspace를 실행해야지만, 지금까지의 모든 작업이 *.EWW 파일로 저장이 된다.

Project Windows 에 원하는 소스 파일과 기본 Group 들이 자동 등록 된 것을확인할 수 있다. (우측 그림)

마지막으로, File File –– Save WorkspaceSave Workspace를 실행해야지만, 지금까지의 모든 작업이 *.EWW 파일로 저장이 된다.

Output, Document .. 등 임의의 Group 으로 관리하고 싶은 파일이 따로 있다면, 그룹을 만든 뒤 [ Project – Add Group ] , 커서를 그룹에 위치시키고 같은 방식으로 파일을 추가 시키면 된다.

Output, Document .. 등 임의의 Group 으로 관리하고 싶은 파일이 따로 있다면, 그룹을 만든 뒤 [ Project – Add Group ] , 커서를 그룹에 위치시키고 같은 방식으로 파일을 추가 시키면 된다.

Page 12: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(1_1)

1. 1. Project Project --> Option > Option --> General option > General option --> > TargetTarget

TargetTarget 은 사용하는 CPU 에 맞게 컴파일러 시스템을 맞추는 가장 기본적이고도 중요한 작업이다.

Processor variant :

시리즈 별로 구분되어 있는 Device 의 선택합니다.

Hardware Multiplier :

Hardware Multiplier 가 지원되는 Device 의 경우,

[ Allow direct access ] 와 [ Use only library calls ]

로 구분하여 선택 지원하고 있습니다.

* VFP : Vector Floating pointing

Position – Independent code :

MSP430 에서만 지원된는 옵션으로써, 고정적으로 위치되는

Application 메모리의 번지를 임의적으로 지정할 수 있도록 한다.

This is useful, for example, when developing modules that should be loaded dynamically at runtime.

The drawback of position-independent code is that the size of the code will be somewhat larger, and that interrupt vectors cannot be specified directly. Also note that global data is not position-independent.

Note: Position-independent code is not supported for the MSP430X architecture.

Assembler-only project : asm 프로젝트 전용으로 사용시

Processor variant :Processor variant :

시리즈 별로 구분되어 있는 Device 의 선택합니다.

Hardware Multiplier :Hardware Multiplier :

Hardware Multiplier 가 지원되는 Device 의 경우,

[ Allow direct access ] 와 [ Use only library calls ]

로 구분하여 선택 지원하고 있습니다.

* VFP : Vector Floating pointing

Position Position –– Independent code :Independent code :

MSP430 에서만 지원된는 옵션으로써, 고정적으로 위치되는

Application 메모리의 번지를 임의적으로 지정할 수 있도록 한다.

This is useful, for example, when developing modules that should be loaded dynamically at runtime.

The drawback of position-independent code is that the size of the code will be somewhat larger, and that interrupt vectors cannot be specified directly. Also note that global data is not position-independent.

Note: Position-independent code is not supported for the MSP430X architecture.

AssemblerAssembler--only project : only project : asmasm 프로젝트프로젝트 전용으로전용으로 사용시사용시

Page 13: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(1_2)

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

Output 은 컴파일 후에 실행 될 혹은 참조하게 될 파일

들이 생성되는 Output files 이 저장되는 폴더를 명시한다.

Output files :

Executable type 과 Library type 중 선택

Output Directories :

[ Executable / Libraries ]

*.hex , *.dbgg, *.bin , *.r43 등과 같은 실행파일, 혹은 라이브러리와 같은 최종 파일이 생성되다.

[ Object ]

각각의 소스 별 Object 파일이 생성된다.

[ List files ]

각각의 소스 별 List 파일, Map 파일을 생성한다.

OutputOutput 은 컴파일 후에 실행 될 혹은 참조하게 될 파일

들이 생성되는 Output files 이 저장되는 폴더를 명시한다.

Output files : Output files :

Executable type 과 Library type 중 선택

Output Directories : Output Directories :

[ Executable / Libraries ]

*.hex , *.dbgg, *.bin , *.r43 등과 같은 실행파일, 혹은 라이브러리와 같은 최종 파일이 생성되다.

[ Object ]

각각의 소스 별 Object 파일이 생성된다.

[ List files ]

각각의 소스 별 List 파일, Map 파일을 생성한다.

Page 14: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(1_2)

2_1. 2_1. Project Project --> Option > Option --> General Option > General Option --> > Library Configuration Library Configuration

Library Configuration 은 사용하게 될 Library 를 결정

한다. 이미, 기본적으로 참조하게 될 Library file 은 Target

외에도 아래의 여러 설정에 의해서 임의적으로 지정된다.

- Library (Normal or Full ) - Hardware Multiplier- Position-Independent Code - Optimize Setting - Data Model - Floating Point

Library ConfigurationLibrary Configuration 은 사용하게 될 Library 를 결정

한다. 이미, 기본적으로 참조하게 될 Library file 은 Target

외에도 아래의 여러 설정에 의해서 임의적으로 지정된다.

-- Library (Normal or Full ) Library (Normal or Full ) -- Hardware Hardware MultiplierMultiplier-- PositionPosition--Independent Code Independent Code -- Optimize Setting Optimize Setting -- Data Model Data Model -- Floating Point Floating Point

None : Do not link with a runtime library.

Normal DLIB : Use the normal configuration of the C/EC++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.

Full DLIB : Use the full configuration of the C/EC++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.

Custom DLIB : Use a customized C/EC++ runtime library.

CLIB : Use the legacy C runtime library.

Custom CLIB : Use a customized legacy C runtime library.

NoneNone : Do not link with a runtime library.

Normal DLIBNormal DLIB : Use the normal configuration of the C/EC++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.

Full DLIBFull DLIB : Use the full configuration of the C/EC++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.

Custom DLIBCustom DLIB : Use a customized C/EC++ runtime library.

CLIB : Use the legacy C runtime library.

Custom CLIB : Use a customized legacy C runtime library.

Page 15: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(1_3)

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

Library Options Library Options 은 printf /scanf formatter 의 Level 을 설정할 수 있다.

Printf formatter ( 4단계 ) :

Full (default) / Large/ Small/ Tiny Level

Scanf formatter ( 3단계 ) :

Full (default) / Large/ Small Level

* : Library Configuration 정에 라 ON/OFF

( Normal - No/ Full – Yes )

PrintfPrintf formatter ( 4formatter ( 4단계단계 ) :) :

Full (default) / Large/ Small/ Tiny Level

ScanfScanf formatter ( 3formatter ( 3단계단계 ) : ) :

Full (default) / Large/ Small Level

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

( Normal - No/ Full – Yes )

Page 16: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

EW430 4.2x – 프로젝트 옵션 설정

(1_4)4. Project 4. Project --> Option > Option --> General Option > General Option --> Stack/Heap> Stack/Heap

Stack / Heap size 조절

기본적으로 Stack size 는 50h ( 0x32), Data16/20 용 Heap Size 가 각각 0h/80h 가 설정이 된다.

Override default 를 check 함으로써, 임의적으로값 변경이 가능하다.

* Data20 의 경우, 지원 프로세서에 한해서 사용할수 있다.

Read from linker command file : GUI 환경내에설정이 아닌 Liker command file 로 직접 변경하고자 할 경우, 사용한다.

Stack / Heap size Stack / Heap size 조절조절

기본적으로기본적으로 Stack size Stack size 는는 50h ( 0x32), Data16/20 50h ( 0x32), Data16/20 용용 Heap Size Heap Size 가가 각각각각 0h/80h 0h/80h 가가 설정이설정이 된다된다. .

Override default Override default 를를 check check 함으로써함으로써, , 임의적으로임의적으로값값 변경이변경이 가능하다가능하다. .

* Data20 * Data20 의의 경우경우, , 지원지원 프로세서에프로세서에 한해서한해서 사용할수사용할수 있다있다. .

Read from linker command file : Read from linker command file : GUI GUI 환경내에환경내에설정이설정이 아닌아닌 Liker command file Liker command file 로로 직접직접 변경하고변경하고자자 할할 경우경우, , 사용한다사용한다. .

Page 17: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(1_4)

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 18: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

MiSRA-C

4_1. Project 4_1. Project --> Option > Option --> General Option / C/C++ Compiler > General Option / C/C++ Compiler --> MISRA> MISRA--C 2004 C 2004

Enable MISRA-C : MISRA-C 적용

Log MISRA-C C-Setting :

MISRA-C 설정 상태를 Build 시 Log Message 로 출력해준다.

MISRA-C 2004 & 1998 :

MISRA-C Rule을 연도별로구분하여 적용한다.

None , Required, All :

MISRA-C는 default Rule 적용을 받지만, 경우에 따라서는 임의적으로 조절

이 가능하도록 구성되었다.

Enable MISRA-C : MISRA-C 적용

Log MISRA-C C-Setting :

MISRA-C 설정 상태를 Build 시 Log Message 로 출력해준다.

MISRA-C 2004 & 1998 :

MISRA-C Rule을 연도별로구분하여 적용한다.

None , Required, All :

MISRA-C는 default Rule 적용을 받지만, 경우에 따라서는 임의적으로 조절

이 가능하도록 구성되었다.

General Option & C/C++ Compiler MISRA-C 구분

일반적으로는 Compile 과 Link 시에는 General Option 의 MISRA-C

를 기준하도록 되어있지만, 경우에 따라서는 Compile 과 Link 시의

MISRA-C Rule 을 달리 적용할수가 있다.

Required & Advisory : .

MISRA-C 는 필수 사항과 권고 사항으로 Rule 로 구분되어 있는데,

대부분의 Rule 이 필수사항으로 반드시 검증을 거치 도록 Default

enable 되어 있고, 권고사항은 Disable 되어 있다.

General Option & C/C++ Compiler MISRAGeneral Option & C/C++ Compiler MISRA--C C 구분구분

일반적으로는 Compile 과 Link 시에는 General Option 의 MISRA-C

를 기준하도록 되어있지만, 경우에 따라서는 Compile 과 Link 시의

MISRA-C Rule 을 달리 적용할수가 있다.

Required & Advisory : Required & Advisory : .

MISRA-C 는 필수 사항과 권고 사항으로 Rule 로 구분되어 있는데,

대부분의 Rule 이 필수사항으로 반드시 검증을 거치 도록 Default

enable 되어 있고, 권고사항은 Disable 되어 있다.

Page 19: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

MiSRA-C

4_2. 4_2. 주의주의 사항사항 및및 MISRAMISRA--C Source C Source 예제예제

Rule 2.2 (required) Source code shall only use /* ... */ style comments.

The compiler will generate an error, indicating a violation of this rule, if C++ style

comments (//) are used in your source code.

Rule 8.1 (required) Functions shall have prototype declarations and the prototype shall be visible at both the

function definition and call.

(x) void func(); /* Not a prototype */

(o) void func(void);

(o) void func(void) { … }

MISRA C 2004 rule 1.1

compiler is configured to allow extensions - all code shall conform to ISO 9899 standard C, with no extensions permitted

C/C++ Compiler – Language Conformance

Relaxed ISO/ANSI & Strict ISO/ANSI 중 선택해야만 한다.

MISRA C 2004 rule 1.1MISRA C 2004 rule 1.1

compiler is configured to allow extensions - all code shall conform to ISO 9899 standard C, with no extensions permitted

C/C++ Compiler C/C++ Compiler –– Language Conformance Language Conformance

Relaxed ISO/ANSI & Strict ISO/ANSI 중 선택해야만 한다.

Page 20: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(2_1)

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

C/C++ 컴파일러에 관련된 기본적인 옵션을 설정한다. Language : [C]

사용하게 될 Language 의 종류에 대해서 결정한다. IAR 은 C 뿐만 아니라, Embedded C++ 을 동시에 지원이 가능하다.

Require prototypes : [Disable]

아래의 프로토타입에 대해서 Error 메시지를 발생시킴으로써, 소스를 추가 검증 할 수 있다.

1)선언되어 있지 않은 함수 호출 시2)Kernighan & Ritchie C 표준 Rule 적용3)프로토타입 선언없이 사용된 Public 함수 선언시4)프로토타입이 선언되어 있지 않은 상태에서,

함수 포인터를 이용한 간접 함수 호출시

* EW430_User Guide “ Require prototypes ” 참조

Language conformance : [ Allow IAR extensions ]

현재 설정된 language 의 상태를 가장 기본적인

Strict ISO/ANSI Type 으로 할 지, 혹은 Core 와

컴파일러에 의해서 확장된 language 로 할지 설정한다.

* Compiler Reference Guide “ IAR language extension” 참조

Plain ‘char’ is : [Unsigned]

(Unsigned) “ Char “ 변수 타입을 변경할 수 있다.

Language : [C]Language : [C]

사용하게 될 Language 의 종류에 대해서 결정한다. IAR 은 C 뿐만 아니라, Embedded C++ 을 동시에 지원이 가능하다.

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

아래의 프로토타입에 대해서 Error 메시지를 발생시킴으로써, 소스를 추가 검증 할 수 있다.

1)선언되어 있지 않은 함수 호출 시2)Kernighan & Ritchie C 표준 Rule 적용3)프로토타입 선언없이 사용된 Public 함수 선언시4)프로토타입이 선언되어 있지 않은 상태에서,

함수 포인터를 이용한 간접 함수 호출시

* EW430_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 Multi-byte Support : [ Disable ]

Multibyte charter 의 사용 유무를 결정 할 수 있다.

Enable IAR migration preprocessor extensions: [ Disable ]

확장된 키워드와 관련하여, 소스 변환을 하지 않고 이전 버전과의호환성을 갖기 위한 옵션이다.

Enable MultiEnable Multi--byte Support : [ Disable ]byte Support : [ Disable ]

Multibyte charter 의 사용 유무를 결정 할 수 있다.

Enable IAR migration preprocessor extensions: [ Disable ]Enable IAR migration preprocessor extensions: [ Disable ]

확장된 키워드와 관련하여, 소스 변환을 하지 않고 이전 버전과의호환성을 갖기 위한 옵션이다.

Page 21: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

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

사용자를 위한 몇 가지 Tip 을 소개한다. R4/R5 Utilization

[ Normal use ] : R4/R5 를 본래의 기본 레지스터로활용하게 된다.

[ __regvar variables ] : __regvar 키워드를 활용하여글로벌 레지스터 변수와 같이 사용할 수 있게 된다.

[ Not used ] : 레지스터로의 목적이 아닌( Locked ), 사용자 임의의 용도로 활용할 수가 있다.

* EW430 compiler Guide “ compiler option… ” 참조417/540 page

Reduce Stack usage :

Optimization 기능의 종류로써, 스택의 사용공간을 최소화 할 수있도록 돕는다.

20-bit context save on interrupt :

모든 레지스터의 활용을 20-bits 로 사용하도록 변경한다.

기본적으로 Small data Model 로 설정 될 경우, 모든 레지스터가

16bit 로 설정되어 사용되어지고, __save_reg20 등과 같은 특정

레지스터를 사용하여 20bit 까지 사용이 가능하다.

단, Stack 의 여유공간이 필요하며, 시스템이 느려질 수 있다는

단점이 있을 수 있다.

R4/R5 Utilization R4/R5 Utilization

[ Normal use ] :[ Normal use ] : R4/R5 를 본래의 기본 레지스터로활용하게 된다.

[ __[ __regvarregvar variables ] : variables ] : __regvar 키워드를 활용하여글로벌 레지스터 변수와 같이 사용할 수 있게 된다.

[ Not used ] : [ Not used ] : 레지스터로의 목적이 아닌( Locked ), 사용자 임의의 용도로 활용할 수가 있다.

* EW430 compiler Guide “ compiler option… ” 참조417/540 page

Reduce Stack usage :Reduce Stack usage :

Optimization 기능의 종류로써, 스택의 사용공간을 최소화 할 수있도록 돕는다.

2020--bitbit context save on interrupt :context save on interrupt :

모든 레지스터의 활용을 20-bits 로 사용하도록 변경한다.

기본적으로 Small data Model 로 설정 될 경우, 모든 레지스터가

16bit 로 설정되어 사용되어지고, __save_reg20 등과 같은 특정

레지스터를 사용하여 20bit 까지 사용이 가능하다.

단, Stack 의 여유공간이 필요하며, 시스템이 느려질 수 있다는

단점이 있을 수 있다.

Page 22: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(2_2)

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

C/C++ 컴파일러에 관련된 기본적인 옵션을 설정한다. Multi-file Compilation : [ Disable ]Linking 시에 Optimize 를 한번 더 실행을 함으로써, 컴파일시에만 수행된 Optimize 기능을 획기적으로 보강하였다.

Discard Unused Publics : [ Disable ]Multi-file Compilation 을 활용한 Optimization 작업시 Public Function 들과 변수들은 범위에서 제외시킬 수 있다.

Optimization : [ Size ]

ARM IAR C/C++ 컴파일러에서는 기본적으로 2가지의Optimization model ( Size / Speed / Balanced )에 따라서, 각각의 4가지 Optimization Level 을 선택 할 수 있다.

Optimization Level :

-None [ Best debug support ] - Low - Medium - High [ Maximum optimization ]

Enabled transformation :

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

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

MultiMulti--file Compilation : [ Disable ]file Compilation : [ Disable ]Linking 시에 Optimize 를 한번 더 실행을 함으로써, 컴파일시에만 수행된 Optimize 기능을 획기적으로 보강하였다.

Discard Unused Publics : [ Disable ]Discard Unused Publics : [ Disable ]Multi-file Compilation 을 활용한 Optimization 작업시 Public Function 들과 변수들은 범위에서 제외시킬 수 있다. .

Optimization : [ Size ]Optimization : [ Size ]

ARM IAR C/C++ 컴파일러에서는 기본적으로 2가지의Optimization model ( SizeSize / Speed / Balanced Speed / Balanced )에 따라서, 각각의 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

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

- Common sub-expression :

중복되는 함수, 계산식 삭제하여 실행시간 및 코드 사이즈 단축

- Function inline : 간단한 함수를 inline 화 하여, 시행 시간을 단축시켜준다.

- Code Motion : 고정적인 반복 루프를 삭제하여 실행시간 및 사이즈 단축

- Common sub-expression :

중복되는 함수, 계산식 삭제하여 실행시간 및 코드 사이즈 단축

- Function inline : 간단한 함수를 inline 화 하여, 시행 시간을 단축시켜준다.

- Code Motion : 고정적인 반복 루프를 삭제하여 실행시간 및 사이즈 단축IAR Optimization TIP.1)#pragrma 를 활용한 함수 직접 지정 Optimize2)프로젝트단위가 아닌 소스별 직접 지정 Optimize

* EW430 Compiler reference Guide

Page 23: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(2_3)

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

Debugging 시에는 Compile 된 소스의 정보를 필요로 합니다.

[ Generate debug information ] Debug Mode 시, Default 로 Enable

되어있는 그 기능을 수행합니다.

Code section name 을 사용함으로써, 사용자 Application

Source 와 다른 소스 혹은 Library 와의 영역을 분리하여

확인 할 수 있게 도와준다.

Note : The included debug information increases the size of the object files.

* EW430 User Guide “ compiler option ” 494/629 참조

Debugging 시에는 Compile 된 소스의 정보를 필요로 합니다.

[ Generate debug information ] Debug Mode 시, Default 로 Enable

되어있는 그 기능을 수행합니다.

Code section name 을 사용함으로써, 사용자 Application

Source 와 다른 소스 혹은 Library 와의 영역을 분리하여

확인 할 수 있게 도와준다.

Note : The included debug information increases the size of the object files.

* EW430 User Guide “ compiler option ” 494/629 참조

Output list file 은 컴파일된 소스에 관련된 컴파일 정보를 볼

수 있는 list 파일(*.lst)을 만들어 주는 기능입니다. 각각의 list file

생성과 동시에 Assembler mnemonics 와 diagnostics 가 포함이

된 파일 생성 등 부가적인 기능을 수행합니다.

Output assembler file 은 유저의 C 소스를 ASM source (*.s79)

를 만들어 주는 기능입니다. Source include 와 Compiler call

frame information 포함이 가능해진다. (Demo 제한)

* EW430 User guide “ compiler – list ” 참조

Output list file 은 컴파일된 소스에 관련된 컴파일 정보를 볼

수 있는 list 파일(*.lst)을 만들어 주는 기능입니다. 각각의 list file

생성과 동시에 Assembler mnemonics 와 diagnostics 가 포함이

된 파일 생성 등 부가적인 기능을 수행합니다.

Output assembler file 은 유저의 C 소스를 ASM source (*.s79)

를 만들어 주는 기능입니다. Source include 와 Compiler call

frame information 포함이 가능해진다. (Demo 제한)

* EW430 User guide “ compiler – list ” 참조

Page 24: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(2_4)

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

Preprocessor Preprocessor 는 컴파일러의 고유 기능 중 하나인 전처리 기능이다.Ignore standard include directories : [ Disable ]

기본 설치 디렉토리인 C:\…arm\inc 폴더를

( $TOOLKIT_DIR&\INC\ ) 를 Header file 기본

참조로 폴더로 설정한다.

Additional include directories : (one per line)

설정된 기본 디렉토리 이 외의 include 디렉토리에

대해서 추가 입력할 수 있다.

Ex) $PROJ_DIR$\srciar\

$PROJ_DIR$\..\..\

Pre-include :

include 파일을 전처리기처럼 컴파일러 옵션상에서

지정할 수 있다.

Ex) test_source.h

test_asm.s79

* EW430 User Guide “ compiler option ” 497/629 참조

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

기본 설치 디렉토리인 C:\…arm\inc 폴더를

( $TOOLKIT_DIR&\INC\ ) 를 Header file 기본

참조로 폴더로 설정한다.

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

* EW430 User Guide “ compiler option ” 497/629 참조

Defined symbols : (one per line)

Source 내에서 사용이 될 Define symbol 을 입력해 넣는다.

Preprocessor output to file 을 통하여 파일로 저장/출력도 가능하다.

Ex) TESTVER = 1

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

Source 내에서 사용이 될 Define symbol 을 입력해 넣는다.

Preprocessor output to file 을 통하여 파일로 저장/출력도 가능하다.

Ex) TESTVER = 1

Page 25: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(2_5)

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

Diagnostics 는 컴파일 과정에서 발생 되는 Remark/

Warning/ Error Message 에 대한 처리를 돕는다.

경우에 따라서는, 발생되는 Error 를 무시할 수도 있다.

* EW430 User guide “ diagnostics ” 참조

* EW430 Compiler guide “ diagnostics ” 참조

Diagnostics Diagnostics 는 컴파일 과정에서 발생 되는 Remark/

Warning/ Error Message 에 대한 처리를 돕는다.

경우에 따라서는, 발생되는 Error 를 무시할 수도 있다.

* EW430 User guide “ diagnostics ” 참조

* EW430 Compiler guide “ diagnostics ” 참조

Extra Options 는 GUI 환경에서 구현 할 수 없는 컴파일러

의 여러 가지 다른 Option 들에 대해서 사용자에 의해서

임의적으로 설정할 수 있도록 마련해둔 Option 설정 창이다.

Ex ) “ –aeabi “

EABI 기능을 들자면, GUI 환경내 에서는 설정이 불가능하기

때문에 Command Line options 에 “ “라고 설정해야만한다.

* GUI : Graphic User Interface

Extra Options Extra Options 는 GUI 환경에서 구현 할 수 없는 컴파일러

의 여러 가지 다른 Option 들에 대해서 사용자에 의해서

임의적으로 설정할 수 있도록 마련해둔 Option 설정 창이다.

Ex ) “ –aeabi “

EABI 기능을 들자면, GUI 환경내 에서는 설정이 불가능하기

때문에 Command Line options 에 “ “라고 설정해야만한다.

* GUI : Graphic User Interface

Page 26: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(3,4)

12. Project 12. Project --> Option > Option --> Build Actions> Build Actions

Customer Build 기능은 최근에 추가된 Option 으로써,

IAR 사에서 제공되는 S/W 이외의 다른 S/W Tool 에 대해서,

Tool chain 을 사용해 컴파일 환경을 제공하는 기능이다.

Ex) Lex , YACC

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

* EW430 Compiler guide “ diagnostics ” 참조

Customer BuildCustomer Build 기능은 최근에 추가된 Option 으로써,

IAR 사에서 제공되는 S/W 이외의 다른 S/W Tool 에 대해서,

Tool chain 을 사용해 컴파일 환경을 제공하는 기능이다.

Ex) Lex , YACC

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

* EW430 Compiler guide “ diagnostics ” 참조

Build Actions 는 필요에 의해서 build 전후에

pre-build / post-build 하기 위해서 설정하는

옵션이다.

* EW430 User guide “ building ” 참조

Build Actions Build Actions 는 필요에 의해서 build 전후에

pre-build / post-build 하기 위해서 설정하는

옵션이다.

* EW430 User guide “ building ” 참조

11. Project 11. Project --> Option > Option --> Customer Build> Customer Build

Page 27: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

Format :Debug information for C-SPY : [ Disable ] 디버깅 정보를 C-SPY 용 Format 으로 변경

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

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

Buffered terminal output : [ Disable ] Terminal 이용 시 Buffer 역할을 해준다.

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

Format :Debug information for C-SPY : [ Disable ] 디버깅 정보를 C-SPY 용 Format 으로 변경

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

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

Buffered terminal output : [ Disable ] Terminal 이용 시 Buffer 역할을 해준다.

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

Output : [Disable]C-SPY 용 Format 외에 다른 Format 이 필요할 경우 사용한다.

Output format : - MSP430-txt : TI MSP430 전용 text Format Image - intel-standard : HEX format 의 file 이 필요할 경우 ( 64KB 이하 )- intel-extended : HEX format 의 file 이 필요할 경우 ( 64KB 이상 )

Module-local :Symbol 호출 시 제한할 수 있는 Option.

Output : [Disable]Output : [Disable]C-SPY 용 Format 외에 다른 Format 이 필요할 경우 사용한다.

Output format : Output format : - MSP430-txt : TI MSP430 전용 text Format Image - intel-standard : HEX format 의 file 이 필요할 경우 ( 64KB 이하 )- intel-extended : HEX format 의 file 이 필요할 경우 ( 64KB 이상 )

ModuleModule--local :local :Symbol Symbol 호출호출 시시 제한할제한할 수수 있는있는 Option. Option.

프로젝트 옵션 설정(3,4)

Output 은 실행파일의 Format 형태와 Output file 타입을 설정할 수 있다.

Output files : [ Disable ]임의로 설정된 Format 에 따라서 실행파일의 형태가 선택되며, 기본적으로 실행파일명은 최초 프로젝트명을따르도록 되어 있다.

Ex) project.d43 ( For Debugging format ),project.a43 (For Intel-Standard/Extended)project.txt ( For MSP430-txt )

Output Output 은 실행파일의 Format 형태와 Output file 타입을 설정할 수 있다.

Output files : [ Disable ]임의로 설정된 Format 에 따라서 실행파일의 형태가 선택되며, 기본적으로 실행파일명은 최초 프로젝트명을따르도록 되어 있다.

Ex) project.d43 ( For Debugging format ),project.a43 (For Intel-Standard/Extended)project.txt ( For MSP430-txt )

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

Page 28: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(3,4)

Extra Output 은 Output 에서 설정된 Format 의실행파일 이 외에 다른 실행 파일을 얻고자 할경우 사용한다. 즉, 한번 컴파일 후에 2가지의 파일을 얻을 수 있다.

[ Generate additional output ] 을 Enable 활성화시킨 후에, Output format 을 설정해준다.

앞서 설명되어 있는 Ouput과 동일한 Format 을지원하게 된다.

[ Override Default ] 를 체크 함으로써, 출력 파일명과 확장명을 임의적으로 조정이 가능하다.

Extra OutputExtra Output 은 OutputOutput 에서 설정된 Format 의실행파일 이 외에 다른 실행 파일을 얻고자 할경우 사용한다. 즉, 한번 컴파일 후에 2가지의 파일을 얻을 수 있다.

[ Generate additional output ] 을 Enable 활성화시킨 후에, Output format 을 설정해준다.

앞서 설명되어 있는 Ouput과 동일한 Format 을지원하게 된다.

[ Override Default ] 를 체크 함으로써, 출력 파일명과 확장명을 임의적으로 조정이 가능하다.

Project Project --> Option > Option --> Linker > Linker --> Extra Options /> Extra Options /……./ List./ List

List 는 MAP 파일(*.map) 수 있도록 만들어 주는 설정이다. C/C++Compiler 에 List 파일 생성 옵션과는 틀리다. Linking 이 끝난 상태에서만 생성되며, Symbol Option 설정에 따라서 global / local symbol포함여부를 결정할 수 있다.

Module summary : module 별 메모리 사용량 표시

Include suppressed entries : 일반 List 파일에서 생략된segment 에 관련된 모든 정보를 확인해 볼 수 있다.

Static overlay map : Static overlay system 정보 추가

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 29: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(5_4)

Project Project --> Option > Option --> Linker > Linker --> Processing> Processing

Processing Processing 은 컴파일 후 사용하지 않는 Code Memory 영역의 처리를 위해 사용된다.

Fill unused code Memory : [ Disable ]

Fill pattern :

사용하지 않는 공간에 채워넣을 패턴을 넣는다.

Ex) 0xFF

Generate checksum : [ Disable ]

Size : [ 1/2/4 bytes ]

Arithmetic sum정해진 사이즈에 따라 연속적으로 더한 결과 값저장 ( 자지 올림 없음 )

CRC16 ( 0x11021 )CRC 다항식을 사용한 확인

CRC32 ( 0x4C11DB7 )CRC 다항식을 사용한 확인

Crc polynomial : CRC 다항식( 직접 입력 )을 사용한 확인

Complement : 1과 2의 보수 선택 사용

Bit Order : 상위(MSB)/하위(LSB) 비트의 순서 설정.

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) 비트의 순서 설정.

Page 30: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(5_3)

Project Project --> Option > Option --> Linker > Linker --> > ConfigConfig

ConfigConfig 는 icf 파일과 Startup code 의 entry point 등의 설정을 도와준다.

Linker command file :

Core에 의해서 임의적으로 설정되는 Linker Configuration file

[ *.xcl ] 기본적으로, Interrupt Vector 영역 설정과 ROM/Flash 와

RAM/Data 의 어드레스 번지 설정, Stack / Heap 사이즈 설정 등의

내용을 포함하고 있다.

Edit.. – Linker Conguration file editor :

수정이 필요하다면, 직접 icf 파일을 열어 보는 불필요

함이 없이 UI 환경을 이용해서 편리하게 수정할 수 있다.

Linker command file :Linker command file :

Core에 의해서 임의적으로 설정되는 Linker Configuration file

[ *.xcl ] 기본적으로, Interrupt Vector 영역 설정과 ROM/Flash 와

RAM/Data 의 어드레스 번지 설정, Stack / Heap 사이즈 설정 등의

내용을 포함하고 있다.

Edit.. Edit.. –– Linker Linker CongurationConguration file editor :file editor :

수정이 필요하다면, 직접 icf 파일을 열어 보는 불필요

함이 없이 UI 환경을 이용해서 편리하게 수정할 수 있다.

UI 환경과 Linker Command file 내에는 정의 되어 있지 않은

임의의 Symbol 을 정의 할때 사용할 수 가 있다.

// Code

-Z(CODE)CSTART,ISR_CODE=FC00-FFDF

-P(CODE)CODE=FC00-FFDF

// Interrupt vectors

-Z(CODE)INTVEC=FFE0-FFFF

-Z(CODE)RESET=FFFE-FFFF

-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP

+_DATA16_HEAP_SIZE=0200-027F

UI 환경과 Linker Command file 내에는 정의 되어 있지 않은

임의의 Symbol 을 정의 할때 사용할 수 가 있다.

// Code

-Z(CODE)CSTART,ISR_CODE=FC00-FFDF

-P(CODE)CODE=FC00-FFDF

// Interrupt vectors

-Z(CODE)INTVEC=FFE0-FFFF

-Z(CODE)RESET=FFFE-FFFF

-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP

+_DATA16_HEAP_SIZE=0200-027F

Page 31: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(6_1)

Project -> Option -> Debugger -> Setup

Debugger Setup 은 디버깅하기 위한 H/W tool을 설정하기 위한 옵션이다.

Driver : [ Simulator ]

시뮬레이터 이외에 FET Debugger 가 유일하게

제공되며, 목록상에 나열된 Driver 들은 기본적으로

각각의 *.dll 파일을 갖는다.

사용하게 될 드라이버로 설정하도록 한다.

Run to : [ Enable ]

임으로 시작 지점을 설정할 수 있도록 한다.

Ex) “ Main ” 혹은 PC = 0xXXXX

Setup macros :

C-SPY 를 초기화 하기 위한 작업으로, Debugger 선택

으로 기본적인 Macro file 은 제공된다.

Device description file :

Target 으로 설정된 Device나 core 의 DDF 파일을

지정해준다.

Driver : [ Simulator ]

시뮬레이터 이외에 FET Debugger 가 유일하게

제공되며, 목록상에 나열된 Driver 들은 기본적으로

각각의 *.dll 파일을 갖는다.

사용하게 될 드라이버로 설정하도록 한다.

Run to : [ Enable ]

임으로 시작 지점을 설정할 수 있도록 한다.

Ex) “ Main ” 혹은 PC = 0xXXXX

Setup macros :

C-SPY 를 초기화 하기 위한 작업으로, Debugger 선택

으로 기본적인 Macro file 은 제공된다.

Device description file :

Target 으로 설정된 Device나 core 의 DDF 파일을

지정해준다.

Page 32: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(6_2)

Project Project --> Option > Option --> Debugger > Debugger --> > PluginsPlugins

Plugins 는 Debugger 를 보다 효율적으로 활용할 수 있도록 여러가지 기능들을 제공한다.

[ LCD Display ] 7/14 Segment 가상 LCD Display 선택 가능하다.

[ Profiling ] Function-Level 프로그램 분석 툴. 함수를 최소 단위로 하여 동작되는 시간대별로 분류한다. 프로그램의 효율성 및 Optimze 시, 효율적인 소스 부분을 찾아줄 수도 있다.

[ Code Coverage ] Profiling 기능과 같은 프로그램 분석 툴이지만, 사용빈도수만 표시한다. * 시뮬레이션에서만 지원.

[ Stack ] 할당되어 있는 Stack 의 값을 MAX 로 STACk 의 현재 값 및 최고값을 보여주는 유용한 기능이다.

[ Symbols ]

[ RTOS ] 아래와 같은 middleOS 와의 연동이 가능하다.

Segger embOS / PowerPAC RTOS / uC/OSII /

Code Coverage / ORTI RTOS

[ LCD Display ] 7/14 Segment 가상 LCD Display 선택 가능하다.

[ Profiling ] Function-Level 프로그램 분석 툴. 함수를 최소 단위로 하여 동작되는 시간대별로 분류한다. 프로그램의 효율성 및 Optimze 시, 효율적인 소스 부분을 찾아줄 수도 있다.

[ Code Coverage ] Profiling 기능과 같은 프로그램 분석 툴이지만, 사용빈도수만 표시한다. * 시뮬레이션에서만 지원.

[ Stack ] 할당되어 있는 Stack 의 값을 MAX 로 STACk 의 현재 값 및 최고값을 보여주는 유용한 기능이다.

[ Symbols ]

[ RTOS ] 아래와 같은 middleOS 와의 연동이 가능하다.

Segger embOS / PowerPAC RTOS / uC/OSII /

Code Coverage / ORTI RTOS

IAR Optimization TIP.

이 기능들은 기능들은 편리한 기능이기는 하지만, 경우에 따라서Breakpoint 를 소비한다던가, Stack 등 리소스 소비, 디버깅 속도저하 등의 문제가 발생 될 수 있다. 항시 사용하는 것이 아니라, 일시적 분석 및 혹은 필요 시만 활용하는 것을 바람직하다.

Page 33: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

프로젝트 옵션 설정(6_2)

Project Project --> Option > Option --> Debugger > Debugger --> FET Debugger> FET Debugger

H/W debugger Connection

[ Verify download ]

Use this option to verify that the downloaded code image can be read back from target memory with the correct contents.

[ Allow erase/write access to locked flash memory ]

Enables erase/write access to Info Segment A. This option can only be used with an MSP430F2xx device.

[ Allow erase/write access to BSL flash memory ]

Enables erase/write access to BSL flash memory. This option can only be used with an MSP430F5xx device.

[ Flash Erase ]

Main 과 Information memory 를 구분하여 Erase 하며,

신구 데이터를 구분하여 Erase 혹은 Download 한다.

[ Verify download ]

Use this option to verify that the downloaded code image can be read back from target memory with the correct contents.

[ Allow erase/write access to locked flash memory ]

Enables erase/write access to Info Segment A. This option can only be used with an MSP430F2xx device.

[ Allow erase/write access to BSL flash memory ]

Enables erase/write access to BSL flash memory. This option can only be used with an MSP430F5xx device.

[ Flash Erase ]

Main 과 Information memory 를 구분하여 Erase 하며,

신구 데이터를 구분하여 Erase 혹은 Download 한다.

Page 34: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

Debug windows

Code Coverage / ProfilingCode Coverage / Profiling

빨간색 다이아몬드 0% 는 한번도 실행된 적 없음.

녹색 다이아몬드 100% 는 현재 함수 내 Code 전부가 실행된 적 됐음.

빨간색과 녹색 다이아몬드 xx% 만큼 현 함수내 code 가 부분 실행 되었음.

노란색 다이아몬드는 각 함수에서 한번도 실행되지 않은 소스를 의미하는데,

< column start >-<column end>:<row>

의 형태로 현재 소스의 위치까지 표시해 준다.

빨간색 다이아몬드 0% 는 한번도 실행된 적 없음.

녹색 다이아몬드 100% 는 현재 함수 내 Code 전부가 실행된 적 됐음.

빨간색과 녹색 다이아몬드 xx% 만큼 현 함수내 code 가 부분 실행 되었음.

노란색 다이아몬드는 각 함수에서 한번도 실행되지 않은 소스를 의미하는데,

< column start >< column start >--<column end>:<row><column end>:<row>

의 형태로 현재 소스의 위치까지 표시해 준다.

[ Function ]

각각의 함수 명을 의미한다. Outside main 은 현재 리스트상에 존재하지 않는 함수 즉, Start-up / exit code 혹은 라이브러리 등을의미하게 된다.

[ Calls ]

각각의 함수가 호출된 총 횟수를 의미한다.

[ Flat Time ]

함수가 실행된 총 시간(Cycle) 표기와 전체 시간 중 실행시간을 표기하되, 함수의 호출에 따른 누적은 피한다.

* 각각의 함수 사용 빈도수( Cycle / %)를 추정할 수 있다. 소스 효율성 극대화.

[ Accumulated Time ]

함수가 실행된 총 시간(Cycle) 표기와 전체 시간중 실행시간을 표기하며, 함수의 호출에 따른 누적도 포함한다.

* 각각의 함수 호출 빈도수( Cycle / %)를 추정할 수 있다. 소스 효율성 극대화

[ Function ]

각각의 함수 명을 의미한다. Outside main 은 현재 리스트상에 존재하지 않는 함수 즉, Start-up / exit code 혹은 라이브러리 등을의미하게 된다.

[ Calls ]

각각의 함수가 호출된 총 횟수를 의미한다.

[ Flat Time ]

함수가 실행된 총 시간(Cycle) 표기와 전체 시간 중 실행시간을 표기하되, 함수의 호출에 따른 누적은 피한다.

* 각각의 함수 사용 빈도수( Cycle / %)를 추정할 수 있다. 소스 효율성 극대화.

[ Accumulated Time ]

함수가 실행된 총 시간(Cycle) 표기와 전체 시간중 실행시간을 표기하며, 함수의 호출에 따른 누적도 포함한다.

* 각각의 함수 호출 빈도수( Cycle / %)를 추정할 수 있다. 소스 효율성 극대화

Page 35: IAR Compiler E W - mvtool.co.kr - (주)마이크로비젼 · Embedded Workbench430 IAR Embedded Workbench 소개 IAR Compiler EW Compiler Series는전세계적으로임베디드시스템개발

Embedded Workbench 430

www.mvtool.co.kr

EW430 4.xx – 기타

- 크 비젼

TEL : 02-3283-0101

FAX : 02-3283-0160

Web : http://www.mvtool.co.kr

IAR C 문

※ 기타 문 항 저희 홈페 Q/A 통하여 문 주시거나, E-mail 탁드 니다.

[email protected]