functional mcu programming #0: development environment

30
Functional MCU programming #0: Development environment Functional MCU programming #0: Development environment Functional MCU programming #0: Development environment Functional MCU programming #0: Development environment Functional MCU programming #0: Development environment Metasepi Project / Kiwamu Okabe Metasepi Project / Kiwamu Okabe Metasepi Project / Kiwamu Okabe Metasepi Project / Kiwamu Okabe Metasepi Project / Kiwamu Okabe

Upload: kiwamu-okabe

Post on 10-May-2015

3.034 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Functional MCU programming #0: Development environment

Functional MCU programming #0: Development environmentFunctional MCU programming #0: Development environmentFunctional MCU programming #0: Development environmentFunctional MCU programming #0: Development environmentFunctional MCU programming #0: Development environment

Metasepi Project / Kiwamu OkabeMetasepi Project / Kiwamu OkabeMetasepi Project / Kiwamu OkabeMetasepi Project / Kiwamu OkabeMetasepi Project / Kiwamu Okabe

Page 2: Functional MCU programming #0: Development environment

Who am I ?Who am I ?Who am I ?Who am I ?Who am I ?

☆ http://www.masterq.net/☆ http://www.masterq.net/☆ http://www.masterq.net/☆ http://www.masterq.net/☆ http://www.masterq.net/

☆ Twitter: @master_q☆ Twitter: @master_q☆ Twitter: @master_q☆ Twitter: @master_q☆ Twitter: @master_q

☆ Organizer of Metasepi Project☆ Organizer of Metasepi Project☆ Organizer of Metasepi Project☆ Organizer of Metasepi Project☆ Organizer of Metasepi Project

☆ A developer of Ajhc Haskell compiler☆ A developer of Ajhc Haskell compiler☆ A developer of Ajhc Haskell compiler☆ A developer of Ajhc Haskell compiler☆ A developer of Ajhc Haskell compiler

☆ A Debian Maintainer☆ A Debian Maintainer☆ A Debian Maintainer☆ A Debian Maintainer☆ A Debian Maintainer

☆ 10 years' experience in developing OS using NetBSD.☆ 10 years' experience in developing OS using NetBSD.☆ 10 years' experience in developing OS using NetBSD.☆ 10 years' experience in developing OS using NetBSD.☆ 10 years' experience in developing OS using NetBSD.

Page 3: Functional MCU programming #0: Development environment

Why functional lang for MCU?Why functional lang for MCU?Why functional lang for MCU?Why functional lang for MCU?Why functional lang for MCU?

☆ We will live in IoT world☆ We will live in IoT world☆ We will live in IoT world☆ We will live in IoT world☆ We will live in IoT world

☆ Can't debug IoT device on field☆ Can't debug IoT device on field☆ Can't debug IoT device on field☆ Can't debug IoT device on field☆ Can't debug IoT device on field

☆ Should avoid runtime error☆ Should avoid runtime error☆ Should avoid runtime error☆ Should avoid runtime error☆ Should avoid runtime error

☆ We need strong type !☆ We need strong type !☆ We need strong type !☆ We need strong type !☆ We need strong type !

Page 4: Functional MCU programming #0: Development environment

OverviewOverviewOverviewOverviewOverview

Page 5: Functional MCU programming #0: Development environment

MCU (Microcontroller)MCU (Microcontroller)MCU (Microcontroller)MCU (Microcontroller)MCU (Microcontroller)

Many architecture are on the earth.Many architecture are on the earth.Many architecture are on the earth.Many architecture are on the earth.Many architecture are on the earth.

Page 6: Functional MCU programming #0: Development environment

MCU: ARM Cortex-MMCU: ARM Cortex-MMCU: ARM Cortex-MMCU: ARM Cortex-MMCU: ARM Cortex-M

☆ Major☆ Major☆ Major☆ Major☆ Major

☆ 32bit☆ 32bit☆ 32bit☆ 32bit☆ 32bit

☆ Large memory size (> 20kB)☆ Large memory size (> 20kB)☆ Large memory size (> 20kB)☆ Large memory size (> 20kB)☆ Large memory size (> 20kB)

Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...

☆ mbed LPC1768 (5,200 YEN)☆ mbed LPC1768 (5,200 YEN)☆ mbed LPC1768 (5,200 YEN)☆ mbed LPC1768 (5,200 YEN)☆ mbed LPC1768 (5,200 YEN)https://mbed.org/platforms/mbed-LPC1768/https://mbed.org/platforms/mbed-LPC1768/https://mbed.org/platforms/mbed-LPC1768/https://mbed.org/platforms/mbed-LPC1768/https://mbed.org/platforms/mbed-LPC1768/

☆ STM32F4DISCOVERY (1,650 YEN)☆ STM32F4DISCOVERY (1,650 YEN)☆ STM32F4DISCOVERY (1,650 YEN)☆ STM32F4DISCOVERY (1,650 YEN)☆ STM32F4DISCOVERY (1,650 YEN)http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419

Page 7: Functional MCU programming #0: Development environment

MCU: TI MSP430MCU: TI MSP430MCU: TI MSP430MCU: TI MSP430MCU: TI MSP430

☆ Minor☆ Minor☆ Minor☆ Minor☆ Minor

☆ 16bit☆ 16bit☆ 16bit☆ 16bit☆ 16bit

☆ Small memory size (< 4kB)☆ Small memory size (< 4kB)☆ Small memory size (< 4kB)☆ Small memory size (< 4kB)☆ Small memory size (< 4kB)

Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...

☆ MSP-EXP430G2 (1,202 YEN)☆ MSP-EXP430G2 (1,202 YEN)☆ MSP-EXP430G2 (1,202 YEN)☆ MSP-EXP430G2 (1,202 YEN)☆ MSP-EXP430G2 (1,202 YEN)

http://www.ti.com/tool/msp-exp430g2http://www.ti.com/tool/msp-exp430g2http://www.ti.com/tool/msp-exp430g2http://www.ti.com/tool/msp-exp430g2http://www.ti.com/tool/msp-exp430g2

Page 8: Functional MCU programming #0: Development environment

MCU: Atmel AVRMCU: Atmel AVRMCU: Atmel AVRMCU: Atmel AVRMCU: Atmel AVR

☆ Major☆ Major☆ Major☆ Major☆ Major

☆ 8bit and Harvard architecture☆ 8bit and Harvard architecture☆ 8bit and Harvard architecture☆ 8bit and Harvard architecture☆ 8bit and Harvard architecture

☆ Small memory size (< 8kB)☆ Small memory size (< 8kB)☆ Small memory size (< 8kB)☆ Small memory size (< 8kB)☆ Small memory size (< 8kB)

Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...Good MCU Board is ...

☆ Arduino Mega 2560 compat board (2,690 YEN)☆ Arduino Mega 2560 compat board (2,690 YEN)☆ Arduino Mega 2560 compat board (2,690 YEN)☆ Arduino Mega 2560 compat board (2,690 YEN)☆ Arduino Mega 2560 compat board (2,690 YEN)http://www.amazon.co.jp/dp/B00CF2REXChttp://www.amazon.co.jp/dp/B00CF2REXChttp://www.amazon.co.jp/dp/B00CF2REXChttp://www.amazon.co.jp/dp/B00CF2REXChttp://www.amazon.co.jp/dp/B00CF2REXC

Page 9: Functional MCU programming #0: Development environment

Cross compilerCross compilerCross compilerCross compilerCross compiler

☆ Functional language implementation☆ Functional language implementation☆ Functional language implementation☆ Functional language implementation☆ Functional language implementation

☆ many many many ...☆ many many many ...☆ many many many ...☆ many many many ...☆ many many many ...

☆ Which language good for MCU ?☆ Which language good for MCU ?☆ Which language good for MCU ?☆ Which language good for MCU ?☆ Which language good for MCU ?

Page 10: Functional MCU programming #0: Development environment

Cross compiler: (A)jhcCross compiler: (A)jhcCross compiler: (A)jhcCross compiler: (A)jhcCross compiler: (A)jhc

http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/

☆ Language: Haskell☆ Language: Haskell☆ Language: Haskell☆ Language: Haskell☆ Language: Haskell

☆ Haskell is major !☆ Haskell is major !☆ Haskell is major !☆ Haskell is major !☆ Haskell is major !

☆ Need GC heap = Need more memory☆ Need GC heap = Need more memory☆ Need GC heap = Need more memory☆ Need GC heap = Need more memory☆ Need GC heap = Need more memory

☆ Experience running on MCU☆ Experience running on MCU☆ Experience running on MCU☆ Experience running on MCU☆ Experience running on MCUARM Cortex-Mhttps://github.com/ajhc/demo-cortex-m3ARM Cortex-Mhttps://github.com/ajhc/demo-cortex-m3ARM Cortex-Mhttps://github.com/ajhc/demo-cortex-m3ARM Cortex-Mhttps://github.com/ajhc/demo-cortex-m3ARM Cortex-Mhttps://github.com/ajhc/demo-cortex-m3

Page 11: Functional MCU programming #0: Development environment

Cross compiler: ATSCross compiler: ATSCross compiler: ATSCross compiler: ATSCross compiler: ATS

http://www.ats-lang.org/http://www.ats-lang.org/http://www.ats-lang.org/http://www.ats-lang.org/http://www.ats-lang.org/

http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/

☆ Language: ML☆ Language: ML☆ Language: ML☆ Language: ML☆ Language: ML

☆ Optional GC = Need low memory☆ Optional GC = Need low memory☆ Optional GC = Need low memory☆ Optional GC = Need low memory☆ Optional GC = Need low memory

☆ No experience running on MCU☆ No experience running on MCU☆ No experience running on MCU☆ No experience running on MCU☆ No experience running on MCU

Page 12: Functional MCU programming #0: Development environment

Cross compiler: RustCross compiler: RustCross compiler: RustCross compiler: RustCross compiler: Rust

http://www.rust-lang.org/http://www.rust-lang.org/http://www.rust-lang.org/http://www.rust-lang.org/http://www.rust-lang.org/

☆ Language: Own syntax like C or JS☆ Language: Own syntax like C or JS☆ Language: Own syntax like C or JS☆ Language: Own syntax like C or JS☆ Language: Own syntax like C or JS

☆ Optional GC = Need low memory☆ Optional GC = Need low memory☆ Optional GC = Need low memory☆ Optional GC = Need low memory☆ Optional GC = Need low memory

☆ Experience running on MCU☆ Experience running on MCU☆ Experience running on MCU☆ Experience running on MCU☆ Experience running on MCUARM Cortex-Mhttps://github.com/neykov/armbootARM Cortex-Mhttps://github.com/neykov/armbootARM Cortex-Mhttps://github.com/neykov/armbootARM Cortex-Mhttps://github.com/neykov/armbootARM Cortex-Mhttps://github.com/neykov/armboot

☆ @pirapira knows detail of it☆ @pirapira knows detail of it☆ @pirapira knows detail of it☆ @pirapira knows detail of it☆ @pirapira knows detail of it

Page 13: Functional MCU programming #0: Development environment

gdbserver (Debugger)gdbserver (Debugger)gdbserver (Debugger)gdbserver (Debugger)gdbserver (Debugger)

☆ Gdb is major debugger☆ Gdb is major debugger☆ Gdb is major debugger☆ Gdb is major debugger☆ Gdb is major debugger

☆ But gdb is only for the program running on your PC☆ But gdb is only for the program running on your PC☆ But gdb is only for the program running on your PC☆ But gdb is only for the program running on your PC☆ But gdb is only for the program running on your PC

☆ How debug program running on MCU ?☆ How debug program running on MCU ?☆ How debug program running on MCU ?☆ How debug program running on MCU ?☆ How debug program running on MCU ?

☆ Gdbserver is good for the use case☆ Gdbserver is good for the use case☆ Gdbserver is good for the use case☆ Gdbserver is good for the use case☆ Gdbserver is good for the use case

☆ There are many implementation☆ There are many implementation☆ There are many implementation☆ There are many implementation☆ There are many implementation

Page 14: Functional MCU programming #0: Development environment

gdbserver: OpenOCDgdbserver: OpenOCDgdbserver: OpenOCDgdbserver: OpenOCDgdbserver: OpenOCD

http://openocd.sourceforge.net/http://openocd.sourceforge.net/http://openocd.sourceforge.net/http://openocd.sourceforge.net/http://openocd.sourceforge.net/

☆ Support many MCU☆ Support many MCU☆ Support many MCU☆ Support many MCU☆ Support many MCU

ARM7, ARM9, ARM11, ARM Cortex-M, XScale, MIPS m4k, Orion SoCARM7, ARM9, ARM11, ARM Cortex-M, XScale, MIPS m4k, Orion SoCARM7, ARM9, ARM11, ARM Cortex-M, XScale, MIPS m4k, Orion SoCARM7, ARM9, ARM11, ARM Cortex-M, XScale, MIPS m4k, Orion SoCARM7, ARM9, ARM11, ARM Cortex-M, XScale, MIPS m4k, Orion SoC

☆ Support many JTAG☆ Support many JTAG☆ Support many JTAG☆ Support many JTAG☆ Support many JTAG

☆ Need config file☆ Need config file☆ Need config file☆ Need config file☆ Need config file

Page 15: Functional MCU programming #0: Development environment

gdbserver: pyOCDgdbserver: pyOCDgdbserver: pyOCDgdbserver: pyOCDgdbserver: pyOCD

https://github.com/mbedmicro/pyOCDhttps://github.com/mbedmicro/pyOCDhttps://github.com/mbedmicro/pyOCDhttps://github.com/mbedmicro/pyOCDhttps://github.com/mbedmicro/pyOCD

☆ Only for MCU using CMSIS-DAP☆ Only for MCU using CMSIS-DAP☆ Only for MCU using CMSIS-DAP☆ Only for MCU using CMSIS-DAP☆ Only for MCU using CMSIS-DAP

☆ But now support only mbed LPC1768☆ But now support only mbed LPC1768☆ But now support only mbed LPC1768☆ But now support only mbed LPC1768☆ But now support only mbed LPC1768

☆ In future, support more board ?☆ In future, support more board ?☆ In future, support more board ?☆ In future, support more board ?☆ In future, support more board ?

Seeeduino Arch Pro ($43.41)Seeeduino Arch Pro ($43.41)Seeeduino Arch Pro ($43.41)Seeeduino Arch Pro ($43.41)Seeeduino Arch Pro ($43.41)http://www.seeedstudio.com/depot/arch-pro-p-1677.htmlhttp://www.seeedstudio.com/depot/arch-pro-p-1677.htmlhttp://www.seeedstudio.com/depot/arch-pro-p-1677.htmlhttp://www.seeedstudio.com/depot/arch-pro-p-1677.htmlhttp://www.seeedstudio.com/depot/arch-pro-p-1677.html

FRDM-KL46Z (1,634 YEN)FRDM-KL46Z (1,634 YEN)FRDM-KL46Z (1,634 YEN)FRDM-KL46Z (1,634 YEN)FRDM-KL46Z (1,634 YEN)http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL46Zhttp://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL46Zhttp://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL46Zhttp://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL46Zhttp://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL46Z

Page 16: Functional MCU programming #0: Development environment

gdbserver: STLINKgdbserver: STLINKgdbserver: STLINKgdbserver: STLINKgdbserver: STLINK

https://github.com/texane/stlinkhttps://github.com/texane/stlinkhttps://github.com/texane/stlinkhttps://github.com/texane/stlinkhttps://github.com/texane/stlink

☆ Only for STM32 MCU☆ Only for STM32 MCU☆ Only for STM32 MCU☆ Only for STM32 MCU☆ Only for STM32 MCU

☆ STM32 is based on ARM Cortex-M☆ STM32 is based on ARM Cortex-M☆ STM32 is based on ARM Cortex-M☆ STM32 is based on ARM Cortex-M☆ STM32 is based on ARM Cortex-M

☆ No config is good config☆ No config is good config☆ No config is good config☆ No config is good config☆ No config is good config

Page 17: Functional MCU programming #0: Development environment

gdbserver: AVaRICEgdbserver: AVaRICEgdbserver: AVaRICEgdbserver: AVaRICEgdbserver: AVaRICE

http://avarice.sourceforge.net/http://avarice.sourceforge.net/http://avarice.sourceforge.net/http://avarice.sourceforge.net/http://avarice.sourceforge.net/

☆ Only for Atmel AVR☆ Only for Atmel AVR☆ Only for Atmel AVR☆ Only for Atmel AVR☆ Only for Atmel AVR

Page 18: Functional MCU programming #0: Development environment

Serial consoleSerial consoleSerial consoleSerial consoleSerial console

☆ Some MCU boards support "USB Virtual Serial Port"☆ Some MCU boards support "USB Virtual Serial Port"☆ Some MCU boards support "USB Virtual Serial Port"☆ Some MCU boards support "USB Virtual Serial Port"☆ Some MCU boards support "USB Virtual Serial Port"

☆ If not, need USB serial converter☆ If not, need USB serial converter☆ If not, need USB serial converter☆ If not, need USB serial converter☆ If not, need USB serial converter

Page 19: Functional MCU programming #0: Development environment

PeripheralPeripheralPeripheralPeripheralPeripheral

☆ GPIO☆ GPIO☆ GPIO☆ GPIO☆ GPIO

☆ I2C / SMBus☆ I2C / SMBus☆ I2C / SMBus☆ I2C / SMBus☆ I2C / SMBus

☆ USB host / device☆ USB host / device☆ USB host / device☆ USB host / device☆ USB host / device

☆ Bluetooth (LE)☆ Bluetooth (LE)☆ Bluetooth (LE)☆ Bluetooth (LE)☆ Bluetooth (LE)

☆ Sensor☆ Sensor☆ Sensor☆ Sensor☆ Sensor

☆ LCD Display☆ LCD Display☆ LCD Display☆ LCD Display☆ LCD Display

..............................

Page 20: Functional MCU programming #0: Development environment

EthernetEthernetEthernetEthernetEthernet

Use lwIP TCP/IP stack.Use lwIP TCP/IP stack.Use lwIP TCP/IP stack.Use lwIP TCP/IP stack.Use lwIP TCP/IP stack.http://savannah.nongnu.org/projects/lwip/http://savannah.nongnu.org/projects/lwip/http://savannah.nongnu.org/projects/lwip/http://savannah.nongnu.org/projects/lwip/http://savannah.nongnu.org/projects/lwip/

But it needs thread supported by OS.But it needs thread supported by OS.But it needs thread supported by OS.But it needs thread supported by OS.But it needs thread supported by OS.

Page 21: Functional MCU programming #0: Development environment

OS: FreeRTOSOS: FreeRTOSOS: FreeRTOSOS: FreeRTOSOS: FreeRTOS

http://www.freertos.org/http://www.freertos.org/http://www.freertos.org/http://www.freertos.org/http://www.freertos.org/

☆ Major☆ Major☆ Major☆ Major☆ Major

☆ Bad document ?☆ Bad document ?☆ Bad document ?☆ Bad document ?☆ Bad document ?

Page 22: Functional MCU programming #0: Development environment

OS: ChibiOS/RTOS: ChibiOS/RTOS: ChibiOS/RTOS: ChibiOS/RTOS: ChibiOS/RT

http://www.chibios.org/http://www.chibios.org/http://www.chibios.org/http://www.chibios.org/http://www.chibios.org/

☆ Support ARM7, ARM Cortex-M, AVR, PPC, MSP430☆ Support ARM7, ARM Cortex-M, AVR, PPC, MSP430☆ Support ARM7, ARM Cortex-M, AVR, PPC, MSP430☆ Support ARM7, ARM Cortex-M, AVR, PPC, MSP430☆ Support ARM7, ARM Cortex-M, AVR, PPC, MSP430

☆ OS is written by C☆ OS is written by C☆ OS is written by C☆ OS is written by C☆ OS is written by C

☆ Small☆ Small☆ Small☆ Small☆ Small

☆ Good document☆ Good document☆ Good document☆ Good document☆ Good document

☆ Used by gniibe☆ Used by gniibe☆ Used by gniibe☆ Used by gniibe☆ Used by gniibe

Page 23: Functional MCU programming #0: Development environment

OS: mbed RTOSOS: mbed RTOSOS: mbed RTOSOS: mbed RTOSOS: mbed RTOS

http://mbed.org/handbook/RTOShttp://mbed.org/handbook/RTOShttp://mbed.org/handbook/RTOShttp://mbed.org/handbook/RTOShttp://mbed.org/handbook/RTOS

☆ Only for mbed☆ Only for mbed☆ Only for mbed☆ Only for mbed☆ Only for mbed

☆ OS core is written by C☆ OS core is written by C☆ OS core is written by C☆ OS core is written by C☆ OS core is written by C

☆ C++ wrapper for API☆ C++ wrapper for API☆ C++ wrapper for API☆ C++ wrapper for API☆ C++ wrapper for API

Page 24: Functional MCU programming #0: Development environment

Choose our environment setChoose our environment setChoose our environment setChoose our environment setChoose our environment set

Page 25: Functional MCU programming #0: Development environment

Setup AjhcSetup AjhcSetup AjhcSetup AjhcSetup Ajhc

http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/$ sudo apt-get install haskell-platform$ sudo apt-get install gcc m4 patch libncurses5-dev$ cabal install drift$ export PATH=$PATH:$HOME/.cabal/bin$ cabal install ajhc

$ sudo apt-get install haskell-platform$ sudo apt-get install gcc m4 patch libncurses5-dev$ cabal install drift$ export PATH=$PATH:$HOME/.cabal/bin$ cabal install ajhc

$ sudo apt-get install haskell-platform$ sudo apt-get install gcc m4 patch libncurses5-dev$ cabal install drift$ export PATH=$PATH:$HOME/.cabal/bin$ cabal install ajhc

$ sudo apt-get install haskell-platform$ sudo apt-get install gcc m4 patch libncurses5-dev$ cabal install drift$ export PATH=$PATH:$HOME/.cabal/bin$ cabal install ajhc

$ sudo apt-get install haskell-platform$ sudo apt-get install gcc m4 patch libncurses5-dev$ cabal install drift$ export PATH=$PATH:$HOME/.cabal/bin$ cabal install ajhc

Able to use it on Windows/Mac OS X ?Able to use it on Windows/Mac OS X ?Able to use it on Windows/Mac OS X ?Able to use it on Windows/Mac OS X ?Able to use it on Windows/Mac OS X ?

Page 26: Functional MCU programming #0: Development environment

Setup cross gcc and gdbSetup cross gcc and gdbSetup cross gcc and gdbSetup cross gcc and gdbSetup cross gcc and gdb

☆ Use summon-arm-toolchain☆ Use summon-arm-toolchain☆ Use summon-arm-toolchain☆ Use summon-arm-toolchain☆ Use summon-arm-toolchain$ git clone https://github.com/master-q/summon-arm-toolchain.git$ sudo apt-get install build-essential git flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo libtool libftdi-dev libusb-1.0-0-dev zlib1g zlib1g-dev python-yaml$ cd summon-arm-toolchain/$ ./summon-arm-toolchain$ export PATH=$HOME/sat/bin:$PATH

$ git clone https://github.com/master-q/summon-arm-toolchain.git$ sudo apt-get install build-essential git flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo libtool libftdi-dev libusb-1.0-0-dev zlib1g zlib1g-dev python-yaml$ cd summon-arm-toolchain/$ ./summon-arm-toolchain$ export PATH=$HOME/sat/bin:$PATH

$ git clone https://github.com/master-q/summon-arm-toolchain.git$ sudo apt-get install build-essential git flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo libtool libftdi-dev libusb-1.0-0-dev zlib1g zlib1g-dev python-yaml$ cd summon-arm-toolchain/$ ./summon-arm-toolchain$ export PATH=$HOME/sat/bin:$PATH

$ git clone https://github.com/master-q/summon-arm-toolchain.git$ sudo apt-get install build-essential git flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo libtool libftdi-dev libusb-1.0-0-dev zlib1g zlib1g-dev python-yaml$ cd summon-arm-toolchain/$ ./summon-arm-toolchain$ export PATH=$HOME/sat/bin:$PATH

$ git clone https://github.com/master-q/summon-arm-toolchain.git$ sudo apt-get install build-essential git flex bison libgmp3-dev libmpfr-dev libncurses5-dev libmpc-dev autoconf texinfo libtool libftdi-dev libusb-1.0-0-dev zlib1g zlib1g-dev python-yaml$ cd summon-arm-toolchain/$ ./summon-arm-toolchain$ export PATH=$HOME/sat/bin:$PATH

なにやら不穏なmaster-qというリポジトリからcloneしているのは、"unknown command `colophon'" とか言われるケースがあるため詳細: http://trac.cross-lfs.org/ticket/926

なにやら不穏なmaster-qというリポジトリからcloneしているのは、"unknown command `colophon'" とか言われるケースがあるため詳細: http://trac.cross-lfs.org/ticket/926

なにやら不穏なmaster-qというリポジトリからcloneしているのは、"unknown command `colophon'" とか言われるケースがあるため詳細: http://trac.cross-lfs.org/ticket/926

なにやら不穏なmaster-qというリポジトリからcloneしているのは、"unknown command `colophon'" とか言われるケースがあるため詳細: http://trac.cross-lfs.org/ticket/926

なにやら不穏なmaster-qというリポジトリからcloneしているのは、"unknown command `colophon'" とか言われるケースがあるため詳細: http://trac.cross-lfs.org/ticket/926

☆ Use GCC ARM Embedded☆ Use GCC ARM Embedded☆ Use GCC ARM Embedded☆ Use GCC ARM Embedded☆ Use GCC ARM Embeddedhttps://launchpad.net/gcc-arm-embedded/https://launchpad.net/gcc-arm-embedded/https://launchpad.net/gcc-arm-embedded/https://launchpad.net/gcc-arm-embedded/https://launchpad.net/gcc-arm-embedded/

Page 27: Functional MCU programming #0: Development environment

Setup pyOCDSetup pyOCDSetup pyOCDSetup pyOCDSetup pyOCD

☆ Upgrade mbed firmware☆ Upgrade mbed firmware☆ Upgrade mbed firmware☆ Upgrade mbed firmware☆ Upgrade mbed firmwarehttp://mbed.org/handbook/Firmware-LPC1768-LPC11U24http://mbed.org/handbook/Firmware-LPC1768-LPC11U24http://mbed.org/handbook/Firmware-LPC1768-LPC11U24http://mbed.org/handbook/Firmware-LPC1768-LPC11U24http://mbed.org/handbook/Firmware-LPC1768-LPC11U24

☆ Install pyOCD☆ Install pyOCD☆ Install pyOCD☆ Install pyOCD☆ Install pyOCDhttp://mbed.org/blog/entry/Debugging-from-GDB-using-pyOCD/http://mbed.org/blog/entry/Debugging-from-GDB-using-pyOCD/http://mbed.org/blog/entry/Debugging-from-GDB-using-pyOCD/http://mbed.org/blog/entry/Debugging-from-GDB-using-pyOCD/http://mbed.org/blog/entry/Debugging-from-GDB-using-pyOCD/

$ sudo apt-get install python libusb-1.0-0-dev$ git clone https://github.com/walac/pyusb.git$ cd pyusb$ sudo python setup.py install$ git clone https://github.com/mbedmicro/pyOCD.git$ cd pyOCD$ sudo python setup.py install

$ sudo apt-get install python libusb-1.0-0-dev$ git clone https://github.com/walac/pyusb.git$ cd pyusb$ sudo python setup.py install$ git clone https://github.com/mbedmicro/pyOCD.git$ cd pyOCD$ sudo python setup.py install

$ sudo apt-get install python libusb-1.0-0-dev$ git clone https://github.com/walac/pyusb.git$ cd pyusb$ sudo python setup.py install$ git clone https://github.com/mbedmicro/pyOCD.git$ cd pyOCD$ sudo python setup.py install

$ sudo apt-get install python libusb-1.0-0-dev$ git clone https://github.com/walac/pyusb.git$ cd pyusb$ sudo python setup.py install$ git clone https://github.com/mbedmicro/pyOCD.git$ cd pyOCD$ sudo python setup.py install

$ sudo apt-get install python libusb-1.0-0-dev$ git clone https://github.com/walac/pyusb.git$ cd pyusb$ sudo python setup.py install$ git clone https://github.com/mbedmicro/pyOCD.git$ cd pyOCD$ sudo python setup.py install

__bootstrap_innerとかなんかgdb_test.pyがエラーを吐く場合http://mbed.org/forum/mbed/topic/4544/を参考にpatchをあてるらしい...

__bootstrap_innerとかなんかgdb_test.pyがエラーを吐く場合http://mbed.org/forum/mbed/topic/4544/を参考にpatchをあてるらしい...

__bootstrap_innerとかなんかgdb_test.pyがエラーを吐く場合http://mbed.org/forum/mbed/topic/4544/を参考にpatchをあてるらしい...

__bootstrap_innerとかなんかgdb_test.pyがエラーを吐く場合http://mbed.org/forum/mbed/topic/4544/を参考にpatchをあてるらしい...

__bootstrap_innerとかなんかgdb_test.pyがエラーを吐く場合http://mbed.org/forum/mbed/topic/4544/を参考にpatchをあてるらしい...

Page 28: Functional MCU programming #0: Development environment

Compile exampleCompile exampleCompile exampleCompile exampleCompile examplehttps://github.com/ajhc/demo-cortex-m3/tree/master/mbed-nxp-lpc1768https://github.com/ajhc/demo-cortex-m3/tree/master/mbed-nxp-lpc1768https://github.com/ajhc/demo-cortex-m3/tree/master/mbed-nxp-lpc1768https://github.com/ajhc/demo-cortex-m3/tree/master/mbed-nxp-lpc1768https://github.com/ajhc/demo-cortex-m3/tree/master/mbed-nxp-lpc1768

$ git clone https://github.com/ajhc/demo-cortex-m3.git$ cd demo-cortex-m3/mbed-nxp-lpc1768$ cd samples/Haskell$ make

$ git clone https://github.com/ajhc/demo-cortex-m3.git$ cd demo-cortex-m3/mbed-nxp-lpc1768$ cd samples/Haskell$ make

$ git clone https://github.com/ajhc/demo-cortex-m3.git$ cd demo-cortex-m3/mbed-nxp-lpc1768$ cd samples/Haskell$ make

$ git clone https://github.com/ajhc/demo-cortex-m3.git$ cd demo-cortex-m3/mbed-nxp-lpc1768$ cd samples/Haskell$ make

$ git clone https://github.com/ajhc/demo-cortex-m3.git$ cd demo-cortex-m3/mbed-nxp-lpc1768$ cd samples/Haskell$ make

Page 29: Functional MCU programming #0: Development environment

Setup STLINKSetup STLINKSetup STLINKSetup STLINKSetup STLINK

https://github.com/texane/stlinkhttps://github.com/texane/stlinkhttps://github.com/texane/stlinkhttps://github.com/texane/stlinkhttps://github.com/texane/stlink$ sudo apt-get install libsgutils2-dev libusb-1.0-0-dev$ git clone https://github.com/texane/stlink.git$ cd stlink/$ ./autogen.sh$ ./configure$ make$ sudo make install

$ sudo apt-get install libsgutils2-dev libusb-1.0-0-dev$ git clone https://github.com/texane/stlink.git$ cd stlink/$ ./autogen.sh$ ./configure$ make$ sudo make install

$ sudo apt-get install libsgutils2-dev libusb-1.0-0-dev$ git clone https://github.com/texane/stlink.git$ cd stlink/$ ./autogen.sh$ ./configure$ make$ sudo make install

$ sudo apt-get install libsgutils2-dev libusb-1.0-0-dev$ git clone https://github.com/texane/stlink.git$ cd stlink/$ ./autogen.sh$ ./configure$ make$ sudo make install

$ sudo apt-get install libsgutils2-dev libusb-1.0-0-dev$ git clone https://github.com/texane/stlink.git$ cd stlink/$ ./autogen.sh$ ./configure$ make$ sudo make install

Page 30: Functional MCU programming #0: Development environment

Get mbed LPC1768 !Get mbed LPC1768 !Get mbed LPC1768 !Get mbed LPC1768 !Get mbed LPC1768 !

☆ マルツパーツ館☆ マルツパーツ館☆ マルツパーツ館☆ マルツパーツ館☆ マルツパーツ館http://www.marutsu.co.jp/shohin_72981/http://www.marutsu.co.jp/shohin_72981/http://www.marutsu.co.jp/shohin_72981/http://www.marutsu.co.jp/shohin_72981/http://www.marutsu.co.jp/shohin_72981/

☆ スイッチサイエンス☆ スイッチサイエンス☆ スイッチサイエンス☆ スイッチサイエンス☆ スイッチサイエンスhttp://www.switch-science.com/catalog/250/http://www.switch-science.com/catalog/250/http://www.switch-science.com/catalog/250/http://www.switch-science.com/catalog/250/http://www.switch-science.com/catalog/250/

☆ 秋月電子通商☆ 秋月電子通商☆ 秋月電子通商☆ 秋月電子通商☆ 秋月電子通商http://akizukidenshi.com/catalog/g/gM-03596/http://akizukidenshi.com/catalog/g/gM-03596/http://akizukidenshi.com/catalog/g/gM-03596/http://akizukidenshi.com/catalog/g/gM-03596/http://akizukidenshi.com/catalog/g/gM-03596/