J 창고

Intel Edison Build and Flashing with Arduino 본문

컴퓨터/Linux

Intel Edison Build and Flashing with Arduino

JSFamily 2016. 6. 12. 12:21


1. Intel Edison

Intel 에서 발표한 우표만한 사이즈의 Platform


500 MHz Intel Atom Silvermont dual-core processor(500Mhz의 x86 Processor와 100Mhz Quark MCU 를 탑재)

RAM 1GB DDR3

Flash 4GB eMMC

Wi-Fi (IEEE 802.11a / b / g / n 2.4GHz / 5GHz 듀얼 밴드)

Bluetooth 4.0 (Bluetooth Low Enagey와 Bluetooth 3.0 이전과의 호환성은 조사 중입니다)

SD 카드 인터페이스 × 1

UART × 2 (1 full flow control 1 Rx / Tx)

I 2 C × 2

SPI × 1 (chip select x2)

I 2 S × 1

USB 2.0 × 1 OTG controller




2. Download

- Sources – GPL/LGPL source files

Intel Edison은 Yocto Project를 통한 Build System을 지원하고 있으며 해당 소스는 

https://software.intel.com/en-us/iot/hardware/edison/downloads

에서 제공하고 있다.


- Latest Yocto* Poky image for Edison

또한 해당 링크에서 당연히 Build된 Image도 받을 수 있기에 Build 하기 귀찮은 사람은

해당 바이너리만 받아 Download 하면 된다.


- Microcontroller (MCU) SDK

x86 Processor에서는 Linux가 작동하고 Quark MCU에선 H/W Control을 위한 펌웨어를 돌릴 수 있는데

이를 위한 MCU SDK 도 Intel 에서 지원한다. 해당 SDK는 Eclipse 기반이다.

또한 Arduino IDE를 통해서도 개발 할 수 있다.(셋팅법은 아래 기술)


- SDK - Cross Compile Tools

리눅스에서 동작시킬 Application의 SDK 이며 Yocto Project에서 추가한 것이 아닌 Cross Compile이 필요한
App을 위해 사용




이번 포스팅에선 Intel Edison Firmware Release 3.0 을 기반으로 진행할 예정이다.

(2016.06.12 기준 3.5 버전이 릴리즈 되었으나 Download 사이트에는 아직 업로드가 안된 것으로 보임)


Edison Full Source 를 아래 링크에서 받는다.

http://iotdk.intel.com/src/3.0/edison/iot-devkit-yp-poky-edison-20160315.zip






3. Prepare && Build

Yocto Project를 통해 Build를 하기 위한 준비 작업


- Yocto Project를 빌드하기 위한 필수 Package를 설치 - Ubuntu 14.04 기준

  sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential \
  chrpath socat libsdl1.2-dev xterm


- 압축 해제 후 Source 를 보면 build_edison 과 poky가 존재한다.


- poky 안에 들어간 후에 

  dev@dev:~/iot-devkit/poky$ ln -s meta-intel-edison/utils/Makefile.mk Makefile

  dev@dev:~/iot-devkit/poky$ make setup

  dev@dev:~/iot-devkit/poky$ make edison-image


ps. 빌드 중 아래와 같이 paho-mqtt Package의 Fetch 오류가 존재하는데

이를 해결하기 위해서 

~/iot-devkit/poky/out/current/poky/meta-intel-iot-middleware/recipes-connectivity/paho-mqtt/paho-mqtt_3.1.bb

파일을 열어 SRC_URI 부분 "git://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.c.git;protocol=http" 로 되어 있는 부분을 "git://github.com/eclipse/paho.mqtt.c.git;protocol=http" 로 바꿔준다.





4. Flash

Build 후 Edison에 Flash 하기


- Edison Board를 Linux에 연결(OTG USB)하고

- dev@dev:~/iot-devkit/poky/out/current/build/toFlash$ ./flashall.sh 를 실행한다.

- ps. dfu 관련 command를 찾을 수 없다는 메시지가 나오면 dfu-utils 를 설치해 주면 된다.

- 그러면 아래와 같이 Reboot 을 하라는 메시지처럼 보드의 Reset 버튼을 눌러준다


- 그 후론 다운로드 되는 과정을 볼 수 있다.

- 필자의 경우는 VMWare에 dfu 모드로 USB가 안 붙는 현상이 있어 Windows에서 Flashing을 진행하였다.


- 추가로 Edison 보드를 dfu 모드로 수동으로 진입하기 위한 방법으로 U-boot Command 를 통해 run do_flash 로

실행시키면 Edison 보드가 DFU 모드로 진입하게 된다.





5. Booting 및 확인

부팅은 처음 하듯이 하면 되고 Build 한 Image가 제대로 들어갔는지 확인하기 위해선

부팅 로그를 확인해 보면 Kernel 종류와 Build 날짜가 나오는 것을 볼 수 있다.


******************************

PSH KERNEL VERSION: b0182b2b

        WR: 20104000

******************************

SCU IPC: 0x800000d0 0xfffce92c

PSH miaHOB version: TNG.B0.VVBD.0000000c

microkernel built 11:24:08 Feb 5 2015

******* PSH loader *******

PCM page cache size = 192 KB

Cache Constraint = 0 Pages

Arming IPC driver ..

Adding page store pool ..

PagestoreAddr(IMR Start Address) = 0x04899000

pageStoreSize(IMR Size) = 0x00080000

 

*** Ready to receive application ***

 

U-Boot 2014.04 (Jun 12 2016 - 01:43:27)

 

Watchdog enabled

DRAM: 980.6 MiB

MMC: tangier_sdhci: 0

In: serial

Out: serial

Err: serial

Hit any key to stop autoboot: 0

Target:blank

Partitioning already done...

Flashing already done...

GADGET DRIVER: usb_dnl_dfu

reading vmlinuz

5443776 bytes read in 134 ms (38.7 MiB/s)

Valid Boot Flag

Setup Size = 0x00003c00

Magic signature found

Using boot protocol version 2.0c

Linux kernel version 3.10.17-poky-edison+ (dev@dev) #1 SMP PREEMPT Sun Jun 12 01:46:35 KST 2016

Building boot_params at 0x00090000

Loading bzImage at address 00100000 (5428416 bytes)

Magic signature found

Kernel command line: "rootwait root=PARTUUID=012b3303-34ac-284d-99b4-34e03a2335f4 rootfstype=ext4 console=ttyMFD2 earlyprintk=ttyMFD2,keep loglevel=4 g_multi.ethernet_config=rndis systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=ec473446ca27454f4c2ac453888d2255 g_multi.dev_addr=02:00:86:8d:22:55 platform_mrfld_audio.audio_codec=dummy"

 

Starting kernel ...





6. MCU SDK (Arduino IDE) 구축

MCU를 통해 H/W Control을 위한 펌웨어를 구현하기 위해선 SDK가 필요한데 Intel Edison은 Arduino로부터 인증을 받아서

Arduino 공식 홈페이지에 존재하는 IDE를 통해 펌웨어를 제작 및 다운로드 할 수 있다.


 


- 아래 Arduino 공식 홈페이지에서 IDE를 다운받는다

  https://www.arduino.cc/en/Main/Software

- 툴 -> 보드 -> 보드 매니저 실행하여 "Intel i686 Boards by Intel" 을 설치한다.

- 설치하면 아래와 같이 Intel Edison을 확인할 수 있으며 그것을 선택한다



-  COM포트는 Edison과 통신하는 Serial이 아닌 OTG USB와 함께 설치되는

   "Intel Edison Virtual Com Port" 를 선택해 준다.


- 그리고 Blink 예제를 Load 하여 Build && Download 하면 

  아래와 같이 Transfer Complete 가 뜨면 정상적으로 Download 된 것이다.



- 제대로 다운로드 되어 실행되었다면 J2 단자 옆에 있는 LED가 2초 주기로 깜빡이는 것을 확인할 수 있다.


Comments