ARM

GNU ARM Eclipse : DOCUMENTATION : TEMPLATES

siwall 2015. 2. 16. 18:32

Templates

 

Install

템플릿 플러그인 설치는 다른 플러그인 설치 과정과 동일합니다.

- 이클립스 메뉴에서 Help >> Install New Software

- Work with의 확장 메뉴에서 GNU ARM Eclipse Plug-ins를 선택합니다.

- extend the GNU ARM C/C++ Cross Development Tools

- Project Template이 선택되어 있는지 확인합니다.

Install the template plug-ins

Blinky vs Empty

Based on a long tradition among the embedded application developers, the first challenge when encountering a new board is to make it blink a LED. It doesn’t seem much, but in fact there are many details that must fit together for this to work:

 

- startup code가 동작해야 합니다.

- the manufacturer CMSIS initialisations must set the desired clock

- the GPIO definitions/drivers must be available

- the memory map and the linker scripts must match the actual hardware

- 끝으로 the newlib printf() must be directed to an available device for viewing the trace messages

 

The Blinky templates do exactly this, take care of all these details. The observed functionality is relatively simple, the board blinks a LED with 1Hz. To exercise the interrupts, the time base is obtained with the SysTick configured at 1000Hz, with the delay() function counting ticks.

세부적인 것들을 이해하고 나면, 실제 어플리케이션에서는 LED 깜빡이는 기능은 필요하지 않게 됩니다. 차라리 비어있는 상태가 나을 수 있는데, 이것을 위해 Empty template을 사용합니다.

이것은 Blinky template의 전반적인 환경을 제공하지만, main() 함수 내에 다른 코드가 존재하지 않습니다.

 

Project structure

생성된 프로젝트는 대부분 다음과 같은 구조를 갖습니다.

Project structure

Application code

application code는 최상위 레벨의 srcinclude 폴더 안에 위치합니다.

 

Linker scripts

링커 스크립트는 ldscripts 폴더에 위치합니다. 편의를 위해, memory mapsection에 대한 정의를 별개의 파일로 분리하였습니다. 하지만, link configuration 업데이트를 통해서 변경 할 수 있습니다.

 

Local libraries

다양한 라이브러리들이 system 폴더에 위치해 있습니다. Cortex Microcontroller Software Interface Standard (CMSIS) 가 사용되며, 관련된 파일들은 CMSIS 폴더에 들어 있습니다.