FRDM-KL25Z(Freescale)+WIZ550io(WIZnet) 프로젝트 Tutorial
목차:
1. 프로젝트 생성
2. 프로젝트 설정 및 컴파일
3. F/W 다운로드 방법
4. Peripheral (GPIO, SPI) 추가 방법
5. W5500 ioLibrary 포팅 방법
1. 프로젝트 생성
-. FRDM-KL25Z+WIZ550io+ioShield-A 보드 사진
FRDM-KL25Z와 ioShield-A 상의 SPI 선을 서로 연결합니다. (PTD1<->SCK, PTD2<->MOSI, PTD3<->MISO)

-. FRDM-KL25Z 보드 사진

-. WIZ550io+ioShield-A 보드 사진

-. Eclipse를 실행합니다.

-. 메뉴에서 File->New-> C Project를 선택합니다.

-. Project name 필드에 사용하고자 하는 프로젝트명을 입력하고 Project type으로 Freescale Kinetis KLxx C/C++ Project를 선택 후 Next를 클릭합니다.

-. Chip family필드의 Kinetis KL25x를 확인하고 Trace output으로 Semihosting STDOUT stream을 선택 후 Next를 클릭합니다.




-. Toolchain path에 1번에서 설치한 GNU Toolchain의 C:\Program Files (x86)\GNU Tools ARM Embedded\4.8 2014q1\bin path를 입력 후 Finish를 클릭합니다.

-. 생성된 프로젝트를 확인합니다.

2. 프로젝트 설정 및 컴파일
-. Eclipse를 실행합니다.

-. 프로젝트의 Properties를 선택합니다.

-. C/C++ Build->Tool Settings->Cross ARM GNU Create Flash Image->General->Output file format을 Raw binary로 변경 후 Apply를 클릭합니다.

-. 프로젝트 우클릭 메뉴에서 Build Project를 선택해서 컴파일 합니다.


3. F/W 다운로드 방법
-. FRDM-KL25Z 보드의 OpenSDA USB 포트를 PC와 연결합니다.

-. Workspace의 C:\Users\Jim\workspace\FRDM-KL25Z+WIZ550io\Debug 디렉토리에 생성된 바이너리 파일을 MBED 드라이브로 복사합니다. 참조 http://mbed.org/platforms/KL25Z/

-. F/W update 후 reset 시킵니다.
4. Peripheral (GPIO, SPI) 추가 방법
-. Open소스로 제공되는 PlatformHandler/freedom_gpio.c, freedom_gpio.h 파일을 프로젝트에 추가합니다.

-. 프로젝트 우클릭 후 Properties->C/C++ General->Paths and Symbols->Includes->GNU C->Add를 선택해서 src/PlatformHandler path를 추가하고 Apply 선택합니다.

-. main.c 파일에서 freedom_gpio.h, common.h 파일을 include 합니다.

-. main 함수를 example로 수정 및 컴파일 후 보드에서 LED 동작을 확인합니다.

-. Open소스로 제공되는 PlatformHandler/freedom_spi.c, freedom_spi.h 파일을 프로젝트에 추가합니다. main.c 파일에 freedom_spi.h 파일을 include 한 후 컴파일을 진행합니다.

5. W5500 ioLibrary 포팅 방법
-. Open소스로 제공되는 ioLibrary 파일을 프로젝트에 추가합니다.
참조 http://wizwiki.net/wiki/doku.php?id=products:w5500:driver

-. 프로젝트 우클릭 후 Properties->C/C++ General->Paths and Symbols->Includes->GNU C->Add를 선택해서 src/Ethernet, src/Ethernet/W5500 path를 추가하고 Apply 선택합니다.

-. main.c 파일에서 wizchip_conf.h 파일을 include 합니다.

-. common.h 파일에서 하기 내용을 추가합니다.

-. main.c 파일에서 Open소스로 제공되는 하기 내용들을 추가합니다.




-. 추가 후 컴파일을 진행합니다.

-. F/W update 후 LAN 케이블을 연결하고 ping 192.168.xx.xx 명령으로 확인합니다.

<소스 참조>
https://github.com/Wiznet/Loopback_FRDM-KL25Z_Eclipse
https://github.com/bingdo/FRDM-KL25Z-WIZ550io